[PATCH] osmo-bsc[master]: gscon: fix illegal state transitions

2018-03-26 Thread dexter

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

gscon: fix illegal state transitions

The GSCON fsm has two illegal state transions. The transions
themselves are logically legal but theur respective entries
in out_state_mask are missing.

- remove unnecessary transition from ST_ACTIVE to ST_ACTIVE
- Add ST_CLEARING to the out_state_mask of ST_WAIT_HO_COMPL

Change-Id: I165c3e8b4b268b50e5f4a482b0fe890e940637b3
Closes: OS#3109
---
M src/libbsc/bsc_subscr_conn_fsm.c
1 file changed, 1 insertion(+), 2 deletions(-)


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

diff --git a/src/libbsc/bsc_subscr_conn_fsm.c b/src/libbsc/bsc_subscr_conn_fsm.c
index 03eec3f..a24cb31 100644
--- a/src/libbsc/bsc_subscr_conn_fsm.c
+++ b/src/libbsc/bsc_subscr_conn_fsm.c
@@ -417,7 +417,6 @@
if (!conn->user_plane.fi_bts) {
resp = 
gsm0808_create_assignment_failure(GSM0808_CAUSE_EQUIPMENT_FAILURE, NULL);
sigtran_send(conn, resp, fi);
-   osmo_fsm_inst_state_chg(fi, ST_ACTIVE, 0, 0);
return;
}
break;
@@ -916,7 +915,7 @@
[ST_WAIT_HO_COMPL] = {
.name = OSMO_STRINGIFY(WAIT_HO_COMPL),
.in_event_mask = S(GSCON_EV_HO_COMPL) | S(GSCON_EV_HO_FAIL) | 
S(GSCON_EV_HO_TIMEOUT),
-   .out_state_mask = S(ST_ACTIVE) | S(ST_WAIT_MDCX_BTS_HO),
+   .out_state_mask = S(ST_ACTIVE) | S(ST_WAIT_MDCX_BTS_HO) | 
S(ST_CLEARING),
.action = gscon_fsm_wait_ho_compl,
},
[ST_WAIT_MDCX_BTS_HO] = {

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

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


libosmocore[master]: contrib/fsm-to-dot: add -h option to print basic instructions

2018-03-26 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


libosmocore[master]: contrib/fsm-to-dot: less false positives on event parsing

2018-03-26 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


osmo-bsc[master]: gscon: fix illegal state transitions

2018-03-26 Thread Harald Welte

Patch Set 1: Code-Review+1

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

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


libosmocore[master]: contrib/fsm-to-dot: allow transition from and to the same state

2018-03-26 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


libosmocore[master]: contrib/fsm-to-dot: warn and draw unallowed state transitions

2018-03-26 Thread Harald Welte

Patch Set 4: Code-Review+2

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

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


libosmocore[master]: contrib/fsm-to-dot: add default edge label '-'

2018-03-26 Thread Harald Welte

Patch Set 2: Code-Review+2

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

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


[MERGED] libosmocore[master]: cosmetic: gsm0808_test: drop extraneous assertion

2018-03-26 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: cosmetic: gsm0808_test: drop extraneous assertion
..


cosmetic: gsm0808_test: drop extraneous assertion

Recent commit I77cd4b9142510c6914298b720d9c19ab68f9ebef left an obsolete
assertion around. It is already done in the if-body now.

Change-Id: I1bb2ea363e8a9d86b24338df3584abc93ebc6dd4
---
M tests/gsm0808/gsm0808_test.c
1 file changed, 0 insertions(+), 1 deletion(-)

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



diff --git a/tests/gsm0808/gsm0808_test.c b/tests/gsm0808/gsm0808_test.c
index 4bf61e7..9730be2 100644
--- a/tests/gsm0808/gsm0808_test.c
+++ b/tests/gsm0808/gsm0808_test.c
@@ -1045,7 +1045,6 @@
printf("expect: %s\n", osmo_hexdump(cil_enc_expected, 
sizeof(cil_enc_expected)));
OSMO_ASSERT(false);
}
-   OSMO_ASSERT(memcmp(cil_enc_expected, msg->data, msg->len) == 0);
 
rc_dec = gsm0808_dec_cell_id_list2(_cil, msg->data + 2, msg->len - 
2);
OSMO_ASSERT(rc_dec == msg->len - 2);

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

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


libosmocore[master]: contrib/fsm-to-dot: mark arrows that feed events

2018-03-26 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


libosmocore[master]: contrib/fsm-to-dot: don't match on event names in comments

2018-03-26 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


libosmocore[master]: cosmetic: gsm0808_test: drop extraneous assertion

2018-03-26 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


[MERGED] libosmo-abis[master]: preserve 'when' flags of new osmo_fd in ipaccess_rcvmsg()

2018-03-26 Thread Stefan Sperling
Stefan Sperling has submitted this change and it was merged.

Change subject: preserve 'when' flags of new osmo_fd in ipaccess_rcvmsg()
..


preserve 'when' flags of new osmo_fd in ipaccess_rcvmsg()

ipaccess_rcvmsg() disposes of a temporary osmo_fd structure after
the RSL link comes up. It copies data from its temporary osmo_fd
to the new one returned by sign_link_up(). However, in doing so,
it clobbered the 'when' flags, which could differ between the two
osmo_fd structures.
For instance, BSC_FD_WRITE could be set on the new osmo_fd but
not on the old one, in case sign_link_up() has already enqueued
outbound messages using the new osmo_fd.

Because of this behaviour, a patch committed to osmo-bsc to address
issue #2719 did not work as intended and had to be reverted.
After this change, that osmo-bsc patch should work as intended
and issue #2719 can hopefully be resolved.

Change-Id: I52f7c903212b38e9c87e4d45e52b231b6f1ae9f5
Related: OS#2719
---
M src/input/ipaccess.c
1 file changed, 5 insertions(+), 1 deletion(-)

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



diff --git a/src/input/ipaccess.c b/src/input/ipaccess.c
index 5eee57e..9a80d8e 100644
--- a/src/input/ipaccess.c
+++ b/src/input/ipaccess.c
@@ -194,7 +194,11 @@
newbfd = >driver.ipaccess.fd;
 
/* get rid of our old temporary bfd */
-   memcpy(newbfd, bfd, sizeof(*newbfd));
+   memcpy(>list, >list, sizeof(newbfd->list));
+   newbfd->fd = bfd->fd;
+   newbfd->when |= bfd->when; /* preserve 'newbfd->when' 
flags potentially set by sign_link_up() */
+   newbfd->cb = bfd->cb;
+   newbfd->data = bfd->data;
newbfd->priv_nr = E1INP_SIGN_RSL + unit_data.trx_id;
osmo_fd_unregister(bfd);
bfd->fd = -1;

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I52f7c903212b38e9c87e4d45e52b231b6f1ae9f5
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 


osmo-gsm-tester[master]: WIP.. see what is executed? Where is cdf_test

2018-03-26 Thread Pau Espin Pedrol

Patch Set 1:

It seems osmo-gsm-tester_gerrit job was misisng some configs I see in other 
gerrit jobs. I added it and I'm trying it now with another patch of mine.

The main issue is that those jobs were migrated lately to use 
jenkins-job-builder and the confgis were pushed to jenkins but the patches with 
the yml content are stil lin review and not fully merged yet.

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ib9cd27c9d2628ad1d001ec57f6c80c3690df9a86
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Holger Freyther 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: lynxis lazus 
Gerrit-HasComments: No


libosmo-abis[master]: preserve 'when' flags of new osmo_fd in ipaccess_rcvmsg()

2018-03-26 Thread Stefan Sperling

Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/#/c/7462/1/src/input/ipaccess.c
File src/input/ipaccess.c:

Line 197:   memcpy(>list, >list, 
sizeof(newbfd->list));
> why not just
Seems to me like both forms are equivalent and it's not an important enough 
detail to delay the fix for another round of review.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I52f7c903212b38e9c87e4d45e52b231b6f1ae9f5
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-abis
Gerrit-Branch: master
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-HasComments: Yes


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

2018-03-26 Thread dexter
Hello Neels Hofmeyr, Jenkins Builder,

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

https://gerrit.osmocom.org/7428

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

cosmetic: remove dead code

There is a lot of dead code in osmo_bsc_msc.c that used to handle
the IPA multiplexed SSCP lite A interface.

- remove portions of the dead code
- remove IPA Ping related VTY commands

Change-Id: I5cf3fec31cc774c902f3cfe6d16fb85ef301694a
---
M doc/examples/osmo-bsc/osmo-bsc.cfg
M include/osmocom/bsc/bsc_msc_data.h
M src/osmo-bsc/osmo_bsc_api.c
M src/osmo-bsc/osmo_bsc_msc.c
M src/osmo-bsc/osmo_bsc_vty.c
5 files changed, 0 insertions(+), 593 deletions(-)


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

diff --git a/doc/examples/osmo-bsc/osmo-bsc.cfg 
b/doc/examples/osmo-bsc/osmo-bsc.cfg
index 2d759ca..2a41d84 100644
--- a/doc/examples/osmo-bsc/osmo-bsc.cfg
+++ b/doc/examples/osmo-bsc/osmo-bsc.cfg
@@ -78,10 +78,6 @@
 phys_chan_config TCH/F
 hopping enabled 0
 msc 0
- ip.access rtp-base 4000
- timeout-ping 20
- timeout-pong 5
- no timeout-ping advanced
  no bsc-welcome-text
  no bsc-msc-lost-text
  no bsc-grace-text
diff --git a/include/osmocom/bsc/bsc_msc_data.h 
b/include/osmocom/bsc/bsc_msc_data.h
index a04e632..bedf412 100644
--- a/include/osmocom/bsc/bsc_msc_data.h
+++ b/include/osmocom/bsc/bsc_msc_data.h
@@ -73,11 +73,6 @@
 
 
/* Connection data */
-   int ping_timeout;
-   int pong_timeout;
-   struct osmo_timer_list ping_timer;
-   struct osmo_timer_list pong_timer;
-   int advanced_ping;
struct bsc_msc_connection *msc_con;
struct osmo_plmn_id core_plmn;
int core_lac;
@@ -158,8 +153,6 @@
 
 int osmo_bsc_msc_init(struct bsc_msc_data *msc);
 int osmo_bsc_sccp_init(struct gsm_network *gsmnet);
-int msc_queue_write(struct bsc_msc_connection *conn, struct msgb *msg, int 
proto);
-int msc_queue_write_with_ping(struct bsc_msc_connection *, struct msgb *msg, 
int proto);
 
 int osmo_bsc_audio_init(struct gsm_network *network);
 
diff --git a/src/osmo-bsc/osmo_bsc_api.c b/src/osmo-bsc/osmo_bsc_api.c
index b80eb58..239bb54 100644
--- a/src/osmo-bsc/osmo_bsc_api.c
+++ b/src/osmo-bsc/osmo_bsc_api.c
@@ -237,18 +237,8 @@
 {
int con_type, rc, lu_cause;
char *imsi = NULL;
-   struct timeval tv;
struct msgb *resp;
enum bsc_con ret;
-   int send_ping = msc->advanced_ping;
-
-   /* Advanced ping/pong handling */
-   if (osmo_timer_pending(>pong_timer))
-   send_ping = 0;
-   if (msc->ping_timeout <= 0)
-   send_ping = 0;
-   if (send_ping && osmo_timer_remaining(>ping_timer, NULL, ) == 
-1)
-   send_ping = 0;
 
/* Check the filter */
rc = bsc_filter_initial(msc->network->bsc_data, msc, conn, msg,
diff --git a/src/osmo-bsc/osmo_bsc_msc.c b/src/osmo-bsc/osmo_bsc_msc.c
index e0c7556..2178d1d 100644
--- a/src/osmo-bsc/osmo_bsc_msc.c
+++ b/src/osmo-bsc/osmo_bsc_msc.c
@@ -40,515 +40,19 @@
 #include 
 #include 
 
-#if 0
-static void initialize_if_needed(struct bsc_msc_connection *conn);
-static void send_lacs(struct gsm_network *net, struct bsc_msc_connection 
*conn);
-static void send_id_get_response(struct bsc_msc_data *data, int fd, struct 
msgb *inp);
-static void send_ping(struct bsc_msc_data *data);
-static void schedule_ping_pong(struct bsc_msc_data *data);
-
-/*
- * MGCP forwarding code
- */
-
-#endif
-static int mgcp_do_read(struct osmo_fd *fd)
-{
-   struct bsc_msc_data *data = (struct bsc_msc_data *) fd->data;
-   struct msgb *mgcp;
-   int ret;
-
-   mgcp = msgb_alloc_headroom(4096, 128, "mgcp_from_gw");
-   if (!mgcp) {
-   LOGP(DMGCP, LOGL_ERROR, "Failed to allocate MGCP message.\n");
-   return -1;
-   }
-
-   ret = read(fd->fd, mgcp->data, 4096 - 128);
-   if (ret <= 0) {
-   LOGP(DMGCP, LOGL_ERROR, "Failed to read: %d/%s\n", errno, 
strerror(errno));
-   msgb_free(mgcp);
-   return -1;
-   } else if (ret > 4096 - 128) {
-   LOGP(DMGCP, LOGL_ERROR, "Too much data: %d\n", ret);
-   msgb_free(mgcp);
-   return -1;
-}
-
-   mgcp->l2h = msgb_put(mgcp, ret);
-   msc_queue_write(data->msc_con, mgcp, IPAC_PROTO_MGCP_OLD);
-   return 0;
-}
-
-static int mgcp_do_write(struct osmo_fd *fd, struct msgb *msg)
-{
-   int ret;
-
-   LOGP(DMGCP, LOGL_DEBUG, "Sending msg to MGCP GW size: %u\n", msg->len);
-
-   ret = write(fd->fd, msg->data, msg->len);
-   if (ret != msg->len)
-   LOGP(DMGCP, LOGL_ERROR, "Failed to forward message to MGCP GW 
(%s).\n", strerror(errno));
-
-   return ret;
-}
-
-#if 0
-static void mgcp_forward(struct bsc_msc_data *data, struct msgb *msg)
-{
-   struct msgb *mgcp;
-
-   if (msgb_l2len(msg) > 4096) {
-   LOGP(DMGCP, LOGL_ERROR, "Can not forward too big message.\n");
-   return;
-   }
-
-   mgcp = 

[PATCH] osmo-bsc[master]: cosmetic: Add fixme note for OS#3112

2018-03-26 Thread dexter

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

cosmetic: Add fixme note for OS#3112

Change-Id: I0c3ffb567aff08014f8fb96928077afb8c2f229c
---
M src/osmo-bsc/osmo_bsc_msc.c
1 file changed, 5 insertions(+), 0 deletions(-)


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

diff --git a/src/osmo-bsc/osmo_bsc_msc.c b/src/osmo-bsc/osmo_bsc_msc.c
index 2178d1d..e9309ea 100644
--- a/src/osmo-bsc/osmo_bsc_msc.c
+++ b/src/osmo-bsc/osmo_bsc_msc.c
@@ -48,6 +48,11 @@
return -1;
}
 
+   /* FIXME: This is a leftover from the old architecture that used
+* sccp-lite with osmocom specific authentication. Since we now
+* changed to AoIP the connected status and the authentication
+* status is managed differently. However osmo_bsc_filter.c still
+* needs the flags to be set to one. See also: OS#3112 */
data->msc_con->is_connected = 1;
data->msc_con->is_authenticated = 1;
 

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

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


[MERGED] libosmocore[master]: contrib/fsm-to-dot: don't match on event names in comments

2018-03-26 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: contrib/fsm-to-dot: don't match on event names in comments
..


contrib/fsm-to-dot: don't match on event names in comments

Strip comments from function bodies before matching on event names.

In osmo-bsc's gscon FSM, there often are event names in comments. The naive
parsing of fsm-to-dot.py mistakes these as events causing state transitions,
but the comments are just explaining how states interact.

Makes me reconsider parsing the C with clang instead, but I got away with a
dirty hack once more.

Change-Id: I56d70ae14d363f7ca655dced16d93d795b3f940d
---
M contrib/fsm-to-dot.py
1 file changed, 4 insertions(+), 0 deletions(-)

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



diff --git a/contrib/fsm-to-dot.py b/contrib/fsm-to-dot.py
index 276fccc..ce94a4e 100755
--- a/contrib/fsm-to-dot.py
+++ b/contrib/fsm-to-dot.py
@@ -566,6 +566,8 @@
 re_state_trigger = 
re.compile(r'osmo_fsm_inst_state_chg\([^,]+,\W*([A-Z_][A-Z_0-9]*)\W*,', re.M)
 re_fsm_alloc = 
re.compile(r'osmo_fsm_inst_alloc[_child]*\(\W*&([a-z_][a-z_0-9]*),', re.M)
 re_fsm_event_dispatch = 
re.compile(r'osmo_fsm_inst_dispatch\(\W*[^,]+,\W*([A-Z_][A-Z_0-9]*)\W*,', re.M)
+re_comment_multiline = re.compile(r'/\*.*?\*/', re.M | re.S)
+re_comment_single_line = re.compile(r'//.*$', re.M | re.S)
 
 class CFile():
   def __init__(c_file, path):
@@ -625,6 +627,8 @@
 for m in re_func.finditer(c_file.src):
   name = m.group(1)
   func_src = c_file.extract_block('{', '}', m.start())
+  func_src = ''.join(re_comment_multiline.split(func_src))
+  func_src = ''.join(re_comment_single_line.split(func_src))
   funcs[name] = func_src
 c_file.funcs = funcs
 c_file.find_fsm_allocators()

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

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


[PATCH] osmo-bts[master]: octphy: integrate octasics latest header release

2018-03-26 Thread dexter
Hello Neels Hofmeyr, Jenkins Builder,

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

https://gerrit.osmocom.org/7487

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

octphy: integrate octasics latest header release

At the moment osmo-bts does not compile with the latest header
file release from OCTSDR-2G-02.10.00-B1837-ALPHA as there are
struct members removed and new ones added. The changes do not
affect actual functionality in the existing code. The only
affected parts are vty functions that query status information
about the clock sync manager.

- Add detection logic in configure.ac to detect if the affected
  struct members are present

- Add conditional compiling to handle the different combinations
  of available struct members.

Change-Id: Ic38d8dc35522205c4ffab583b4e61b5ef03cdba2
Related: SYS#4139
Patch-by: Octasic inc.
---
M configure.ac
M src/osmo-bts-octphy/octphy_hw_api.c
M src/osmo-bts-octphy/octphy_hw_api.h
M src/osmo-bts-octphy/octphy_vty.c
4 files changed, 181 insertions(+), 20 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/87/7487/2

diff --git a/configure.ac b/configure.ac
index 1d7379f..9767349 100644
--- a/configure.ac
+++ b/configure.ac
@@ -152,13 +152,6 @@
[],
[#include ])
 
-   AC_CHECK_MEMBER([tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP.ulSyncLossCnt],
-   AC_DEFINE([OCTPHY_USE_SYNC_LOSS_CNT],
-   [1],
-   [Define to 1 if your octphy header files renamed 
ulSyncLosseCnt to ulSyncLossCnt]),
-   [],
-   [#include ])
-

AC_CHECK_MEMBER([tOCTVC1_HW_MSG_RF_PORT_INFO_ANTENNA_TX_CONFIG_RSP.TxConfig],
AC_DEFINE([OCTPHY_USE_TX_CONFIG],
[1],
@@ -180,6 +173,83 @@
[],
[#include ])
 
+   
AC_CHECK_MEMBER([tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_INFO_RSP.ulClkSourceSelection],
+   AC_DEFINE([OCTPHY_USE_CLK_SOURCE_SELECTION],
+   [1],
+   [Define to 1 if your octphy header files supports 
ulClkSourceSelection in tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_INFO_RSP]),
+   [],
+   [#include ])
+
+   AC_CHECK_MEMBER([tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP.lClockError],
+   AC_DEFINE([OCTPHY_USE_CLOCK_SYNC_MGR_STATS_CLOCK_ERROR],
+   [1],
+   [Define to 1 if your octphy header files supports 
lClockError in tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP]),
+   [],
+   [#include ])
+
+   
AC_CHECK_MEMBER([tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP.lDroppedCycles],
+   
AC_DEFINE([OCTPHY_USE_CLOCK_SYNC_MGR_STATS_DROPPED_CYCLES],
+   [1],
+   [Define to 1 if your octphy header files supports 
lDroppedCycles in tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP]),
+   [],
+   [#include ])
+
+   AC_CHECK_MEMBER([tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP.ulPllFreqHz],
+   AC_DEFINE([OCTPHY_USE_CLOCK_SYNC_MGR_STATS_PLL_FREQ_HZ],
+   [1],
+   [Define to 1 if your octphy header files supports 
ulPllFreqHz in tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP]),
+   [],
+   [#include ])
+
+   
AC_CHECK_MEMBER([tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP.ulPllFractionalFreqHz],
+   
AC_DEFINE([OCTPHY_USE_CLOCK_SYNC_MGR_STATS_PLL_FRACTIONAL_FREQ_HZ],
+   [1],
+   [Define to 1 if your octphy header files supports 
ulPllFractionalFreqHz in tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP]),
+   [],
+   [#include ])
+
+   AC_CHECK_MEMBER([tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP.ulSlipCnt],
+   AC_DEFINE([OCTPHY_USE_CLOCK_SYNC_MGR_STATS_SLIP_CNT],
+   [1],
+   [Define to 1 if your octphy header files supports 
ulSlipCnt in tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP]),
+   [],
+   [#include ])
+
+   
AC_CHECK_MEMBER([tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP.ulSyncLosseCnt],
+   
AC_DEFINE([OCTPHY_USE_CLOCK_SYNC_MGR_STATS_SYNC_LOSSE_CNT],
+   [1],
+   [Define to 1 if your octphy header files supports 
ulSyncLosseCnt in tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP]),
+   [],
+   [#include ])
+
+   AC_CHECK_MEMBER([tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP.ulSyncLossCnt],
+   
AC_DEFINE([OCTPHY_USE_CLOCK_SYNC_MGR_STATS_SYNC_LOSS_CNT],
+   [1],
+   [Define to 1 if your octphy header files supports 
ulSyncLossCnt in 

[PATCH] osmo-bsc[master]: Generate the S_L_INP_TEI_UP signal earlier.

2018-03-26 Thread Stefan Sperling

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

Generate the S_L_INP_TEI_UP signal earlier.

The S_L_INP_TEI_UP signal was generated when the first message from a BTS
arrives on the OML/RSL link, rather than when the OML/RSL link comes up.
Instead, generate this signal when the link is brought up, so we
intitialize state regardless of how a particular BTS behaves.

Tested with osmo-bts-virtual and virtphy/mobile programs,
and with a sysmobts.

This was already committed in faf0982ae20001519cf20c5d6345dad490a135f2
but subsequently reverted in 383a059a123b1e0e5aab76423db47846e329f095
because it introduced a regression. The underlying problem causing this
regression has now been addressed by https://gerrit.osmocom.org/#/c/7462/
(libosmo-abis commit 49917c129b1456585258b0ebe89a513ecef823a8).

Change-Id: I78a152671a00b95c997830f7161fca92bb898fa3
Depends: I52f7c903212b38e9c87e4d45e52b231b6f1ae9f5
Related: OS#2719
---
M src/libbsc/bts_ipaccess_nanobts.c
1 file changed, 12 insertions(+), 13 deletions(-)


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

diff --git a/src/libbsc/bts_ipaccess_nanobts.c 
b/src/libbsc/bts_ipaccess_nanobts.c
index a3f7919..edfe417 100644
--- a/src/libbsc/bts_ipaccess_nanobts.c
+++ b/src/libbsc/bts_ipaccess_nanobts.c
@@ -438,6 +438,11 @@
bts->oml_tei, 0);
rc = clock_gettime(CLOCK_MONOTONIC, );
bts->uptime = (rc < 0) ? 0 : tp.tv_sec; /* we don't need 
sub-second precision for uptime */
+   if (!(sign_link->trx->bts->ip_access.flags & OML_UP)) {
+   e1inp_event(sign_link->ts, S_L_INP_TEI_UP,
+   sign_link->tei, sign_link->sapi);
+   sign_link->trx->bts->ip_access.flags |= OML_UP;
+   }
break;
case E1INP_SIGN_RSL: {
struct e1inp_ts *ts;
@@ -458,6 +463,13 @@
e1inp_sign_link_create(ts, E1INP_SIGN_RSL,
   trx, trx->rsl_tei, 0);
trx->rsl_link->ts->sign.delay = 0;
+   if (!(sign_link->trx->bts->ip_access.flags &
+   (RSL_UP << sign_link->trx->nr))) {
+   e1inp_event(sign_link->ts, S_L_INP_TEI_UP,
+   sign_link->tei, sign_link->sapi);
+   sign_link->trx->bts->ip_access.flags |=
+   (RSL_UP << sign_link->trx->nr);
+   }
break;
}
default:
@@ -490,25 +502,12 @@
 {
int ret = 0;
struct e1inp_sign_link *link = msg->dst;
-   struct e1inp_ts *e1i_ts = link->ts;
 
switch (link->type) {
case E1INP_SIGN_RSL:
-   if (!(link->trx->bts->ip_access.flags &
-   (RSL_UP << link->trx->nr))) {
-   e1inp_event(e1i_ts, S_L_INP_TEI_UP,
-   link->tei, link->sapi);
-   link->trx->bts->ip_access.flags |=
-   (RSL_UP << link->trx->nr);
-   }
ret = abis_rsl_rcvmsg(msg);
break;
case E1INP_SIGN_OML:
-   if (!(link->trx->bts->ip_access.flags & OML_UP)) {
-   e1inp_event(e1i_ts, S_L_INP_TEI_UP,
-   link->tei, link->sapi);
-   link->trx->bts->ip_access.flags |= OML_UP;
-   }
ret = abis_nm_rcvmsg(msg);
break;
default:

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I78a152671a00b95c997830f7161fca92bb898fa3
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Stefan Sperling 


[PATCH] libosmocore[master]: contrib/fsm-to-dot: mark illegal states in red

2018-03-26 Thread Neels Hofmeyr

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

contrib/fsm-to-dot: mark illegal states in red

If an FSM transitions to a state that actually belongs to a different FSM,
print an error and mark it red, instead of exiting with exception.

Change-Id: I73d95a0c65ca1ea586ad55234610671a53d6220f
---
M contrib/fsm-to-dot.py
1 file changed, 29 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/05/7505/1

diff --git a/contrib/fsm-to-dot.py b/contrib/fsm-to-dot.py
index 38d7061..96f7e00 100755
--- a/contrib/fsm-to-dot.py
+++ b/contrib/fsm-to-dot.py
@@ -193,6 +193,7 @@
   out_state_names = None
   out_edges = None
   kind = None
+  color = None
 
   def __init__(state):
 state.in_event_names = []
@@ -236,6 +237,11 @@
   return ''
 return ',shape=%s' % shape
 
+  def color_str(state):
+if state.color is None:
+  return ''
+return ',color="%s"' % state.color
+
   def __repr__(state):
 return 'State(name=%r,short_name=%r,out=%d)' % (state.name, 
state.short_name, len(state.out_edges))
 
@@ -249,6 +255,12 @@
 fsm.action_funcs = set()
 fsm.event_names = set()
 fsm.dot_name = fsm.all_names_sanitized()
+
+  def __repr__(fsm):
+return str(fsm)
+
+  def __str__(fsm):
+return 'Fsm(%r,%r)' % (fsm.struct_name, fsm.from_file)
 
   def parse_states(fsm, src):
 state = None
@@ -312,8 +324,13 @@
 
   def ref_out_states(fsm):
 for state in fsm.states:
-  for e in [Edge(fsm.find_state_by_name(n, True)) for n in 
state.out_state_names]:
-state.add_out_edge(e)
+  for out_state_name in state.out_state_names:
+out_state = fsm.find_state_by_name(out_state_name, False)
+if out_state is None:
+  print('ERROR: fsm %r has a transition to state not part of the FSM: 
%r'
+% (fsm, out_state_name))
+  out_state = fsm.have_state(out_state_name, KIND_STATE, color='red')
+state.add_out_edge(Edge(out_state))
 
   def find_state_by_name(fsm, name, strict=False):
 for state in fsm.states:
@@ -509,13 +526,14 @@
   meta_calling_fsm.add_out_edge(Edge(meta_called_fsm))
 
 
-  def have_state(fsm, name, kind=KIND_STATE):
+  def have_state(fsm, name, kind=KIND_STATE, color=None):
 state = fsm.find_state_by_name(name)
 if not state:
   state = State()
   state.name = name
   state.short_name = name
   state.kind = kind
+  state.color = color
   fsm.states.append(state)
 return state
 
@@ -523,8 +541,8 @@
 out = ['digraph G {', 'rankdir=LR;']
 
 for state in fsm.states:
-  out.append('%s [label="%s"%s]' % (state.short_name, state.get_label(),
-  state.shape_str()))
+  out.append('%s [label="%s"%s%s]' % (state.short_name, state.get_label(),
+  state.shape_str(), state.color_str()))
 
 for state in fsm.states:
   for out_edge in state.out_edges:
@@ -596,6 +614,12 @@
 c_file.funcs = {}
 c_file.fsm_allocators = listdict()
 
+  def __repr__(c_file):
+return str(c_file)
+
+  def __str__(c_file):
+return 'CFile(%r)' % c_file.path
+
   def extract_block(c_file, brace_open, brace_close, start):
 pos = 0
 try:

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

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


[MERGED] libosmocore[master]: contrib/fsm-to-dot: less false positives on event parsing

2018-03-26 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: contrib/fsm-to-dot: less false positives on event parsing
..


contrib/fsm-to-dot: less false positives on event parsing

Do some more mad hacking to only detect event triggers if event names actually
appear in if() or case: statements. Also combine events in consecutive 'case'
statements.

When will this madness stop?

Change-Id: Iabaaab57f0d1687607eaaa4e09c7c2439fbd7a25
---
M contrib/fsm-to-dot.py
1 file changed, 29 insertions(+), 8 deletions(-)

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



diff --git a/contrib/fsm-to-dot.py b/contrib/fsm-to-dot.py
index 83c95b6..38d7061 100755
--- a/contrib/fsm-to-dot.py
+++ b/contrib/fsm-to-dot.py
@@ -587,6 +587,7 @@
 re_fsm_event_dispatch = 
re.compile(r'osmo_fsm_inst_dispatch\(\W*[^,]+,\W*([A-Z_][A-Z_0-9]*)\W*,', re.M)
 re_comment_multiline = re.compile(r'/\*.*?\*/', re.M | re.S)
 re_comment_single_line = re.compile(r'//.*$', re.M | re.S)
+re_break = re.compile(r'^\W*\bbreak;', re.M)
 
 class CFile():
   def __init__(c_file, path):
@@ -669,7 +670,9 @@
 
   def find_state_transitions(c_file, event_names):
 TO_STATE = 'TO_STATE'
-EVENT = 'EVENT'
+IF_EVENT = 'IF_EVENT'
+CASE_EVENT = 'CASE_EVENT'
+BREAK = 'BREAK'
 func_to_state_transitions = listdict()
 
 for func_name, src in c_file.funcs.items():
@@ -680,19 +683,37 @@
 found_tokens.append((m.start(), TO_STATE, to_state))
 
   for event in event_names:
-re_event = re.compile(r'\b(' + event + r')\b')
+re_event = re.compile(r'\bif\w*\(.*\b(' + event + r')\b')
 for m in re_event.finditer(src):
   event = m.group(1)
-  found_tokens.append((m.start(), EVENT, event))
+  found_tokens.append((m.start(), IF_EVENT, event))
+
+re_event = re.compile(r'^\W*case\W\W*\b(' + event + r'):', re.M)
+for m in re_event.finditer(src):
+  event = m.group(1)
+  found_tokens.append((m.start(), CASE_EVENT, event))
+
+  for m in re_break.finditer(src):
+found_tokens.append((m.start(), BREAK, 'break'))
 
   found_tokens = sorted(found_tokens)
 
-  last_event = None
+  last_events = []
+  saw_break = True
   for start, kind, name in found_tokens:
-if kind == EVENT:
-  last_event = name
-else:
-  func_to_state_transitions.add(func_name, (name, last_event))
+if kind == IF_EVENT:
+  last_events = [name]
+  saw_break = True
+elif kind == CASE_EVENT:
+  if saw_break:
+last_events = []
+saw_break = False
+  last_events.append(name)
+elif kind == BREAK:
+  saw_break = True
+elif kind == TO_STATE:
+  for event in (last_events or [None]):
+func_to_state_transitions.add(func_name, (name, event))
 
 return func_to_state_transitions
 

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

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


[PATCH] libosmocore[master]: contrib/fsm-to-dot: warn about identically named FSMs

2018-03-26 Thread Neels Hofmeyr

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

contrib/fsm-to-dot: warn about identically named FSMs

FSMs with identical names confuse the script, so at least warn about them.
IMHO we should also have different names for each FSM, so not bothering to make
the script safe against identical naming.

Change-Id: I4fe7e85d2fdf23e2ba964f3b47be1954edc63cef
---
M contrib/fsm-to-dot.py
1 file changed, 19 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/06/7506/1

diff --git a/contrib/fsm-to-dot.py b/contrib/fsm-to-dot.py
index 96f7e00..85e2806 100755
--- a/contrib/fsm-to-dot.py
+++ b/contrib/fsm-to-dot.py
@@ -262,7 +262,7 @@
   def __str__(fsm):
 return 'Fsm(%r,%r)' % (fsm.struct_name, fsm.from_file)
 
-  def parse_states(fsm, src):
+  def parse_states(fsm, src, c_file):
 state = None
 started = None
 
@@ -274,6 +274,15 @@
 for line in lines:
   state_name = state_starts(line)
   if state_name:
+state = fsm.find_state_by_name(state_name)
+if state is not None:
+  if c_file is fsm.from_file:
+print('ERROR: fsm %r has multiple definitions of state %r' % (fsm, 
state_name))
+  else:
+print('ERROR: it appears two FSMs with identical name %r exist in 
%r and %r'
+  % (fsm.struct_name, fsm.from_file, c_file))
+  state = None
+  continue
 state = State()
 fsm.states.append(state)
 started = None
@@ -664,7 +673,7 @@
   states_struct_name = m.group(1)
   for fsm in fsms:
 if states_struct_name == fsm.states_struct_name:
-  fsm.parse_states(c_file.extract_block('{', '}', m.start()))
+  fsm.parse_states(c_file.extract_block('{', '}', m.start()), c_file)
 
   def parse_functions(c_file):
 funcs = {}
@@ -787,6 +796,14 @@
 for c_file in c_files:
   fsms.extend(c_file.find_fsms())
 
+for fsm1 in fsms:
+  for fsm2 in fsms:
+if fsm1 is fsm2:
+  continue
+if fsm1.states_struct_name == fsm2.states_struct_name:
+  print('ERROR: two distinct FSMs share the same states-struct name: %r 
and %r both use %r'
+% (fsm1, fsm2, fsm1.states_struct_name))
+
 for c_file in c_files:
   c_file.find_fsm_states(fsms)
   c_file.find_event_sources(fsms)

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

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


libosmocore[master]: contrib/fsm-to-dot: mark illegal states in red

2018-03-26 Thread Neels Hofmeyr

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

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

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


[MERGED] libosmocore[master]: contrib/fsm-to-dot: mark arrows that feed events

2018-03-26 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: contrib/fsm-to-dot: mark arrows that feed events
..


contrib/fsm-to-dot: mark arrows that feed events

Most arrows draw state transitions, but some want to show that an event is
delivered to a state. Mark those with a "halfopen" arrow head.

Change-Id: Ib07380894a6d513896c9135f175ecbf653a23eec
---
M contrib/fsm-to-dot.py
1 file changed, 12 insertions(+), 7 deletions(-)

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



diff --git a/contrib/fsm-to-dot.py b/contrib/fsm-to-dot.py
index 872577e..83c95b6 100755
--- a/contrib/fsm-to-dot.py
+++ b/contrib/fsm-to-dot.py
@@ -137,10 +137,11 @@
 return cmp(event.name, other.name)
 
 class Edge:
-  def __init__(edge, to_state, event_name=None, style=None, action=None, 
color=None):
+  def __init__(edge, to_state, event_name=None, style=None, action=None, 
color=None, arrow_head=None):
 edge.to_state = to_state
 edge.style = style
 edge.color = color
+edge.arrow_head = arrow_head
 edge.events = []
 edge.actions = []
 edge.add_event_name(event_name)
@@ -330,7 +331,8 @@
 
   def add_special_state(fsm, additional_states, name, in_state=None,
 out_state=None, event_name=None, kind=KIND_FUNC,
-state_action=None, label=None, edge_action=None):
+state_action=None, label=None, edge_action=None,
+style='dotted', arrow_head=None):
 additional_state = None
 for s in additional_states:
   if s.short_name == name:
@@ -356,13 +358,13 @@
 
 if out_state:
   additional_state.out_state_names.append(out_state.name)
-  additional_state.add_out_edge(Edge(out_state, event_name, 'dotted',
- action=edge_action))
+  additional_state.add_out_edge(Edge(out_state, event_name, style=style,
+ action=edge_action, 
arrow_head=arrow_head))
 
 if in_state:
   in_state.out_state_names.append(additional_state.name)
-  in_state.add_out_edge(Edge(additional_state, event_name, 'dotted',
- action=edge_action))
+  in_state.add_out_edge(Edge(additional_state, event_name, style=style,
+ action=edge_action, arrow_head=arrow_head))
 
 
   def find_event_edges(fsm, c_files):
@@ -425,7 +427,8 @@
 # them to the graph as well
 additional_funcs = [f for f in funcs_for_in_event if f not in 
fsm.action_funcs]
 for af in additional_funcs:
-  fsm.add_special_state(additional_states, af, None, state, 
in_event_name)
+  fsm.add_special_state(additional_states, af, None, state, 
in_event_name,
+arrow_head='halfopen')
 
 fsm.states.extend(additional_states)
 
@@ -540,6 +543,8 @@
   attrs.append('style=%s'% out_edge.style)
 if out_edge.color:
   attrs.append('color=%s'% out_edge.color)
+if out_edge.arrow_head:
+  attrs.append('arrowhead=%s'% out_edge.arrow_head)
 attrs_str = ''
 if attrs:
   attrs_str = ' [%s]' % (','.join(attrs))

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

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


[MERGED] libosmocore[master]: contrib/fsm-to-dot: warn and draw unallowed state transitions

2018-03-26 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: contrib/fsm-to-dot: warn and draw unallowed state transitions
..


contrib/fsm-to-dot: warn and draw unallowed state transitions

Hacked as it is, fsm-to-dot is capable of detecting action functions
transitioning to states that are not allowed according to the FSM definition
struct.

Draw those in red and output a warning.

Found these osmo-bsc gscon errors with this patch:

ERROR: gscon_fsm_active() triggers a transition to ST_WAIT_HO_COMPL, but this 
is not allowed by the FSM definition
ERROR: gscon_fsm_wait_ho_compl() triggers a transition to ST_WAIT_MDCX_BTS_HO, 
but this is not allowed by the FSM definition

Related: OS#3109
Change-Id: Ic6319a958b3c7247510c1930bac8b02b95f9dcf2
---
M contrib/fsm-to-dot.py
1 file changed, 12 insertions(+), 1 deletion(-)

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



diff --git a/contrib/fsm-to-dot.py b/contrib/fsm-to-dot.py
index ce94a4e..7a4694e 100755
--- a/contrib/fsm-to-dot.py
+++ b/contrib/fsm-to-dot.py
@@ -137,9 +137,10 @@
 return cmp(event.name, other.name)
 
 class Edge:
-  def __init__(edge, to_state, event_name=None, style=None, action=None):
+  def __init__(edge, to_state, event_name=None, style=None, action=None, 
color=None):
 edge.to_state = to_state
 edge.style = style
+edge.color = color
 edge.events = []
 edge.actions = []
 edge.add_event_name(event_name)
@@ -379,9 +380,17 @@
   for to_state_name, event_name in transitions:
 if not event_name:
   continue
+found = False
 for out_edge in state.out_edges:
   if out_edge.to_state.name == to_state_name:
 out_edge.add_event_name(event_name)
+found = True
+if not found:
+  sys.stderr.write(
+"ERROR: %s() triggers a transition to %s, but this is not allowed 
by the FSM definition\n"
+% (state.action, to_state_name))
+  state.add_out_edge(Edge(fsm.find_state_by_name(to_state_name, True), 
event_name,
+  color='red'))
 
 additional_states = []
 
@@ -526,6 +535,8 @@
   attrs.append('label="%s"' % (r'\n'.join(labels)))
 if out_edge.style:
   attrs.append('style=%s'% out_edge.style)
+if out_edge.color:
+  attrs.append('color=%s'% out_edge.color)
 attrs_str = ''
 if attrs:
   attrs_str = ' [%s]' % (','.join(attrs))

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

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


[MERGED] libosmocore[master]: contrib/fsm-to-dot: allow transition from and to the same state

2018-03-26 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: contrib/fsm-to-dot: allow transition from and to the same state
..


contrib/fsm-to-dot: allow transition from and to the same state

In osmo-bsc's new gscon FSM, there is an osmo_fsm_inst_state_chg() from
ST_ACTIVE to ST_ACTIVE. Avoid an exception triggering on this simple fact.

Change-Id: I420c7be84e3af555cc5e8bddbff7261013348375
---
M contrib/fsm-to-dot.py
1 file changed, 5 insertions(+), 3 deletions(-)

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



diff --git a/contrib/fsm-to-dot.py b/contrib/fsm-to-dot.py
index 3e9678d..276fccc 100755
--- a/contrib/fsm-to-dot.py
+++ b/contrib/fsm-to-dot.py
@@ -205,9 +205,11 @@
   out_edge.add_events(edge.events)
   out_edge.add_actions(edge.actions)
   return
-  # sanity
-  if out_edge.to_state.get_label() == edge.to_state.get_label():
-raise Exception('Two distinct states exist with identical labels.')
+  elif out_edge.to_state.get_label() == edge.to_state.get_label():
+# sanity: there already is an edge to a state that a) is not identical 
to the target state of the
+# newly added edge but b) has the same label.
+raise Exception('Two distinct states exist with identical label: %r: 
states %r and %r.'
+% (out_edge.to_state.get_label(), out_edge.to_state, 
edge.to_state))
 state.out_edges.append(edge)
 
   def get_label(state):

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

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


[MERGED] libosmocore[master]: contrib/fsm-to-dot: add default edge label '-'

2018-03-26 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: contrib/fsm-to-dot: add default edge label '-'
..


contrib/fsm-to-dot: add default edge label '-'

When some edges have no label, it is sometimes hard to interpret which label
belongs to which edge. Adding a '-' default label clarifies the edge labeling.

Change-Id: I3a10b615288107e8fc12ffdbbe0099cf51abe94f
---
M contrib/fsm-to-dot.py
1 file changed, 4 insertions(+), 1 deletion(-)

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



diff --git a/contrib/fsm-to-dot.py b/contrib/fsm-to-dot.py
index 7a4694e..872577e 100755
--- a/contrib/fsm-to-dot.py
+++ b/contrib/fsm-to-dot.py
@@ -532,7 +532,10 @@
 if out_edge.actions:
   labels.extend(out_edge.action_labels())
 if labels:
-  attrs.append('label="%s"' % (r'\n'.join(labels)))
+  label = r'\n'.join(labels)
+else:
+  label = '-'
+attrs.append('label="%s"' % label)
 if out_edge.style:
   attrs.append('style=%s'% out_edge.style)
 if out_edge.color:

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

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


[MERGED] libosmocore[master]: contrib/fsm-to-dot: add -h option to print basic instructions

2018-03-26 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: contrib/fsm-to-dot: add -h option to print basic instructions
..


contrib/fsm-to-dot: add -h option to print basic instructions

Change-Id: I196033e44d50ebb73cf9b44cbdc94a2b8b4f98ce
---
M contrib/fsm-to-dot.py
1 file changed, 4 insertions(+), 0 deletions(-)

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



diff --git a/contrib/fsm-to-dot.py b/contrib/fsm-to-dot.py
index 06d2df1..3e9678d 100755
--- a/contrib/fsm-to-dot.py
+++ b/contrib/fsm-to-dot.py
@@ -15,6 +15,10 @@
 
 import sys, re, os
 
+if '-h' in sys.argv or '--help' in sys.argv:
+  print(__doc__)
+  exit(0)
+
 def err(msg):
   sys.stderr.write(msg + '\n')
 

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

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


[MERGED] libosmocore[master]: contrib/fsm-to-dot: mark illegal states in red

2018-03-26 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: contrib/fsm-to-dot: mark illegal states in red
..


contrib/fsm-to-dot: mark illegal states in red

If an FSM transitions to a state that actually belongs to a different FSM,
print an error and mark it red, instead of exiting with exception.

Change-Id: I73d95a0c65ca1ea586ad55234610671a53d6220f
---
M contrib/fsm-to-dot.py
1 file changed, 29 insertions(+), 5 deletions(-)

Approvals:
  Neels Hofmeyr: Looks good to me, approved; Verified



diff --git a/contrib/fsm-to-dot.py b/contrib/fsm-to-dot.py
index 38d7061..96f7e00 100755
--- a/contrib/fsm-to-dot.py
+++ b/contrib/fsm-to-dot.py
@@ -193,6 +193,7 @@
   out_state_names = None
   out_edges = None
   kind = None
+  color = None
 
   def __init__(state):
 state.in_event_names = []
@@ -236,6 +237,11 @@
   return ''
 return ',shape=%s' % shape
 
+  def color_str(state):
+if state.color is None:
+  return ''
+return ',color="%s"' % state.color
+
   def __repr__(state):
 return 'State(name=%r,short_name=%r,out=%d)' % (state.name, 
state.short_name, len(state.out_edges))
 
@@ -249,6 +255,12 @@
 fsm.action_funcs = set()
 fsm.event_names = set()
 fsm.dot_name = fsm.all_names_sanitized()
+
+  def __repr__(fsm):
+return str(fsm)
+
+  def __str__(fsm):
+return 'Fsm(%r,%r)' % (fsm.struct_name, fsm.from_file)
 
   def parse_states(fsm, src):
 state = None
@@ -312,8 +324,13 @@
 
   def ref_out_states(fsm):
 for state in fsm.states:
-  for e in [Edge(fsm.find_state_by_name(n, True)) for n in 
state.out_state_names]:
-state.add_out_edge(e)
+  for out_state_name in state.out_state_names:
+out_state = fsm.find_state_by_name(out_state_name, False)
+if out_state is None:
+  print('ERROR: fsm %r has a transition to state not part of the FSM: 
%r'
+% (fsm, out_state_name))
+  out_state = fsm.have_state(out_state_name, KIND_STATE, color='red')
+state.add_out_edge(Edge(out_state))
 
   def find_state_by_name(fsm, name, strict=False):
 for state in fsm.states:
@@ -509,13 +526,14 @@
   meta_calling_fsm.add_out_edge(Edge(meta_called_fsm))
 
 
-  def have_state(fsm, name, kind=KIND_STATE):
+  def have_state(fsm, name, kind=KIND_STATE, color=None):
 state = fsm.find_state_by_name(name)
 if not state:
   state = State()
   state.name = name
   state.short_name = name
   state.kind = kind
+  state.color = color
   fsm.states.append(state)
 return state
 
@@ -523,8 +541,8 @@
 out = ['digraph G {', 'rankdir=LR;']
 
 for state in fsm.states:
-  out.append('%s [label="%s"%s]' % (state.short_name, state.get_label(),
-  state.shape_str()))
+  out.append('%s [label="%s"%s%s]' % (state.short_name, state.get_label(),
+  state.shape_str(), state.color_str()))
 
 for state in fsm.states:
   for out_edge in state.out_edges:
@@ -596,6 +614,12 @@
 c_file.funcs = {}
 c_file.fsm_allocators = listdict()
 
+  def __repr__(c_file):
+return str(c_file)
+
+  def __str__(c_file):
+return 'CFile(%r)' % c_file.path
+
   def extract_block(c_file, brace_open, brace_close, start):
 pos = 0
 try:

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

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


libosmocore[master]: contrib/fsm-to-dot: warn about identically named FSMs

2018-03-26 Thread Neels Hofmeyr

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

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I4fe7e85d2fdf23e2ba964f3b47be1954edc63cef
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: No


[MERGED] libosmocore[master]: contrib/fsm-to-dot: warn about identically named FSMs

2018-03-26 Thread Neels Hofmeyr
Neels Hofmeyr has submitted this change and it was merged.

Change subject: contrib/fsm-to-dot: warn about identically named FSMs
..


contrib/fsm-to-dot: warn about identically named FSMs

FSMs with identical names confuse the script, so at least warn about them.
IMHO we should also have different names for each FSM, so not bothering to make
the script safe against identical naming.

Change-Id: I4fe7e85d2fdf23e2ba964f3b47be1954edc63cef
---
M contrib/fsm-to-dot.py
1 file changed, 19 insertions(+), 2 deletions(-)

Approvals:
  Neels Hofmeyr: Looks good to me, approved; Verified



diff --git a/contrib/fsm-to-dot.py b/contrib/fsm-to-dot.py
index 96f7e00..85e2806 100755
--- a/contrib/fsm-to-dot.py
+++ b/contrib/fsm-to-dot.py
@@ -262,7 +262,7 @@
   def __str__(fsm):
 return 'Fsm(%r,%r)' % (fsm.struct_name, fsm.from_file)
 
-  def parse_states(fsm, src):
+  def parse_states(fsm, src, c_file):
 state = None
 started = None
 
@@ -274,6 +274,15 @@
 for line in lines:
   state_name = state_starts(line)
   if state_name:
+state = fsm.find_state_by_name(state_name)
+if state is not None:
+  if c_file is fsm.from_file:
+print('ERROR: fsm %r has multiple definitions of state %r' % (fsm, 
state_name))
+  else:
+print('ERROR: it appears two FSMs with identical name %r exist in 
%r and %r'
+  % (fsm.struct_name, fsm.from_file, c_file))
+  state = None
+  continue
 state = State()
 fsm.states.append(state)
 started = None
@@ -664,7 +673,7 @@
   states_struct_name = m.group(1)
   for fsm in fsms:
 if states_struct_name == fsm.states_struct_name:
-  fsm.parse_states(c_file.extract_block('{', '}', m.start()))
+  fsm.parse_states(c_file.extract_block('{', '}', m.start()), c_file)
 
   def parse_functions(c_file):
 funcs = {}
@@ -787,6 +796,14 @@
 for c_file in c_files:
   fsms.extend(c_file.find_fsms())
 
+for fsm1 in fsms:
+  for fsm2 in fsms:
+if fsm1 is fsm2:
+  continue
+if fsm1.states_struct_name == fsm2.states_struct_name:
+  print('ERROR: two distinct FSMs share the same states-struct name: %r 
and %r both use %r'
+% (fsm1, fsm2, fsm1.states_struct_name))
+
 for c_file in c_files:
   c_file.find_fsm_states(fsms)
   c_file.find_event_sources(fsms)

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I4fe7e85d2fdf23e2ba964f3b47be1954edc63cef
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Neels Hofmeyr 


osmo-bsc[master]: libbsc: nokia_site: Fix uninitialized return val

2018-03-26 Thread Neels Hofmeyr

Patch Set 1: Code-Review+2

(1 comment)

https://gerrit.osmocom.org/#/c/7508/1/src/libbsc/bts_nokia_site.c
File src/libbsc/bts_nokia_site.c:

Line 1237:  ret = abis_nm_sendmsg(bts, msg);
change in behavior: previously, abis_nm_sendmsg() could return a positive value 
in the last loop iteration, which would then be returned below.

Taken a look, and it (ultimately abis_sendmsg()) never returns positive value 
so this is fine.


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

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


[PATCH] osmo-bsc[master]: paging: paging_request_bts: Fix wrong return value

2018-03-26 Thread Pau Espin Pedrol

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

paging: paging_request_bts: Fix wrong return value

Change-Id: I48f5efbcddd98e15256edfca06ba0ae6acb5bab1
---
M src/libbsc/paging.c
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/src/libbsc/paging.c b/src/libbsc/paging.c
index e429663..910a9b6 100644
--- a/src/libbsc/paging.c
+++ b/src/libbsc/paging.c
@@ -342,7 +342,7 @@
/* Trigger paging, pass any error to the caller */
rc = _paging_request(bts, bsub, type, msc);
if (rc < 0)
-   return rc;
+   return 0;
return 1;
 }
 

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

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


osmo-bsc[master]: bssap: Log non handled paging requests

2018-03-26 Thread Neels Hofmeyr

Patch Set 1: Code-Review+2

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

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


osmo-bsc[master]: bsc_vty: Fix uninitialized var false positive on gcc 7.3.1

2018-03-26 Thread Pau Espin Pedrol

Patch Set 1:

/home/pespin/dev/sysmocom/git/osmo-bsc/src/libbsc/bsc_vty.c: In function 
‘lchan_summary’:
/home/pespin/dev/sysmocom/git/osmo-bsc/src/libbsc/bsc_vty.c:1464:9: error: ‘ts’ 
may be used uninitialized in this function [-Werror=maybe-uninitialized]
   lchan = >lchan[lchan_nr];
   ~~^~
/home/pespin/dev/sysmocom/git/osmo-bsc/src/libbsc/bsc_vty.c:1452:6: error: 
‘trx’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
   ts = >ts[ts_nr];
   ~~~^
/home/pespin/dev/sysmocom/git/osmo-bsc/src/libbsc/bsc_vty.c:1440:7: error: 
‘bts’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
   trx = gsm_bts_trx_num(bts, trx_nr);
   ^~

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

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


osmo-msc[master]: gsup_test_client: gsupc_read_cb: fix uninitialized value 'io'

2018-03-26 Thread Pau Espin Pedrol

Patch Set 1: Code-Review+1

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

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


[PATCH] osmo-ttcn3-hacks[master]: fix TCH/H for TC_chan_exhaustion

2018-03-26 Thread dexter

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

fix TCH/H for TC_chan_exhaustion

At the moment we use onle TCH/F and PDCH in our osmo-bsc config,
but the tests TC_assignment_codec_amr_h and TC_assignment_codec_h
requre a half rate channel in order to work. Configuring one TCH/F
to TCH/H seems not to hurt any tests except TC_chan_exhaustion

- also regard half rate channels in TC_chan_exhaustion
- change included sample osmo-bsc.cfg

Change-Id: Idd5a9602f1b49b5aa0fc510faa151fe16c0b404d
Related: OS#3100
---
M bsc/BSC_Tests.ttcn
M bsc/osmo-bsc.cfg
2 files changed, 8 insertions(+), 7 deletions(-)


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

diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index e4601eb..77be6b6 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -52,7 +52,8 @@
 const float T3101_MAX := 12.0;
 
 /* make sure to sync this with the osmo-bts.cfg you're using */
-const integer NUM_TCHF_PER_BTS := 5;
+const integer NUM_TCHH_PER_BTS := 2;
+const integer NUM_TCHF_PER_BTS := 4;
 const integer NUM_SDCCH_PER_BTS := 4;
 
 
@@ -480,14 +481,14 @@
chreq_nochan := f_ctrl_get_ratectr_abs(IPA_CTRL, "bts", 0, 
"chreq:no_channel");
 
/* expect 5xTCH/F to succeed */
-   for (i := 0; i < NUM_TCHF_PER_BTS + NUM_SDCCH_PER_BTS; i := i+1) {
+   for (i := 0; i < NUM_TCHF_PER_BTS + NUM_TCHH_PER_BTS + 
NUM_SDCCH_PER_BTS; i := i+1) {
var RslChannelNr chan_nr := f_chreq_act_ack('23'O, i);
}
 
IPA_RSL[0].clear;
 
f_ctrl_get_exp_ratectr_abs(IPA_CTRL, "bts", 0, "chreq:total",
-  
chreq_total+NUM_TCHF_PER_BTS+NUM_SDCCH_PER_BTS);
+  chreq_total + NUM_TCHF_PER_BTS + 
NUM_TCHH_PER_BTS + NUM_SDCCH_PER_BTS);
 
/* now expect additional channel activations to fail */
f_ipa_tx(0, ts_RSL_CHAN_RQD('42'O, 42));
@@ -503,7 +504,7 @@
rr := 
dec_GsmRrMessage(rsl_ud.rsl.ies[1].body.full_imm_ass_info.payload);
if (rr.header.message_type == IMMEDIATE_ASSIGNMENT_REJECT) {
f_ctrl_get_exp_ratectr_abs(IPA_CTRL, "bts", 0, 
"chreq:total",
-  
chreq_total+NUM_TCHF_PER_BTS+NUM_SDCCH_PER_BTS+1);
+  chreq_total + 
NUM_TCHF_PER_BTS + NUM_TCHH_PER_BTS + NUM_SDCCH_PER_BTS+1);
f_ctrl_get_exp_ratectr_abs(IPA_CTRL, "bts", 0, 
"chreq:no_channel",
   chreq_nochan+1);
setverdict(pass);
diff --git a/bsc/osmo-bsc.cfg b/bsc/osmo-bsc.cfg
index 2fa67e9..60cfcd7 100644
--- a/bsc/osmo-bsc.cfg
+++ b/bsc/osmo-bsc.cfg
@@ -149,7 +149,7 @@
 phys_chan_config TCH/F
 hopping enabled 0
timeslot 5
-phys_chan_config TCH/F
+phys_chan_config TCH/H
 hopping enabled 0
timeslot 6
 phys_chan_config PDCH
@@ -239,7 +239,7 @@
 phys_chan_config TCH/F
 hopping enabled 0
timeslot 5
-phys_chan_config TCH/F
+phys_chan_config TCH/H
 hopping enabled 0
timeslot 6
 phys_chan_config PDCH
@@ -329,7 +329,7 @@
 phys_chan_config TCH/F
 hopping enabled 0
timeslot 5
-phys_chan_config TCH/F
+phys_chan_config TCH/H
 hopping enabled 0
timeslot 6
 phys_chan_config PDCH

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

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


osmo-ttcn3-hacks[master]: fix TCH/H for TC_chan_exhaustion

2018-03-26 Thread Harald Welte

Patch Set 1:

we will need the config file change in docker-playground.git.

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

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


osmo-ttcn3-hacks[master]: fix TCH/H for TC_chan_exhaustion

2018-03-26 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


osmo-bsc[master]: gscon: fix illegal state transitions

2018-03-26 Thread Neels Hofmeyr

Patch Set 1: Code-Review+2

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

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


[PATCH] osmo-bsc[master]: bssap: Log non handled paging requests

2018-03-26 Thread Pau Espin Pedrol

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

bssap: Log non handled paging requests

Return code in bssap_test is changed to ack it was sent and prevent the
log from being printed.

Change-Id: Ie8075d076cc34570fefce3beb577567707a29d4e
---
M src/osmo-bsc/osmo_bsc_bssap.c
M tests/bssap/bssap_test.c
2 files changed, 3 insertions(+), 1 deletion(-)


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

diff --git a/src/osmo-bsc/osmo_bsc_bssap.c b/src/osmo-bsc/osmo_bsc_bssap.c
index 3cd6051..6eba359 100644
--- a/src/osmo-bsc/osmo_bsc_bssap.c
+++ b/src/osmo-bsc/osmo_bsc_bssap.c
@@ -260,6 +260,8 @@
bts->nr, mi_string, tmsi, tmsi, lac);
 
ret = bsc_grace_paging_request(msc->network->bsc_data->rf_ctrl->policy, 
subscr, chan_needed, msc, bts);
+   if (!ret)
+   LOGP(DMSC, LOGL_ERROR, "Paging request not handled!\n");
 
/* the paging code has grabbed its own references */
bsc_subscr_put(subscr);
diff --git a/tests/bssap/bssap_test.c b/tests/bssap/bssap_test.c
index 5601e29..0cbf34a 100644
--- a/tests/bssap/bssap_test.c
+++ b/tests/bssap/bssap_test.c
@@ -50,7 +50,7 @@
else
fprintf(stderr, "BSC paging started with LAC %u\n", 
subscr->lac);
OSMO_ASSERT(gl_expect_lac == subscr->lac);
-   return 0;
+   return 1;
 }
 
 struct {

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

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


osmo-bsc[master]: libbsc: nokia_site: Fix uninitialized return val

2018-03-26 Thread Pau Espin Pedrol

Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/#/c/7508/1/src/libbsc/bts_nokia_site.c
File src/libbsc/bts_nokia_site.c:

Line 1237:  ret = abis_nm_sendmsg(bts, msg);
> change in behavior: previously, abis_nm_sendmsg() could return a positive v
I didn't think about this, thanks for checking.


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

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


osmo-bsc[master]: paging: paging_request_bts: Fix wrong return value

2018-03-26 Thread Neels Hofmeyr

Patch Set 1: Code-Review+1

(1 comment)

https://gerrit.osmocom.org/#/c/7510/1/src/libbsc/paging.c
File src/libbsc/paging.c:

Line 345:   return 0;
why not handle the negative rc properly at the callers?


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

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


[PATCH] osmo-msc[master]: gsup_test_client: gsupc_read_cb: fix uninitialized value 'io'

2018-03-26 Thread Neels Hofmeyr

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

gsup_test_client: gsupc_read_cb: fix uninitialized value 'io'

Change-Id: Idb3ca50009e25c8e10bcbd15e430caf6de18a040
---
M src/libgsupclient/gsup_test_client.c
1 file changed, 3 insertions(+), 3 deletions(-)


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

diff --git a/src/libgsupclient/gsup_test_client.c 
b/src/libgsupclient/gsup_test_client.c
index add98e4..03ba68e 100644
--- a/src/libgsupclient/gsup_test_client.c
+++ b/src/libgsupclient/gsup_test_client.c
@@ -217,7 +217,7 @@
 static int gsupc_read_cb(struct gsup_client *gsupc, struct msgb *msg)
 {
struct osmo_gsup_message gsup_msg = {0};
-   struct imsi_op *io;
+   struct imsi_op *io = NULL;
int rc;
 
DEBUGP(DLGSUP, "Rx GSUP %s\n", msgb_hexdump(msg));
@@ -237,14 +237,14 @@
case IMSI_OP_SAI:
case IMSI_OP_LU:
io = imsi_op_find(gsup_msg.imsi, rc);
-   if (!io)
-   return -1;
break;
case IMSI_OP_ISD:
/* ISD is an inbound transaction */
io = imsi_op_alloc(g_gc, gsup_msg.imsi, IMSI_OP_ISD);
break;
}
+   if (!io)
+   return -1;
 
imsi_op_rx_gsup(io, _msg);
msgb_free(msg);

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

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


[PATCH] osmo-bsc[master]: libbsc: nokia_site: Fix uninitialized return val

2018-03-26 Thread Pau Espin Pedrol

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

libbsc: nokia_site: Fix uninitialized return val

Fixes following compilation warning:
bts_nokia_site.c:1248:9: error: ‘ret’ may be used uninitialized in this 
function [-Werror=maybe-uninitialized]
  return ret;

This could happen if parameter len is passed with value 0.
If we reach the end of the function, it means everything went fine, so
we can return 0 instead of using ret, which is only used to store error
code before returning.

Change-Id: Ic60c8c632a6ddadb8f197d56cc68c2dbfc121d05
---
M src/libbsc/bts_nokia_site.c
1 file changed, 2 insertions(+), 1 deletion(-)


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

diff --git a/src/libbsc/bts_nokia_site.c b/src/libbsc/bts_nokia_site.c
index 6221e5f..67281bb 100644
--- a/src/libbsc/bts_nokia_site.c
+++ b/src/libbsc/bts_nokia_site.c
@@ -1245,7 +1245,8 @@
data += len_to_send;
seq++;
}
-   return ret;
+
+   return 0;
 }
 
 /* TODO: put in a separate file ? */

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

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


[PATCH] osmo-bsc[master]: bsc_vty: Fix uninitialized var false positive on gcc 7.3.1

2018-03-26 Thread Pau Espin Pedrol

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

bsc_vty: Fix uninitialized var false positive on gcc 7.3.1

Change-Id: If2b315d76081f7ef5f2faf07c502f20196ba6a09
---
M src/libbsc/bsc_vty.c
1 file changed, 3 insertions(+), 3 deletions(-)


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

diff --git a/src/libbsc/bsc_vty.c b/src/libbsc/bsc_vty.c
index 9dc754e..6daeb98 100644
--- a/src/libbsc/bsc_vty.c
+++ b/src/libbsc/bsc_vty.c
@@ -1411,9 +1411,9 @@
 void (*dump_cb)(struct vty *, struct gsm_lchan *))
 {
struct gsm_network *net = gsmnet_from_vty(vty);
-   struct gsm_bts *bts;
-   struct gsm_bts_trx *trx;
-   struct gsm_bts_trx_ts *ts;
+   struct gsm_bts *bts = NULL;
+   struct gsm_bts_trx *trx = NULL;
+   struct gsm_bts_trx_ts *ts = NULL;
struct gsm_lchan *lchan;
int bts_nr, trx_nr, ts_nr, lchan_nr;
 

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

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


osmo-bsc[master]: bsc_vty: Fix uninitialized var false positive on gcc 7.3.1

2018-03-26 Thread Neels Hofmeyr

Patch Set 1: Code-Review+1

(1 comment)

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

Line 8: 
would be nice to include the error message from gcc, so we can have an opinion 
on how you dealt with it


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

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


osmo-bsc[master]: paging: paging_request_bts: Fix wrong return value

2018-03-26 Thread Pau Espin Pedrol

Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/#/c/7510/1/src/libbsc/paging.c
File src/libbsc/paging.c:

Line 345:   return 0;
> why not handle the negative rc properly at the callers?
Because the behaviour was changed recently by stsp in all those functions while 
refactoring the code afaik, so you can better discuss it with him.
I personally prefer typical C style (0 success, negative error) unless it's a 
function returning a "bool" type and it's clearly a true/false thing.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I48f5efbcddd98e15256edfca06ba0ae6acb5bab1
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-HasComments: Yes


[PATCH] osmo-gsm-tester[master]: nanobts: Bind to specific addr instead of specific iface

2018-03-26 Thread Pau Espin Pedrol
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/7502

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

nanobts: Bind to specific addr instead of specific iface

This way root access is not required.

Change-Id: I02f6fc9e1cb1ea1e1d950eafe22c231a18100f98
---
M COPYING
M example/resources.conf.prod
M example/resources.conf.rnd
M src/osmo_gsm_tester/bts_nanobts.py
M src/osmo_gsm_tester/resource.py
M src/osmo_gsm_tester/util.py
6 files changed, 38 insertions(+), 34 deletions(-)


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

diff --git a/COPYING b/COPYING
index 94a9ed0..7e0f595 100644
--- a/COPYING
+++ b/COPYING
@@ -1,4 +1,4 @@
-GNU GENERAL PUBLIC LICENSE
+ GNU GENERAL PUBLIC LICENSE
Version 3, 29 June 2007
 
  Copyright (C) 2007 Free Software Foundation, Inc. 
diff --git a/example/resources.conf.prod b/example/resources.conf.prod
index 9f815b8..230976d 100644
--- a/example/resources.conf.prod
+++ b/example/resources.conf.prod
@@ -49,7 +49,6 @@
   ipa_unit_id: 9
   addr: 10.42.42.53
   band: GSM-1900
-  net_device: enp2s0
   power_supply:
 type: 'sispm'
 device: '01:01:4d:98:24'
diff --git a/example/resources.conf.rnd b/example/resources.conf.rnd
index ae48081..8ccf749 100644
--- a/example/resources.conf.rnd
+++ b/example/resources.conf.rnd
@@ -32,7 +32,6 @@
   ipa_unit_id: 9
   addr: 10.42.42.53
   band: GSM-1900
-  net_device: enp2s0
   power_supply:
 type: 'sispm'
 device: '01:01:55:2e:b6'
diff --git a/src/osmo_gsm_tester/bts_nanobts.py 
b/src/osmo_gsm_tester/bts_nanobts.py
index f666f7a..f42bc6e 100644
--- a/src/osmo_gsm_tester/bts_nanobts.py
+++ b/src/osmo_gsm_tester/bts_nanobts.py
@@ -86,24 +86,25 @@
 ###
 
 def start(self):
-for attr in ['net_device', 'ipa_unit_id']:
-if self.conf.get(attr) is None:
-raise log.Error('No attribute %s provided in conf!' % attr)
+if self.conf.get('ipa_unit_id') is None:
+raise log.Error('No attribute %s provided in conf!' % attr)
 self.run_dir = 
util.Dir(self.suite_run.get_test_run_dir().new_dir(self.name()))
 self._configure()
 
-iface = self.conf.get('net_device')
 unitid = int(self.conf.get('ipa_unit_id'))
 bts_ip = self.remote_addr()
+# This fine for now, however concurrent tests using Nanobts may run 
into "address already in use" since dst is broadcast.
+# Once concurrency is needed, a new config attr should be added to 
have an extra static IP assigned on the main-unit to each Nanobts resource.
+local_bind_ip =util.dst_ip_get_local_bind(bts_ip)
 
 # Make sure nanoBTS is powered and in a clean state:
 self.pwsup.power_cycle(1.0)
 
-pcap_recorder.PcapRecorder(self.suite_run, 
self.run_dir.new_dir('pcap'), iface,
+pcap_recorder.PcapRecorder(self.suite_run, 
self.run_dir.new_dir('pcap'), None,
'host %s and port not 22' % 
self.remote_addr())
 
-self.log('Finding nanobts %s...' % bts_ip)
-ipfind = AbisIpFind(self.suite_run, self.run_dir, iface, 'preconf')
+self.log('Finding nanobts %s, binding on %s...' % (bts_ip, 
local_bind_ip))
+ipfind = AbisIpFind(self.suite_run, self.run_dir, local_bind_ip, 
'preconf')
 ipfind.start()
 ipfind.wait_bts_ready(bts_ip)
 running_unitid = ipfind.get_unitid_by_ip(bts_ip)
@@ -124,7 +125,7 @@
 event_loop.sleep(self, 20)
 
 self.log('Starting to connect to', self.bsc)
-ipfind = AbisIpFind(self.suite_run, self.run_dir, iface, 'postconf')
+ipfind = AbisIpFind(self.suite_run, self.run_dir, local_bind_ip, 
'postconf')
 ipfind.start()
 ipfind.wait_bts_ready(bts_ip)
 self.log('nanoBTS configured and running')
@@ -161,45 +162,36 @@
 run_dir = None
 inst = None
 env = None
-iface = None
+bind_ip = None
 proc = None
 
 BIN_ABISIP_FIND = 'abisip-find'
 BTS_UNIT_ID_RE = re.compile("Unit_ID='(?P\d+)/\d+/\d+'")
 
-def __init__(self, suite_run, parent_run_dir, iface, name_suffix):
+def __init__(self, suite_run, parent_run_dir, bind_ip, name_suffix):
 super().__init__(log.C_RUN, AbisIpFind.BIN_ABISIP_FIND + '-' + 
name_suffix)
 self.suite_run = suite_run
 self.parent_run_dir = parent_run_dir
-self.iface = iface
+self.bind_ip = bind_ip
 self.env = {}
-
-def launch_process(self, binary_name, *args):
-binary = os.path.abspath(self.inst.child('bin', binary_name))
-run_dir = self.run_dir.new_dir(binary_name)
-if not os.path.isfile(binary):
-raise RuntimeError('Binary missing: %r' % binary)
-proc = process.Process(binary_name, run_dir,
-   (binary,) + args,
-   env=self.env)
-

openbsc[master]: backport support for 3-digit MNC with leading zeros

2018-03-26 Thread Neels Hofmeyr

Patch Set 2: Verified+1

I've now successfully verified that this works, by running a manual osmo-nitb 
network with the patch compiled in. (at first I built master by accident and 
thus also verified that the current master of openbsc.git fails to send the 
proper leading-zero MNC). See also the pcap attached to OS#3010

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

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


openbsc[master]: backport support for 3-digit MNC with leading zeros

2018-03-26 Thread Harald Welte

Patch Set 2: Code-Review+2

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

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


osmo-msc[master]: gsup_test_client: gsupc_read_cb: fix uninitialized value 'io'

2018-03-26 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


[PATCH] osmo-gsm-manuals[master]: message sequence charts for GSM <-> SIP codec selection

2018-03-26 Thread Harald Welte

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

message sequence charts for GSM <-> SIP codec selection

Those diagrams represent the current design of the way how
GSM <-> SIP codec selection should work in the future.

Related: OS#1683
Change-Id: If92379b41d859bdf7be4b7689dc0bbca7cb6e682
---
A common/chapters/msc_mncc_mo_sip_mgcp.msc
A common/chapters/msc_mncc_mo_sip_rel18x_mgcp.msc
A common/chapters/msc_mncc_mt_sip_mgcp.msc
3 files changed, 211 insertions(+), 0 deletions(-)


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

diff --git a/common/chapters/msc_mncc_mo_sip_mgcp.msc 
b/common/chapters/msc_mncc_mo_sip_mgcp.msc
new file mode 100644
index 000..ab904be
--- /dev/null
+++ b/common/chapters/msc_mncc_mo_sip_mgcp.msc
@@ -0,0 +1,68 @@
+msc {
+   hscale="3";
+   ms [label="MS"], bsc [label="BSC"], mgw [label="MGW@MSC"], omsc 
[label="OsmoMSC"], osc [label="OsmoSIPcon"], sip [label="External SIP World"];
+   |||;
+   ... [label="Mobile Originated call handled via 
osmo-sip-conector, OsmoMSC, OsmoMGW: No reliable 18x"];
+   |||;
+
+   ms <-> bsc  [label="RR Establishment"];
+   ms <-> omsc [label="MM Procedures (Auth/Ciph/...)"];
+   ...;
+
+   ms -> omsc  [label="CC SETUP (called, bearer_cap)"];
+   omsc -> osc [label="MNCC_SETUP_IND (calling, called, bearer_cap)"];
+   osc box osc [label="bearer_cap -> SDP"];
+   osc -> sip  [label="SIP INVITE (from, to, SDP)"];
+   osc <- sip  [label="SIP 100 Trying (NO rel100)"];
+   omsc <- osc [label="MNCC_CALL_PROC_REQ"];
+   ms <- omsc  [label="CC CALL PROCEEDING"];
+   ...;
+
+   sip box sip [label="SIP UA starts ringing"];
+   osc <- sip  [label="SIP 180 Ringing (NO SDP)"];
+   omsc <- osc [label="MNCC_ALERT_REQ"];
+   ms <- omsc  [label="CC ALERTING"];
+
+   omsc box omsc   [label="generate BSSMAP codec list from\n(without 
knowing SIP/SDP)"];
+   bsc <- omsc [label="BSSMAP ASSIGNMENT REQ"];
+   ms <-> bsc  [label="RR ASSIGNMENT or RR MODE MODIFY"];
+   bsc -> omsc [label="BSSMAP ASSIGNMENT COMPL"];
+   omsc box omsc   [label="determine chosen codec from\nBSSMAP 
Assignment"];
+   mgw <- omsc [label="MGCP CRCX (RAN-side, chosen codec)"];
+   mgw -> omsc [label="MGCP CRCX OK (RAN-side)"];
+
+   sip box sip [label="User accepts call"];
+   osc <- sip  [label="SIP 200 OK (SDP, finally)"];
+   omsc <- osc [label="MNCC_SETUP_RSP"];
+   ms <- omsc  [label="CC CONNECT"];
+   omsc <- osc [label="MNCC_RTP_CONNECT"];
+
+   omsc <- osc [label="MNCC_RTP_CREATE.req (SDP from SIP)"];
+   mgw <- omsc [label="MGCP CRCX (EXT-side)"];
+   mgw box mgw [label="If there is a common codec between RAN and CN, 
use that\nElse: Configure Transcoding in MGW"];
+   mgw -> omsc [label="MGCP CRCX OK (EXT-side)"];
+   omsc -> osc [label="MNCC_RTP_CREATE.resp (CN side IP/Port)"];
+   mgw <- omsc [label="MGCP MDCX (sendrecv)"];
+   mgw -> omsc [label="MGCP MDCX OK"];
+   ms -> omsc  [label="CC CONNECT ACK"];
+   omsc -> osc [label="MNCC_SETUP_COMPL_IND"];
+   osc -> sip  [label="SIP ACK"];
+   ...;
+   ms box ms   [label="MO user releases call"];
+   ms -> omsc  [label="CC DISCONNECT"];
+   omsc -> osc [label="MNCC_DISC_IND"];
+   osc -> sip  [label="SIP BYE"];
+   osc <- sip  [label="SIP 200 OK"];
+   omsc <- osc [label="MNCC_REL_REQ"];
+   ms <- omsc  [label="CC RELEASE COMMAND"];
+   ms -> omsc  [label="CC REELASE COMPLETE"];
+   omsc -> osc [label="MNCC_REL_CNF"];
+   mgw <- omsc [label="MGCP DLCX (all connections on EP)"];
+   mgw -> omsc [label="MGCP DLCX OK"];
+   bsc <- omsc [label="BSSMAP CLEAR CMD"];
+   ms <-> bsc  [label="RR Disconnect"];
+   bsc -> omsc [label="BSSMAP CLEAR CMPL"];
+
+}
+
+
diff --git a/common/chapters/msc_mncc_mo_sip_rel18x_mgcp.msc 
b/common/chapters/msc_mncc_mo_sip_rel18x_mgcp.msc
new file mode 100644
index 000..cd12aa5
--- /dev/null
+++ b/common/chapters/msc_mncc_mo_sip_rel18x_mgcp.msc
@@ -0,0 +1,72 @@
+msc {
+   hscale="3";
+   ms [label="MS"], bsc [label="BSC"], mgw [label="MGW@MSC"], omsc 
[label="OsmoMSC"], osc [label="OsmoSIPcon"], sip [label="External SIP World"];
+   |||;
+   ... [label="Mobile Originated call handled via 
osmo-sip-conector, OsmoMSC, OsmoMGW: Reliable 18x"];
+   |||;
+
+   ms <-> bsc  [label="RR Establishment"];
+   ms <-> omsc [label="MM Procedures (Auth/Ciph/...)"];
+   ...;
+
+   ms -> omsc  [label="CC SETUP (called, bearer_cap)"];
+   omsc -> osc [label="MNCC_SETUP_IND (calling, called, bearer_cap)"];
+   osc box osc [label="bearer_cap -> SDP"];
+   osc -> sip  [label="SIP INVITE (from, to, 

osmo-gsm-tester[master]: nanobts: Bind to specific addr instead of specific iface

2018-03-26 Thread Harald Welte

Patch Set 2:

(1 comment)

https://gerrit.osmocom.org/#/c/7502/2/COPYING
File COPYING:

Line 1:  GNU GENERAL PUBLIC LICENSE
?!?


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

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


osmo-ttcn3-hacks[master]: MNCC_Emulation: Send HELLO in "server" role

2018-03-26 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


[MERGED] osmo-ttcn3-hacks[master]: More progress on osmo-sip-connector tests

2018-03-26 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: More progress on osmo-sip-connector tests
..


More progress on osmo-sip-connector tests

Change-Id: I34a5d7929264c7f5f21d3868a5f919874ffa106c
---
M library/MNCC_Types.ttcn
M library/SIP_Emulation.ttcn
A library/SIP_Templates.ttcn
M sip/SIP_Tests.cfg
M sip/SIP_Tests.default
M sip/SIP_Tests.ttcn
M sip/gen_links.sh
7 files changed, 798 insertions(+), 47 deletions(-)

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



diff --git a/library/MNCC_Types.ttcn b/library/MNCC_Types.ttcn
index 39f9dce..19af236 100644
--- a/library/MNCC_Types.ttcn
+++ b/library/MNCC_Types.ttcn
@@ -512,6 +512,39 @@
}
}
 };
+template MNCC_PDU tr_MNCC_SETUP_req(template uint32_t call_id := ?,
+   template charstring called := ?,
+   template charstring calling := *,
+   template charstring imsi := ?) := {
+   msg_type := MNCC_SETUP_REQ,
+   u := {
+   signal := { /* See 24.008 9.3.23.1 */
+   callref := call_id,
+   bearer_cap := *,/* 
mandatory in CC */
+   called := tr_MNCC_number(called),   /* 
optional */
+   calling := tr_MNCC_number(calling), /* 
optional */
+   redirecting := *,   /* 
optional */
+   connected := omit,
+   cause := omit,
+   progress := *,  /* 
optional */
+   useruser := *,  /* 
optional */
+   facility := *,  /* 
optional */
+   cccap := omit,
+   ssversion := omit,
+   clir_sup := 0,
+   clir_inv := 0,
+   signal := *,/* 
optional */
+   keypad := omit,
+   more := 0,
+   notify := 0,
+   emergency := *,
+   imsi := imsi,
+   lchan_type := ?,
+   lchan_mode := ?
+   }
+   }
+};
+
 
 /* MO: MSC <- MNCC: Respons to SETUP.ind */
 template MNCC_PDU ts_MNCC_SETUP_rsp(uint32_t call_id, charstring imsi := "",
@@ -653,9 +686,9 @@
redirecting := omit,
connected := connected,
cause := omit,
-   progress := *,
-   useruser := *,
-   facility := *,
+   progress := omit,
+   useruser := omit,
+   facility := omit,
cccap := omit,
ssversion := omit,
clir_sup := 0,
@@ -664,10 +697,10 @@
keypad := omit,
more := 0,
notify := 0,
-   emergency := *,
+   emergency := omit,
imsi := "",
-   lchan_type := ?,
-   lchan_mode := ?
+   lchan_type := 0,
+   lchan_mode := 0
}
}
 }
@@ -807,6 +840,39 @@
}
}
 }
+template MNCC_PDU ts_MNCC_CALL_CONF_ind(uint32_t call_id,
+   template (omit) MNCC_bearer_cap bcap := 
omit,
+   template (omit) MNCC_cause cause := 
omit,
+   template (omit) MNCC_cccap cccap := 
omit) := {
+   msg_type := MNCC_CALL_CONF_IND,
+   u := {
+   signal := { /* See 24.008 9.3.2 */
+   callref := call_id,
+   bearer_cap := bcap,
+   called := omit,
+   calling := omit,
+   redirecting := omit,
+   connected := omit,
+   cause := cause,
+   progress := omit,
+   useruser := omit,
+   facility := omit,
+   cccap := cccap,
+   ssversion := omit,
+   clir_sup := 0,
+   clir_inv := 0,
+   signal := omit,
+   keypad := omit,
+   more := 0,
+   notify := 0,
+   emergency := omit,
+   imsi := "",
+   lchan_type := 0,
+   lchan_mode := 0
+   }
+   }
+}
+
 
 /* MO: 

[MERGED] osmo-gsm-manuals[master]: message sequence charts for GSM <-> SIP codec selection

2018-03-26 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: message sequence charts for GSM <-> SIP codec selection
..


message sequence charts for GSM <-> SIP codec selection

Those diagrams represent the current design of the way how
GSM <-> SIP codec selection should work in the future.

Related: OS#1683
Change-Id: If92379b41d859bdf7be4b7689dc0bbca7cb6e682
---
A common/chapters/msc_mncc_mo_sip_mgcp.msc
A common/chapters/msc_mncc_mo_sip_rel18x_mgcp.msc
A common/chapters/msc_mncc_mt_sip_mgcp.msc
3 files changed, 211 insertions(+), 0 deletions(-)

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



diff --git a/common/chapters/msc_mncc_mo_sip_mgcp.msc 
b/common/chapters/msc_mncc_mo_sip_mgcp.msc
new file mode 100644
index 000..ab904be
--- /dev/null
+++ b/common/chapters/msc_mncc_mo_sip_mgcp.msc
@@ -0,0 +1,68 @@
+msc {
+   hscale="3";
+   ms [label="MS"], bsc [label="BSC"], mgw [label="MGW@MSC"], omsc 
[label="OsmoMSC"], osc [label="OsmoSIPcon"], sip [label="External SIP World"];
+   |||;
+   ... [label="Mobile Originated call handled via 
osmo-sip-conector, OsmoMSC, OsmoMGW: No reliable 18x"];
+   |||;
+
+   ms <-> bsc  [label="RR Establishment"];
+   ms <-> omsc [label="MM Procedures (Auth/Ciph/...)"];
+   ...;
+
+   ms -> omsc  [label="CC SETUP (called, bearer_cap)"];
+   omsc -> osc [label="MNCC_SETUP_IND (calling, called, bearer_cap)"];
+   osc box osc [label="bearer_cap -> SDP"];
+   osc -> sip  [label="SIP INVITE (from, to, SDP)"];
+   osc <- sip  [label="SIP 100 Trying (NO rel100)"];
+   omsc <- osc [label="MNCC_CALL_PROC_REQ"];
+   ms <- omsc  [label="CC CALL PROCEEDING"];
+   ...;
+
+   sip box sip [label="SIP UA starts ringing"];
+   osc <- sip  [label="SIP 180 Ringing (NO SDP)"];
+   omsc <- osc [label="MNCC_ALERT_REQ"];
+   ms <- omsc  [label="CC ALERTING"];
+
+   omsc box omsc   [label="generate BSSMAP codec list from\n(without 
knowing SIP/SDP)"];
+   bsc <- omsc [label="BSSMAP ASSIGNMENT REQ"];
+   ms <-> bsc  [label="RR ASSIGNMENT or RR MODE MODIFY"];
+   bsc -> omsc [label="BSSMAP ASSIGNMENT COMPL"];
+   omsc box omsc   [label="determine chosen codec from\nBSSMAP 
Assignment"];
+   mgw <- omsc [label="MGCP CRCX (RAN-side, chosen codec)"];
+   mgw -> omsc [label="MGCP CRCX OK (RAN-side)"];
+
+   sip box sip [label="User accepts call"];
+   osc <- sip  [label="SIP 200 OK (SDP, finally)"];
+   omsc <- osc [label="MNCC_SETUP_RSP"];
+   ms <- omsc  [label="CC CONNECT"];
+   omsc <- osc [label="MNCC_RTP_CONNECT"];
+
+   omsc <- osc [label="MNCC_RTP_CREATE.req (SDP from SIP)"];
+   mgw <- omsc [label="MGCP CRCX (EXT-side)"];
+   mgw box mgw [label="If there is a common codec between RAN and CN, 
use that\nElse: Configure Transcoding in MGW"];
+   mgw -> omsc [label="MGCP CRCX OK (EXT-side)"];
+   omsc -> osc [label="MNCC_RTP_CREATE.resp (CN side IP/Port)"];
+   mgw <- omsc [label="MGCP MDCX (sendrecv)"];
+   mgw -> omsc [label="MGCP MDCX OK"];
+   ms -> omsc  [label="CC CONNECT ACK"];
+   omsc -> osc [label="MNCC_SETUP_COMPL_IND"];
+   osc -> sip  [label="SIP ACK"];
+   ...;
+   ms box ms   [label="MO user releases call"];
+   ms -> omsc  [label="CC DISCONNECT"];
+   omsc -> osc [label="MNCC_DISC_IND"];
+   osc -> sip  [label="SIP BYE"];
+   osc <- sip  [label="SIP 200 OK"];
+   omsc <- osc [label="MNCC_REL_REQ"];
+   ms <- omsc  [label="CC RELEASE COMMAND"];
+   ms -> omsc  [label="CC REELASE COMPLETE"];
+   omsc -> osc [label="MNCC_REL_CNF"];
+   mgw <- omsc [label="MGCP DLCX (all connections on EP)"];
+   mgw -> omsc [label="MGCP DLCX OK"];
+   bsc <- omsc [label="BSSMAP CLEAR CMD"];
+   ms <-> bsc  [label="RR Disconnect"];
+   bsc -> omsc [label="BSSMAP CLEAR CMPL"];
+
+}
+
+
diff --git a/common/chapters/msc_mncc_mo_sip_rel18x_mgcp.msc 
b/common/chapters/msc_mncc_mo_sip_rel18x_mgcp.msc
new file mode 100644
index 000..cd12aa5
--- /dev/null
+++ b/common/chapters/msc_mncc_mo_sip_rel18x_mgcp.msc
@@ -0,0 +1,72 @@
+msc {
+   hscale="3";
+   ms [label="MS"], bsc [label="BSC"], mgw [label="MGW@MSC"], omsc 
[label="OsmoMSC"], osc [label="OsmoSIPcon"], sip [label="External SIP World"];
+   |||;
+   ... [label="Mobile Originated call handled via 
osmo-sip-conector, OsmoMSC, OsmoMGW: Reliable 18x"];
+   |||;
+
+   ms <-> bsc  [label="RR Establishment"];
+   ms <-> omsc [label="MM Procedures (Auth/Ciph/...)"];
+   ...;
+
+   ms -> omsc  [label="CC SETUP (called, bearer_cap)"];
+   omsc -> osc 

[MERGED] osmo-ttcn3-hacks[master]: MNCC_Emulation: Make ExpectedCreateCallback work for SETUP_R...

2018-03-26 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: MNCC_Emulation: Make ExpectedCreateCallback work for SETUP_REQ, 
too
..


MNCC_Emulation: Make ExpectedCreateCallback work for SETUP_REQ, too

In server mode, we need to handle SETUP_REQ in ExpectedCreateCallback,
not only SETUP_IND like in client mode.

Change-Id: I988668cac9970af12d59d05a3a9facca257851c6
---
M library/MNCC_Emulation.ttcn
1 file changed, 3 insertions(+), 2 deletions(-)

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



diff --git a/library/MNCC_Emulation.ttcn b/library/MNCC_Emulation.ttcn
index 0669266..59e3e77 100644
--- a/library/MNCC_Emulation.ttcn
+++ b/library/MNCC_Emulation.ttcn
@@ -390,8 +390,9 @@
var charstring dest_number;
var integer i;
 
-   if (not ischosen(conn_ind.u.signal) or conn_ind.msg_type != 
MNCC_SETUP_IND) {
-   setverdict(fail, "MNCC ExpectedCreateCallback needs 
MNCC_SETUP_IND");
+   if (not ischosen(conn_ind.u.signal) or
+   (conn_ind.msg_type != MNCC_SETUP_IND and conn_ind.msg_type != 
MNCC_SETUP_REQ)) {
+   setverdict(fail, "MNCC ExpectedCreateCallback needs 
MNCC_SETUP_{IND,REQ}");
return ret;
}
dest_number := conn_ind.u.signal.called.number;

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

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


[MERGED] osmo-ttcn3-hacks[master]: MNCC_EncDec.cc: Fix decoding of speech versions in bearer ca...

2018-03-26 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: MNCC_EncDec.cc: Fix decoding of speech versions in bearer 
capabilities
..


MNCC_EncDec.cc: Fix decoding of speech versions in bearer capabilities

Change-Id: I4fd79ee769c967dc209a7e1859d9d8b18d09843e
---
M library/MNCC_EncDec.cc
1 file changed, 5 insertions(+), 2 deletions(-)

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



diff --git a/library/MNCC_EncDec.cc b/library/MNCC_EncDec.cc
index cdfe3ed..b4937e7 100644
--- a/library/MNCC_EncDec.cc
+++ b/library/MNCC_EncDec.cc
@@ -47,8 +47,11 @@
(GSM48__bcap__transp) in->data.transp,
(GSM48__bcap__modem__type) 
in->data.modem_type);
 
-   for (unsigned int i = 0; i < ARRAY_SIZE(in->speech_ver); i++)
-   vers[0] = in->speech_ver[0];
+   for (unsigned int i = 0; i < ARRAY_SIZE(in->speech_ver); i++) {
+   vers[i] = in->speech_ver[i];
+   if (vers[i] == -1)
+   break;
+   }
 
return MNCC__bearer__cap(in->transfer, in->mode, in->coding, in->radio, 
in->speech_ctm,
 vers, data);

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

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


[MERGED] osmo-ttcn3-hacks[master]: MNCC_Types: More types for MNCC server (MSC) side emulation

2018-03-26 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: MNCC_Types: More types for MNCC server (MSC) side emulation
..


MNCC_Types: More types for MNCC server (MSC) side emulation

Change-Id: I1dd1744da7da983412d5d34c40fd896bc7b896db
---
M library/MNCC_Types.ttcn
1 file changed, 239 insertions(+), 1 deletion(-)

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



diff --git a/library/MNCC_Types.ttcn b/library/MNCC_Types.ttcn
index 1818ff3..39f9dce 100644
--- a/library/MNCC_Types.ttcn
+++ b/library/MNCC_Types.ttcn
@@ -274,7 +274,7 @@
variant (coding) "FIELDLENGTH(32)";
 }
 
-template MNCC_cause ts_MNCC_cause(int val,
+template (value) MNCC_cause ts_MNCC_cause(int val,
  GSM48_cause_loc loc := 
GSM48_CAUSE_LOC_PUN_S_LU,
  GSM48_cause_coding coding := 
GSM48_CAUSE_CS_GSM,
  octetstring diag := ''O) := {
@@ -544,6 +544,38 @@
}
}
 };
+template MNCC_PDU tr_MNCC_SETUP_rsp(template uint32_t call_id,
+   template charstring imsi := ?,
+   template MNCC_number connected := *) := {
+   msg_type := MNCC_SETUP_RSP,
+   u := {
+   signal := { /* See 24.008 9.3.5 */
+   callref := call_id,
+   bearer_cap := omit,
+   called := omit,
+   calling := omit,
+   redirecting := omit,
+   connected := connected,
+   cause := omit,
+   progress := omit,
+   useruser := *,  /* 
optional */
+   facility := *,  /* 
optional */
+   cccap := omit,
+   ssversion := *, /* 
optional */
+   clir_sup := 0,
+   clir_inv := 0,
+   signal := omit,
+   keypad := omit,
+   more := 0,
+   notify := 0,
+   emergency := omit,
+   imsi := imsi,
+   lchan_type := ?,
+   lchan_mode := ?
+   }
+   }
+};
+
 
 /* MO: MSC -> MNCC: SETUP.ind from MSC to ext. MNCC handler */
 template MNCC_PDU tr_MNCC_SETUP_ind(template uint32_t call_id := ?, template 
MNCC_number called := ?,
@@ -678,6 +710,8 @@
 /* MT: MSC -> MNCC: SETUP_COMPL.ind; receipt of CONNECT ACK */
 template MNCC_PDU tr_MNCC_SETUP_COMPL_ind(template uint32_t call_id := ?) :=
tr_MNCC_SIMPLE(MNCC_SETUP_COMPL_IND, call_id); /* See 24.008 
9.3.6 */
+template (value) MNCC_PDU ts_MNCC_SETUP_COMPL_ind(uint32_t call_id) :=
+   ts_MNCC_SIMPLE(MNCC_SETUP_COMPL_IND, call_id); /* See 24.008 
9.3.6 */
 
 /* MT: MSC -> MNCC: REJ.req; reject MT call */
 template MNCC_PDU tr_MNCC_REJ_req(template uint32_t call_id, template 
MNCC_cause cause := *) := {
@@ -807,6 +841,40 @@
}
}
 }
+template MNCC_PDU tr_MNCC_CALL_PROC_req(template uint32_t call_id,
+   template MNCC_bearer_cap bcap := *,
+   template MNCC_progress prog := *,
+   template charstring fac := *,
+   template MNCC_cccap cccap := *) := {
+   msg_type := MNCC_CALL_PROC_REQ,
+   u := {
+   signal := { /* See 24.008 9.3.2 */
+   callref := call_id,
+   bearer_cap := bcap,
+   called := omit,
+   calling := omit,
+   redirecting := omit,
+   connected := omit,
+   cause := omit,
+   progress := prog,
+   useruser := omit,
+   facility := fac,
+   cccap := cccap,
+   ssversion := omit,
+   clir_sup := 0,
+   clir_inv := 0,
+   signal := omit,
+   keypad := omit,
+   more := 0,
+   notify := 0,
+   emergency := omit,
+   imsi := ?,
+   lchan_type := ?,
+   lchan_mode := ?
+   }
+   }
+}
+
 
 /* MSC <- MNCC: PROGRESS.req; PROGRESS message from ISDN */
 template MNCC_PDU ts_MNCC_PROGRESS_req(uint32_t call_id, MNCC_progress prog,
@@ -872,6 +940,39 @@
}
}
 }
+template MNCC_PDU tr_MNCC_ALERT_req(template uint32_t call_id,
+   template MNCC_progress prog := *,
+ 

osmo-ttcn3-hacks[master]: MNCC_Emulation: Make ExpectedCreateCallback work for SETUP_R...

2018-03-26 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


osmo-gsm-manuals[master]: message sequence charts for GSM <-> SIP codec selection

2018-03-26 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


osmo-ttcn3-hacks[master]: MNCC_Types: More types for MNCC server (MSC) side emulation

2018-03-26 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


[MERGED] osmo-msc[master]: gsup_test_client: gsupc_read_cb: fix uninitialized value 'io'

2018-03-26 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: gsup_test_client: gsupc_read_cb: fix uninitialized value 'io'
..


gsup_test_client: gsupc_read_cb: fix uninitialized value 'io'

Change-Id: Idb3ca50009e25c8e10bcbd15e430caf6de18a040
---
M src/libgsupclient/gsup_test_client.c
1 file changed, 3 insertions(+), 3 deletions(-)

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



diff --git a/src/libgsupclient/gsup_test_client.c 
b/src/libgsupclient/gsup_test_client.c
index add98e4..03ba68e 100644
--- a/src/libgsupclient/gsup_test_client.c
+++ b/src/libgsupclient/gsup_test_client.c
@@ -217,7 +217,7 @@
 static int gsupc_read_cb(struct gsup_client *gsupc, struct msgb *msg)
 {
struct osmo_gsup_message gsup_msg = {0};
-   struct imsi_op *io;
+   struct imsi_op *io = NULL;
int rc;
 
DEBUGP(DLGSUP, "Rx GSUP %s\n", msgb_hexdump(msg));
@@ -237,14 +237,14 @@
case IMSI_OP_SAI:
case IMSI_OP_LU:
io = imsi_op_find(gsup_msg.imsi, rc);
-   if (!io)
-   return -1;
break;
case IMSI_OP_ISD:
/* ISD is an inbound transaction */
io = imsi_op_alloc(g_gc, gsup_msg.imsi, IMSI_OP_ISD);
break;
}
+   if (!io)
+   return -1;
 
imsi_op_rx_gsup(io, _msg);
msgb_free(msg);

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

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


osmo-ttcn3-hacks[master]: MNCC_EncDec.cc: Fix decoding of speech versions in bearer ca...

2018-03-26 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


[PATCH] osmo-pcu[master]: mslot_class: find_free_tfi(): use uint32_t to shift 1 << 31

2018-03-26 Thread Neels Hofmeyr

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

mslot_class: find_free_tfi(): use uint32_t to shift 1 << 31

Avoid runtime error seen on jenkins admin-deb9build slave, when building
osmo-pcu with_dsp=None,with_vty=False, during ts_alloc and tbf regression
tests:

+../../../src/mslot_class.c:242:22: runtime error: left shift of 1 by 31 places 
cannot be represented in type 'int'

The master-osmo-pcu breaks on this since moving to a debian9 build slave.

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


  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/22/7522/1

diff --git a/src/mslot_class.c b/src/mslot_class.c
index 2a482f1..9d54afe 100644
--- a/src/mslot_class.c
+++ b/src/mslot_class.c
@@ -239,7 +239,7 @@
return -1;
 
for (tfi = 0; tfi < 32; tfi++) {
-   if (!(tfi_map & (1 << tfi)))
+   if (!(tfi_map & (((uint32_t)1) << tfi)))
return tfi;
}
 

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

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


osmo-gsm-tester[master]: nanobts: Bind to specific addr instead of specific iface

2018-03-26 Thread Pau Espin Pedrol

Patch Set 2:

(1 comment)

https://gerrit.osmocom.org/#/c/7502/2/COPYING
File COPYING:

Line 1:  GNU GENERAL PUBLIC LICENSE
> ?!?
That was a test to try to retrigger the the job as the gerrit job seems to be 
not working fine.


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

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


[PATCH] osmo-ttcn3-hacks[master]: More progress on osmo-sip-connector tests

2018-03-26 Thread Harald Welte
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/7466

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

More progress on osmo-sip-connector tests

Change-Id: I34a5d7929264c7f5f21d3868a5f919874ffa106c
---
M library/MNCC_Types.ttcn
M library/SIP_Emulation.ttcn
A library/SIP_Templates.ttcn
M sip/SIP_Tests.cfg
M sip/SIP_Tests.default
M sip/SIP_Tests.ttcn
M sip/gen_links.sh
7 files changed, 798 insertions(+), 47 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/66/7466/2

diff --git a/library/MNCC_Types.ttcn b/library/MNCC_Types.ttcn
index 39f9dce..19af236 100644
--- a/library/MNCC_Types.ttcn
+++ b/library/MNCC_Types.ttcn
@@ -512,6 +512,39 @@
}
}
 };
+template MNCC_PDU tr_MNCC_SETUP_req(template uint32_t call_id := ?,
+   template charstring called := ?,
+   template charstring calling := *,
+   template charstring imsi := ?) := {
+   msg_type := MNCC_SETUP_REQ,
+   u := {
+   signal := { /* See 24.008 9.3.23.1 */
+   callref := call_id,
+   bearer_cap := *,/* 
mandatory in CC */
+   called := tr_MNCC_number(called),   /* 
optional */
+   calling := tr_MNCC_number(calling), /* 
optional */
+   redirecting := *,   /* 
optional */
+   connected := omit,
+   cause := omit,
+   progress := *,  /* 
optional */
+   useruser := *,  /* 
optional */
+   facility := *,  /* 
optional */
+   cccap := omit,
+   ssversion := omit,
+   clir_sup := 0,
+   clir_inv := 0,
+   signal := *,/* 
optional */
+   keypad := omit,
+   more := 0,
+   notify := 0,
+   emergency := *,
+   imsi := imsi,
+   lchan_type := ?,
+   lchan_mode := ?
+   }
+   }
+};
+
 
 /* MO: MSC <- MNCC: Respons to SETUP.ind */
 template MNCC_PDU ts_MNCC_SETUP_rsp(uint32_t call_id, charstring imsi := "",
@@ -653,9 +686,9 @@
redirecting := omit,
connected := connected,
cause := omit,
-   progress := *,
-   useruser := *,
-   facility := *,
+   progress := omit,
+   useruser := omit,
+   facility := omit,
cccap := omit,
ssversion := omit,
clir_sup := 0,
@@ -664,10 +697,10 @@
keypad := omit,
more := 0,
notify := 0,
-   emergency := *,
+   emergency := omit,
imsi := "",
-   lchan_type := ?,
-   lchan_mode := ?
+   lchan_type := 0,
+   lchan_mode := 0
}
}
 }
@@ -807,6 +840,39 @@
}
}
 }
+template MNCC_PDU ts_MNCC_CALL_CONF_ind(uint32_t call_id,
+   template (omit) MNCC_bearer_cap bcap := 
omit,
+   template (omit) MNCC_cause cause := 
omit,
+   template (omit) MNCC_cccap cccap := 
omit) := {
+   msg_type := MNCC_CALL_CONF_IND,
+   u := {
+   signal := { /* See 24.008 9.3.2 */
+   callref := call_id,
+   bearer_cap := bcap,
+   called := omit,
+   calling := omit,
+   redirecting := omit,
+   connected := omit,
+   cause := cause,
+   progress := omit,
+   useruser := omit,
+   facility := omit,
+   cccap := cccap,
+   ssversion := omit,
+   clir_sup := 0,
+   clir_inv := 0,
+   signal := omit,
+   keypad := omit,
+   more := 0,
+   notify := 0,
+   emergency := omit,
+   imsi := "",
+   lchan_type := 0,
+   lchan_mode := 0
+   }
+   }
+}
+
 
 /* MO: MSC <- MNCC: CALL_PROC.req; call 

osmo-ttcn3-hacks[master]: WIP: SIP progress

2018-03-26 Thread Harald Welte
Harald Welte has restored this change.

Change subject: WIP: SIP progress
..


Restored

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

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


[PATCH] osmo-ttcn3-hacks[master]: MNCC_EncDec.cc: Fix decoding of speech versions in bearer ca...

2018-03-26 Thread Harald Welte

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

MNCC_EncDec.cc: Fix decoding of speech versions in bearer capabilities

Change-Id: I4fd79ee769c967dc209a7e1859d9d8b18d09843e
---
M library/MNCC_EncDec.cc
1 file changed, 5 insertions(+), 2 deletions(-)


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

diff --git a/library/MNCC_EncDec.cc b/library/MNCC_EncDec.cc
index cdfe3ed..b4937e7 100644
--- a/library/MNCC_EncDec.cc
+++ b/library/MNCC_EncDec.cc
@@ -47,8 +47,11 @@
(GSM48__bcap__transp) in->data.transp,
(GSM48__bcap__modem__type) 
in->data.modem_type);
 
-   for (unsigned int i = 0; i < ARRAY_SIZE(in->speech_ver); i++)
-   vers[0] = in->speech_ver[0];
+   for (unsigned int i = 0; i < ARRAY_SIZE(in->speech_ver); i++) {
+   vers[i] = in->speech_ver[i];
+   if (vers[i] == -1)
+   break;
+   }
 
return MNCC__bearer__cap(in->transfer, in->mode, in->coding, in->radio, 
in->speech_ctm,
 vers, data);

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

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


[PATCH] osmo-ttcn3-hacks[master]: MNCC_Types: More types for MNCC server (MSC) side emulation

2018-03-26 Thread Harald Welte

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

MNCC_Types: More types for MNCC server (MSC) side emulation

Change-Id: I1dd1744da7da983412d5d34c40fd896bc7b896db
---
M library/MNCC_Types.ttcn
1 file changed, 239 insertions(+), 1 deletion(-)


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

diff --git a/library/MNCC_Types.ttcn b/library/MNCC_Types.ttcn
index 1818ff3..39f9dce 100644
--- a/library/MNCC_Types.ttcn
+++ b/library/MNCC_Types.ttcn
@@ -274,7 +274,7 @@
variant (coding) "FIELDLENGTH(32)";
 }
 
-template MNCC_cause ts_MNCC_cause(int val,
+template (value) MNCC_cause ts_MNCC_cause(int val,
  GSM48_cause_loc loc := 
GSM48_CAUSE_LOC_PUN_S_LU,
  GSM48_cause_coding coding := 
GSM48_CAUSE_CS_GSM,
  octetstring diag := ''O) := {
@@ -544,6 +544,38 @@
}
}
 };
+template MNCC_PDU tr_MNCC_SETUP_rsp(template uint32_t call_id,
+   template charstring imsi := ?,
+   template MNCC_number connected := *) := {
+   msg_type := MNCC_SETUP_RSP,
+   u := {
+   signal := { /* See 24.008 9.3.5 */
+   callref := call_id,
+   bearer_cap := omit,
+   called := omit,
+   calling := omit,
+   redirecting := omit,
+   connected := connected,
+   cause := omit,
+   progress := omit,
+   useruser := *,  /* 
optional */
+   facility := *,  /* 
optional */
+   cccap := omit,
+   ssversion := *, /* 
optional */
+   clir_sup := 0,
+   clir_inv := 0,
+   signal := omit,
+   keypad := omit,
+   more := 0,
+   notify := 0,
+   emergency := omit,
+   imsi := imsi,
+   lchan_type := ?,
+   lchan_mode := ?
+   }
+   }
+};
+
 
 /* MO: MSC -> MNCC: SETUP.ind from MSC to ext. MNCC handler */
 template MNCC_PDU tr_MNCC_SETUP_ind(template uint32_t call_id := ?, template 
MNCC_number called := ?,
@@ -678,6 +710,8 @@
 /* MT: MSC -> MNCC: SETUP_COMPL.ind; receipt of CONNECT ACK */
 template MNCC_PDU tr_MNCC_SETUP_COMPL_ind(template uint32_t call_id := ?) :=
tr_MNCC_SIMPLE(MNCC_SETUP_COMPL_IND, call_id); /* See 24.008 
9.3.6 */
+template (value) MNCC_PDU ts_MNCC_SETUP_COMPL_ind(uint32_t call_id) :=
+   ts_MNCC_SIMPLE(MNCC_SETUP_COMPL_IND, call_id); /* See 24.008 
9.3.6 */
 
 /* MT: MSC -> MNCC: REJ.req; reject MT call */
 template MNCC_PDU tr_MNCC_REJ_req(template uint32_t call_id, template 
MNCC_cause cause := *) := {
@@ -807,6 +841,40 @@
}
}
 }
+template MNCC_PDU tr_MNCC_CALL_PROC_req(template uint32_t call_id,
+   template MNCC_bearer_cap bcap := *,
+   template MNCC_progress prog := *,
+   template charstring fac := *,
+   template MNCC_cccap cccap := *) := {
+   msg_type := MNCC_CALL_PROC_REQ,
+   u := {
+   signal := { /* See 24.008 9.3.2 */
+   callref := call_id,
+   bearer_cap := bcap,
+   called := omit,
+   calling := omit,
+   redirecting := omit,
+   connected := omit,
+   cause := omit,
+   progress := prog,
+   useruser := omit,
+   facility := fac,
+   cccap := cccap,
+   ssversion := omit,
+   clir_sup := 0,
+   clir_inv := 0,
+   signal := omit,
+   keypad := omit,
+   more := 0,
+   notify := 0,
+   emergency := omit,
+   imsi := ?,
+   lchan_type := ?,
+   lchan_mode := ?
+   }
+   }
+}
+
 
 /* MSC <- MNCC: PROGRESS.req; PROGRESS message from ISDN */
 template MNCC_PDU ts_MNCC_PROGRESS_req(uint32_t call_id, MNCC_progress prog,
@@ -872,6 +940,39 @@
}
}
 }
+template MNCC_PDU tr_MNCC_ALERT_req(template uint32_t call_id,
+   template MNCC_progress prog := *,
+   template charstring fac := *,
+   template MNCC_useruser uu := *) := {
+   msg_type := 

[PATCH] osmo-ttcn3-hacks[master]: MNCC_Emulation: Make ExpectedCreateCallback work for SETUP_R...

2018-03-26 Thread Harald Welte

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

MNCC_Emulation: Make ExpectedCreateCallback work for SETUP_REQ, too

In server mode, we need to handle SETUP_REQ in ExpectedCreateCallback,
not only SETUP_IND like in client mode.

Change-Id: I988668cac9970af12d59d05a3a9facca257851c6
---
M library/MNCC_Emulation.ttcn
1 file changed, 3 insertions(+), 2 deletions(-)


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

diff --git a/library/MNCC_Emulation.ttcn b/library/MNCC_Emulation.ttcn
index 0669266..59e3e77 100644
--- a/library/MNCC_Emulation.ttcn
+++ b/library/MNCC_Emulation.ttcn
@@ -390,8 +390,9 @@
var charstring dest_number;
var integer i;
 
-   if (not ischosen(conn_ind.u.signal) or conn_ind.msg_type != 
MNCC_SETUP_IND) {
-   setverdict(fail, "MNCC ExpectedCreateCallback needs 
MNCC_SETUP_IND");
+   if (not ischosen(conn_ind.u.signal) or
+   (conn_ind.msg_type != MNCC_SETUP_IND and conn_ind.msg_type != 
MNCC_SETUP_REQ)) {
+   setverdict(fail, "MNCC ExpectedCreateCallback needs 
MNCC_SETUP_{IND,REQ}");
return ret;
}
dest_number := conn_ind.u.signal.called.number;

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

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


osmo-ttcn3-hacks[master]: More progress on osmo-sip-connector tests

2018-03-26 Thread Harald Welte

Patch Set 2: Code-Review+2

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

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


osmo-ttcn3-hacks[master]: Makefile: Add new 'sip' testsuite to list of testsuites

2018-03-26 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


[MERGED] osmo-ttcn3-hacks[master]: Makefile: Add new 'sip' testsuite to list of testsuites

2018-03-26 Thread Harald Welte
Harald Welte has submitted this change and it was merged.

Change subject: Makefile: Add new 'sip' testsuite to list of testsuites
..


Makefile: Add new 'sip' testsuite to list of testsuites

Change-Id: Ie7cc41a40fb8706e9b0752be6e7c1f34dc692d87
---
M Makefile
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/Makefile b/Makefile
index aeca0e1..fcd6601 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-SUBDIRS=bsc bsc-nat bts ggsn_tests hlr lapdm mgw msc pcu selftest sgsn sysinfo
+SUBDIRS=bsc bsc-nat bts ggsn_tests hlr lapdm mgw msc pcu selftest sgsn sip 
sysinfo
 
 PARALLEL_MAKE ?= -j8
 

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

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


[PATCH] osmo-ttcn3-hacks[master]: Makefile: Add new 'sip' testsuite to list of testsuites

2018-03-26 Thread Harald Welte

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

Makefile: Add new 'sip' testsuite to list of testsuites

Change-Id: Ie7cc41a40fb8706e9b0752be6e7c1f34dc692d87
---
M Makefile
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/Makefile b/Makefile
index aeca0e1..fcd6601 100644
--- a/Makefile
+++ b/Makefile
@@ -1,4 +1,4 @@
-SUBDIRS=bsc bsc-nat bts ggsn_tests hlr lapdm mgw msc pcu selftest sgsn sysinfo
+SUBDIRS=bsc bsc-nat bts ggsn_tests hlr lapdm mgw msc pcu selftest sgsn sip 
sysinfo
 
 PARALLEL_MAKE ?= -j8
 

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

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