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

2018-03-23 Thread Holger Freyther

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

WIP.. see what is executed? Where is cdf_test

Change-Id: Ib9cd27c9d2628ad1d001ec57f6c80c3690df9a86
---
M selftest/Makefile
M selftest/all_tests.py
2 files changed, 11 insertions(+), 0 deletions(-)


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

diff --git a/selftest/Makefile b/selftest/Makefile
index f0c8c69..3290543 100644
--- a/selftest/Makefile
+++ b/selftest/Makefile
@@ -1,6 +1,8 @@
 .PHONY: check update
 
 check: set_pythonpath
+   echo "Fooo"
+   ls -la
./all_tests.py
 
 update:
diff --git a/selftest/all_tests.py b/selftest/all_tests.py
index 5c1ce59..ddf0a79 100755
--- a/selftest/all_tests.py
+++ b/selftest/all_tests.py
@@ -15,6 +15,15 @@
 help='Update test expecations instead of verifying them')
 args = parser.parse_args()
 
+print("F")
+print("F")
+print("F")
+print("F")
+print("F")
+print("F")
+print("F")
+print("F")
+
 def run_test(path):
 print(path)
 p = subprocess.Popen(path, stdout=subprocess.PIPE, stderr=subprocess.PIPE)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib9cd27c9d2628ad1d001ec57f6c80c3690df9a86
Gerrit-PatchSet: 1
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Holger Freyther 


osmo-msc[master]: gsm_04_08: Ensure we close the SCCP connection on errors

2018-03-23 Thread Neels Hofmeyr

Patch Set 1:

as discussed in https://gerrit.osmocom.org/6503 I think the proper fix would be 
me revisiting the subscr conn fsm and waterproof it against any of these 
leakages

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

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


osmo-gsm-tester[master]: ms: Create a cumulative distribution function class

2018-03-23 Thread Neels Hofmeyr

Patch Set 7: Code-Review+1

(2 comments)

I'm not sure I overlook the bigger picture, but do go ahead.

https://gerrit.osmocom.org/#/c/6230/3/src/osmo_ms_driver/__init__.py
File src/osmo_ms_driver/__init__.py:

Line 5: # Authors: D. Lazlo Sitzer 
> That's not how copyright works but you have an expert in your proximity but
Also, frankly, this is just a list of authors, the copyright is two lines 
further up.


https://gerrit.osmocom.org/#/c/6230/3/src/osmo_ms_driver/cdf.py
File src/osmo_ms_driver/cdf.py:

Line 29: y-axis we have the percentage (from 0.0 to 1.0) of how many
technically from 0..1 would not be a percentage as the word implies the 0..100 
range; more like a fraction or factor :)


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I9e3064f4c3c4c7af5d3491f850090516e541f4d3
Gerrit-PatchSet: 7
Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-Owner: Holger Freyther 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Holger Freyther 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-HasComments: Yes


osmo-bsc[master]: Provide ipaccess-config and bs11_config again

2018-03-23 Thread Neels Hofmeyr

Patch Set 2:

ah, here was another patch like this. dexter has since submitted 
https://gerrit.osmocom.org/7460 and https://gerrit.osmocom.org/7461 which we 
already merged. Those patches were considerably smaller -- are there remaining 
changes in here that we should keep?

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I4e7e503f1bc9d7401ccf21f1a619e1adb6c54b5e
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: lynxis lazus 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: lynxis lazus 
Gerrit-HasComments: No


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

2018-03-23 Thread Neels Hofmeyr

Patch Set 1: Code-Review-1

(1 comment)

approved, except the comment doesn't fit

https://gerrit.osmocom.org/#/c/7428/1/src/osmo-bsc/osmo_bsc_msc.c
File src/osmo-bsc/osmo_bsc_msc.c:

Line 56: * to 1 by default. */
sounds like rather osmo_bsc_filter.c should query the proper places for 
is_connected and is_authenticated flags. BTW, in osmo-bsc we don't really know 
"is_authenticated", we just know the MSC is carrying on with the connection. I 
accept that this is an issue independent from this patch, so maybe the comment 
should not be part of this patch, and, for lack of a proper fix, we should have 
a separate redmine issue on this.


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

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


libosmocore[master]: libosmogsm: add support for XOR authentication

2018-03-23 Thread Neels Hofmeyr

Patch Set 1:

+1 for using osmo_auth_c3() instead of code dup'ing.

SQN: in milenage, we mostly handle it as an integer value in a uint64_t, but 
see in milenage_gen_vec(), we use

  osmo_store64be_ext(next_sqn, sqn, 6);

Likely this should do the same here.

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

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


libosmocore[master]: libosmogsm: add support for XOR authentication

2018-03-23 Thread Neels Hofmeyr

Patch Set 1:

> (5 comments)
 > 
 > And in general, do we have any expected values, that
 > could be used to make basic test coverage?

In osmo-hlr, we have some tests based on the TS 55.205 test sets. Maybe you can 
find something similar for XOR? (then again, I guess XOR should be rather 
trivial, right?)

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

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


osmo-ci[master]: jobs: gerrit-osmo-ttcn3-hacks: Make deps before cleaning

2018-03-23 Thread Neels Hofmeyr

Patch Set 2: Code-Review-1

(1 comment)

https://gerrit.osmocom.org/#/c/7406/2/jobs/gerrit-verifications.yml
File jobs/gerrit-verifications.yml:

Line 192: make deps; make clean; make compile
> Maybe you want to chain them all with && instead of semicolons, to ensure t
I'd argue for

  make deps clean compile

or yet alternatively 'set -e' above.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I07fee78bba5b07c7f3f4359869e00ef2583e0769
Gerrit-PatchSet: 2
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-HasComments: Yes


osmo-ttcn3-hacks[master]: Move make artifacts to build subdir

2018-03-23 Thread Neels Hofmeyr

Patch Set 4: Code-Review-1

(5 comments)

I wish I had thought of this before I started with the .gitignore patches. I 
approve, just some details up for nitpick:

https://gerrit.osmocom.org/#/c/7405/4/bsc/regen_makefile.sh
File bsc/regen_makefile.sh:

Line 14: ln -s build/BSC_Tests ../BSC_Tests || true
My first reflex is to not want this around.
It is useful to be able to run older versions of osmo-ttcn3-hacks in the same 
docker-playground.
Maybe rather docker-playground can look for the binary in both places and use a 
build/* one if it exists?

(If we get rid of these links, we can also drop another .gitignore rule)


https://gerrit.osmocom.org/#/c/7405/4/gen_links.sh.inc
File gen_links.sh.inc:

Line 4: rm -f .gitignore
-1: drop (s.b.)


Line 11:echo "$f" >> .gitignore
-1: All .gitignore related stuff is now no longer needed, remove this. It was 
there to ignore exactly those files that were symlinked, now we can just ignore 
the entire build/ dir instead.


Line 17:DSTDIR=$1
-0: it's always "./build/", isn't it? The patch would be a lot smaller if we 
just did "./build/$f" below. You could even define a DSTDIR="./build" default 
above, and the including script could override that, if it would ever be 
necessary.


https://gerrit.osmocom.org/#/c/7405/4/sgsn/regen_makefile.sh
File sgsn/regen_makefile.sh:

Line 14: ln -s build/SGSN_Tests ../SGSN_Tests || true
> We are in $BASE/sgsn/build directory, because we do "cd build" in line 3 in
Yes, it's correct, but I still think it would be nice to have only one place 
for the binary and outsource the "build/" path element to docker-playground.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Id9ca176869ce6b80ccf2b2fff6554b121e1aa85c
Gerrit-PatchSet: 4
Gerrit-Project: osmo-ttcn3-hacks
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


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

2018-03-23 Thread Neels Hofmeyr

Patch Set 1: Code-Review+1

(1 comment)

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

Line 197:   memcpy(&newbfd->list, &bfd->list, 
sizeof(newbfd->list));
why not just

  newbfd->list = bdf->list;


-- 
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-HasComments: Yes


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

2018-03-23 Thread Neels Hofmeyr

Patch Set 1: Code-Review+1

(8 comments)

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

Line 10: file relase from OCTSDR-2G-02.10.00-B1837-ALPHA as there are
it's almost like "relase" should be an actual word, sounds like "re-heat with a 
laser"


Line 22: Patch by Octasic inc.
There's a tag convention:

  Patch-by: Name

(to join Change-Id: and Related: below)


https://gerrit.osmocom.org/#/c/7487/1/configure.ac
File configure.ac:

Line 154: 
was this moved? commit log talks only of "Add"


Line 219:   
AC_DEFINE([OCTPHY_USE_CLOCK_SYNC_MGR_STATS_SYNC_LOSSE_CNT],
really "LOSSE"? :)


Line 225:   
AC_CHECK_MEMBER([tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP.ulSyncLossCnt],
(ah here it is from above)


https://gerrit.osmocom.org/#/c/7487/1/src/osmo-bts-octphy/octphy_hw_api.c
File src/osmo-bts-octphy/octphy_hw_api.c:

Line 295:   (tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_INFO_RSP *) resp->l2h;
omit this whitespace change? (same below)


Line 381:   get_cb_data = (struct octphy_hw_get_cb_data *)data;
different kind of whitespace change


https://gerrit.osmocom.org/#/c/7487/1/src/osmo-bts-octphy/octphy_vty.c
File src/osmo-bts-octphy/octphy_vty.c:

Line 265:   struct vty *vty = (struct vty *)data;
ws


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ic38d8dc35522205c4ffab583b4e61b5ef03cdba2
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-HasComments: Yes


libosmocore[master]: VTY: Don't welcome the user to the "control" interface, if i...

2018-03-23 Thread Neels Hofmeyr

Patch Set 1: Code-Review+2

lol

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

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


osmo-sip-connector[master]: comments

2018-03-23 Thread Neels Hofmeyr

Patch Set 1: Code-Review+1

(2 comments)

https://gerrit.osmocom.org/#/c/7489/1/src/mncc.c
File src/mncc.c:

Line 150: /* Send a MNCC_RTP_CONNET to the MSC for the given call legs */
"CONNECT"


Line 463:  *  \param conn MNCC socket/connection
(I don't mind much, but at some point I think we argued for 'param[in,out]' or 
'param[inout]'?)


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

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


osmo-sip-connector[master]: mncc: use 'const' to denote read-only input buffer/message

2018-03-23 Thread Neels Hofmeyr

Patch Set 1: Code-Review+2

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

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


osmo-sip-connector[master]: Call the program "OsmoSIPcon" (also in vty)

2018-03-23 Thread Neels Hofmeyr

Patch Set 1:

I'd have thought OsmoSIPconn or strictly OsmoSIPConn (like OsmoGSMTester)

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

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


[PATCH] osmo-sip-connector[master]: Call the program "OsmoSIPcon" (also in vty)

2018-03-23 Thread Harald Welte

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

Call the program "OsmoSIPcon" (also in vty)

It's confusing to access the telnet interface and then see a prompt
that's not like the program name

Change-Id: Iba20c1c90e528d08bd362be39d86317569c253e6
---
M src/main.c
M src/vty.c
2 files changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector 
refs/changes/91/7491/1

diff --git a/src/main.c b/src/main.c
index 89706e3..558eaec 100644
--- a/src/main.c
+++ b/src/main.c
@@ -78,7 +78,7 @@
 
 static void print_help(void)
 {
-   printf("Osmo MNCC to SIP bridge\n");
+   printf("OsmoSIPcon: MNCC to SIP bridge\n");
printf("  -h --hekp\tthis text\n");
printf("  -c --config-file NAME\tThe config file to use [%s]\n", 
config_file);
 }
diff --git a/src/vty.c b/src/vty.c
index f3d9467..bea1f9f 100644
--- a/src/vty.c
+++ b/src/vty.c
@@ -51,7 +51,7 @@
 };
 
 static struct vty_app_info vty_info = {
-   .name   = "OsmoMNCC",
+   .name   = "OsmoSIPcon",
.version= PACKAGE_VERSION,
.go_parent_cb   = mncc_vty_go_parent,
.is_config_node = mncc_vty_is_config_node,

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Iba20c1c90e528d08bd362be39d86317569c253e6
Gerrit-PatchSet: 1
Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


[PATCH] osmo-sip-connector[master]: mncc: use 'const' to denote read-only input buffer/message

2018-03-23 Thread Harald Welte

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

mncc: use 'const' to denote read-only input buffer/message

We normally use the 'const' modifier whenever using read-only input
data, let's do so in the mncc parser/handler, too.

Change-Id: Ide24feb536c04fe7ef08c62b4498fdd95605b58c
---
M src/mncc.c
1 file changed, 37 insertions(+), 37 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector 
refs/changes/90/7490/1

diff --git a/src/mncc.c b/src/mncc.c
index 66c73a3..c0c082b 100644
--- a/src/mncc.c
+++ b/src/mncc.c
@@ -319,9 +319,9 @@
return continue_mt_call(leg);
 }
 
-static void check_rtp_connect(struct mncc_connection *conn, char *buf, int rc)
+static void check_rtp_connect(struct mncc_connection *conn, const char *buf, 
int rc)
 {
-   struct gsm_mncc_rtp *rtp;
+   const struct gsm_mncc_rtp *rtp;
struct mncc_call_leg *leg;
struct call_leg *other_leg;
 
@@ -331,7 +331,7 @@
return close_connection(conn);
}
 
-   rtp = (struct gsm_mncc_rtp *) buf;
+   rtp = (const struct gsm_mncc_rtp *) buf;
leg = mncc_find_leg(rtp->callref);
if (!leg) {
LOGP(DMNCC, LOGL_ERROR, "leg(%u) can not be found\n", 
rtp->callref);
@@ -350,9 +350,9 @@
leg->base.release_call(&leg->base);
 }
 
-static void check_rtp_create(struct mncc_connection *conn, char *buf, int rc)
+static void check_rtp_create(struct mncc_connection *conn, const char *buf, 
int rc)
 {
-   struct gsm_mncc_rtp *rtp;
+   const struct gsm_mncc_rtp *rtp;
struct mncc_call_leg *leg;
 
if (rc < sizeof(*rtp)) {
@@ -361,7 +361,7 @@
return close_connection(conn);
}
 
-   rtp = (struct gsm_mncc_rtp *) buf;
+   rtp = (const struct gsm_mncc_rtp *) buf;
leg = mncc_find_leg(rtp->callref);
if (!leg) {
LOGP(DMNCC, LOGL_ERROR, "call(%u) can not be found\n", 
rtp->callref);
@@ -383,7 +383,7 @@
continue_call(leg);
 }
 
-static int continue_setup(struct mncc_connection *conn, struct gsm_mncc *mncc)
+static int continue_setup(struct mncc_connection *conn, const struct gsm_mncc 
*mncc)
 {
if (mncc->called.plan != GSM340_PLAN_ISDN) {
LOGP(DMNCC, LOGL_ERROR,
@@ -396,9 +396,9 @@
 }
 
 /* Check + Process MNCC_SETUP_IND (MO call) */
-static void check_setup(struct mncc_connection *conn, char *buf, int rc)
+static void check_setup(struct mncc_connection *conn, const char *buf, int rc)
 {
-   struct gsm_mncc *data;
+   const struct gsm_mncc *data;
struct call *call;
struct mncc_call_leg *leg;
 
@@ -408,7 +408,7 @@
return close_connection(conn);
}
 
-   data = (struct gsm_mncc *) buf;
+   data = (const struct gsm_mncc *) buf;
 
/* screen arguments */
if ((data->fields & MNCC_F_CALLED) == 0) {
@@ -466,7 +466,7 @@
  *  \param[out] mncc return pointer to MNCC message
  *  \returns call leg (if found) or NULL */
 static struct mncc_call_leg *find_leg(struct mncc_connection *conn,
-   char *buf, int rc, struct gsm_mncc 
**mncc)
+   const char *buf, int rc, const struct 
gsm_mncc **mncc)
 {
struct mncc_call_leg *leg;
 
@@ -477,7 +477,7 @@
return NULL;
}
 
-   *mncc = (struct gsm_mncc *) buf;
+   *mncc = (const struct gsm_mncc *) buf;
leg = mncc_find_leg((*mncc)->callref);
if (!leg) {
LOGP(DMNCC, LOGL_ERROR, "call(%u) can not be found\n", 
(*mncc)->callref);
@@ -487,9 +487,9 @@
return leg;
 }
 
-static void check_disc_ind(struct mncc_connection *conn, char *buf, int rc)
+static void check_disc_ind(struct mncc_connection *conn, const char *buf, int 
rc)
 {
-   struct gsm_mncc *data;
+   const struct gsm_mncc *data;
struct mncc_call_leg *leg;
struct call_leg *other_leg;
 
@@ -508,9 +508,9 @@
other_leg->release_call(other_leg);
 }
 
-static void check_rel_ind(struct mncc_connection *conn, char *buf, int rc)
+static void check_rel_ind(struct mncc_connection *conn, const char *buf, int 
rc)
 {
-   struct gsm_mncc *data;
+   const struct gsm_mncc *data;
struct mncc_call_leg *leg;
 
leg = find_leg(conn, buf, rc, &data);
@@ -529,9 +529,9 @@
mncc_leg_release(leg);
 }
 
-static void check_rel_cnf(struct mncc_connection *conn, char *buf, int rc)
+static void check_rel_cnf(struct mncc_connection *conn, const char *buf, int 
rc)
 {
-   struct gsm_mncc *data;
+   const struct gsm_mncc *data;
struct mncc_call_leg *leg;
 
leg = find_leg(conn, buf, rc, &data);
@@ -543,9 +543,9 @@
mncc_leg_release(leg);
 }
 
-static void check_stp_cmpl_ind(struct mncc_connection *conn, char *buf, int rc)
+static void check_stp_cmpl_ind(struct mncc_connection *conn, const char *buf, 
int rc)
 {
-   struct gsm_mncc *data;
+   const struct gsm_mncc *data;
struct mn

[PATCH] osmo-sip-connector[master]: comments

2018-03-23 Thread Harald Welte

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

comments

Change-Id: Icf0e9211a4e93eb1b05b5a5d68f9ba766982da8d
---
M src/mncc.c
1 file changed, 14 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-sip-connector 
refs/changes/89/7489/1

diff --git a/src/mncc.c b/src/mncc.c
index 45c062f..66c73a3 100644
--- a/src/mncc.c
+++ b/src/mncc.c
@@ -82,6 +82,7 @@
osmo_timer_del(&leg->cmd_timeout);
 }
 
+/* Find a MNCC Call leg (whether MO or MT) by given callref */
 static struct mncc_call_leg *mncc_find_leg(uint32_t callref)
 {
struct call *call;
@@ -146,6 +147,7 @@
}
 }
 
+/* Send a MNCC_RTP_CONNET to the MSC for the given call legs */
 static bool send_rtp_connect(struct mncc_call_leg *leg, struct call_leg *other)
 {
struct gsm_mncc_rtp mncc = { 0, };
@@ -174,6 +176,7 @@
return true;
 }
 
+/* CONNECT call-back for MNCC call leg */
 static void mncc_call_leg_connect(struct call_leg *_leg)
 {
struct mncc_call_leg *leg;
@@ -192,6 +195,7 @@
mncc_send(leg->conn, MNCC_SETUP_RSP, leg->callref);
 }
 
+/* RING call-back for MNCC call leg */
 static void mncc_call_leg_ring(struct call_leg *_leg)
 {
struct gsm_mncc out_mncc = { 0, };
@@ -219,6 +223,7 @@
send_rtp_connect(leg, other_leg);
 }
 
+/* RELEASE call-back for MNCC call leg */
 static void mncc_call_leg_release(struct call_leg *_leg)
 {
struct mncc_call_leg *leg;
@@ -262,6 +267,7 @@
}
 }
 
+/* Close the MNCC connection/socket */
 static void close_connection(struct mncc_connection *conn)
 {
osmo_fd_unregister(&conn->fd);
@@ -389,6 +395,7 @@
return 1;
 }
 
+/* Check + Process MNCC_SETUP_IND (MO call) */
 static void check_setup(struct mncc_connection *conn, char *buf, int rc)
 {
struct gsm_mncc *data;
@@ -452,6 +459,12 @@
mncc_rtp_send(conn, MNCC_RTP_CREATE, data->callref);
 }
 
+/*! Find MNCC Call leg by given MNCC message
+ *  \param conn MNCC socket/connection
+ *  \param[in] buf buffer containing MNCC message
+ *  \param[in] rc length of message in \a buf
+ *  \param[out] mncc return pointer to MNCC message
+ *  \returns call leg (if found) or NULL */
 static struct mncc_call_leg *find_leg(struct mncc_connection *conn,
char *buf, int rc, struct gsm_mncc 
**mncc)
 {
@@ -787,6 +800,7 @@
conn->state = MNCC_WAIT_VERSION;
 }
 
+/* osmo-fd read call-back for MNCC socket: read MNCC message + dispatch it */
 static int mncc_data(struct osmo_fd *fd, unsigned int what)
 {
char buf[4096];

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icf0e9211a4e93eb1b05b5a5d68f9ba766982da8d
Gerrit-PatchSet: 1
Gerrit-Project: osmo-sip-connector
Gerrit-Branch: master
Gerrit-Owner: Harald Welte 


[PATCH] libosmocore[master]: VTY: Don't welcome the user to the "control" interface, if i...

2018-03-23 Thread Harald Welte

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

VTY: Don't welcome the user to the "control" interface, if it's VTY

This is quite confusing, I'm surprised that it has not been flagged
before...

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


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/88/7488/1

diff --git a/src/vty/vty.c b/src/vty/vty.c
index e741a66..08258e7 100644
--- a/src/vty/vty.c
+++ b/src/vty/vty.c
@@ -362,7 +362,7 @@
if (host.app_info->name)
app_name = host.app_info->name;
 
-   vty_out(vty, "Welcome to the %s control interface%s%s",
+   vty_out(vty, "Welcome to the %s VTY interface%s%s",
app_name, VTY_NEWLINE, VTY_NEWLINE);
 
if (host.app_info->copyright)

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

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


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

2018-03-23 Thread dexter

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

octphy: integrate octasics latest header release

At the moment osmo-bts does not compile with the latest header
file relase 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.

Patch by Octasic inc.

Change-Id: Ic38d8dc35522205c4ffab583b4e61b5ef03cdba2
Related: SYS#4139
---
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, 189 insertions(+), 29 deletions(-)


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

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 tOCTVC1_HW_MSG_CLOCK_SYNC_MGR_STATS_RSP]),
+   [],
+   [#include ])
+
+   AC_CHECK_MEMBER([tOCTVC1_HW_MSG_CL

[PATCH] osmo-bts[master]: cosmetic: remove unused variable in osmo-bts-omldummy/main.c

2018-03-23 Thread dexter
Hello Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/7482

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

cosmetic: remove unused variable in osmo-bts-omldummy/main.c

Change-Id: I85d8c77589eae511f47b8b9b7439a2c47fe350d8
---
M src/osmo-bts-omldummy/main.c
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/src/osmo-bts-omldummy/main.c b/src/osmo-bts-omldummy/main.c
index b9334b1..39f2ac2 100644
--- a/src/osmo-bts-omldummy/main.c
+++ b/src/osmo-bts-omldummy/main.c
@@ -11,7 +11,7 @@
struct gsm_bts *bts;
struct gsm_bts_trx *trx;
struct e1inp_line *line;
-   int rc, i;
+   int i;
 
char *dst_host = argv[1];
int site_id = atoi(argv[2]);

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

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


[PATCH] osmo-bts[master]: cosmetic: remove unused variable

2018-03-23 Thread dexter
Hello Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/7481

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

cosmetic: remove unused variable

Change-Id: Icbec00ec63950b785dcb71e3b9d70541e70be536
---
M src/osmo-bts-octphy/l1_if.c
1 file changed, 0 insertions(+), 1 deletion(-)


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

diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c
index 0d63d51..f178029 100644
--- a/src/osmo-bts-octphy/l1_if.c
+++ b/src/osmo-bts-octphy/l1_if.c
@@ -1162,7 +1162,6 @@
struct msgb *l1p_msg)
 {
struct gsm_bts_trx *trx = trx_by_l1h(fl1, ra_ind->TrxId.byTrxId);
-   struct gsm_bts *bts = trx->bts;
struct osmo_phsap_prim *l1sap;
int rc;
struct ph_rach_ind_param rach_ind_param;

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

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


[MERGED] osmo-bts[master]: cosmetic: remove dead code

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

Change subject: cosmetic: remove dead code
..


cosmetic: remove dead code

Patch by Octasic inc.

Change-Id: I40ff0b95349308693bec5f4ae56ec7f2f14202e5
---
M src/osmo-bts-octphy/octphy_hw_api.c
1 file changed, 0 insertions(+), 8 deletions(-)

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



diff --git a/src/osmo-bts-octphy/octphy_hw_api.c 
b/src/osmo-bts-octphy/octphy_hw_api.c
index 7b988fe..91b84de 100644
--- a/src/osmo-bts-octphy/octphy_hw_api.c
+++ b/src/osmo-bts-octphy/octphy_hw_api.c
@@ -285,14 +285,6 @@
{ 0, NULL }
 };
 
-static const struct value_string clocksync_source_state_vals[] = {
-   { cOCTVC1_HW_CLOCK_SYNC_MGR_SOURCE_STATE_ENUM_INVALID, "Invalid" },
-   { cOCTVC1_HW_CLOCK_SYNC_MGR_SOURCE_STATE_ENUM_VALID, "Valid" },
-   { cOCTVC1_HW_CLOCK_SYNC_MGR_SOURCE_STATE_ENUM_UNSPECIFIED,
-   "Unspecified" },
-   { 0, NULL }
-};
-
 /* Chapter 12.15 */
 static int get_clock_sync_compl_cb(struct octphy_hdl *fl1, struct msgb *resp,
   void *data)

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

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


osmo-bts[master]: cosmetic: remove dead code

2018-03-23 Thread Harald Welte

Patch Set 2: Code-Review+2

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

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


meta-telephony[laforge/nightly]: osmo-bsc: Split meas-utils into its own package

2018-03-23 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia6b33dbdf882394fa14270c34306dccf46b724e4
Gerrit-PatchSet: 1
Gerrit-Project: meta-telephony
Gerrit-Branch: laforge/nightly
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: No


[MERGED] meta-telephony[laforge/nightly]: osmo-bsc: Split bs11-utils into its own package

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

Change subject: osmo-bsc: Split bs11-utils into its own package
..


osmo-bsc: Split bs11-utils into its own package

Change-Id: I9dfa9489af56a4c580a63906e950568849333c2b
---
M recipes-osmocom/osmo-bsc/osmo-bsc.inc
1 file changed, 6 insertions(+), 1 deletion(-)

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



diff --git a/recipes-osmocom/osmo-bsc/osmo-bsc.inc 
b/recipes-osmocom/osmo-bsc/osmo-bsc.inc
index 820baf5..9fa1764 100644
--- a/recipes-osmocom/osmo-bsc/osmo-bsc.inc
+++ b/recipes-osmocom/osmo-bsc/osmo-bsc.inc
@@ -19,12 +19,17 @@
install -m 0644 ${S}/contrib/systemd/osmo-bsc.service 
${D}${systemd_system_unitdir}/
 }
 
-PACKAGES =+ "osmo-bsc-nat-doc osmo-bsc-nat ipaccess-utils"
+PACKAGES =+ "osmo-bsc-nat-doc osmo-bsc-nat ipaccess-utils bs11-utils"
 SYSTEMD_PACKAGES = "osmo-bsc"
 SYSTEMD_SERVICE_osmo-bsc = "osmo-bsc.service"
 
 CONFFILES_osmo-bsc = "${sysconfdir}/osmocom/osmo-bsc.cfg"
 
+FILES_bs11-utils = " \
+   ${bindir}/bs11_config \
+   ${bindir}/isdnsync \
+   "
+
 FILES_ipaccess-utils = " \
${bindir}/ipaccess-find \
${bindir}/ipaccess-config \

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9dfa9489af56a4c580a63906e950568849333c2b
Gerrit-PatchSet: 1
Gerrit-Project: meta-telephony
Gerrit-Branch: laforge/nightly
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Pau Espin Pedrol 


[MERGED] meta-telephony[laforge/nightly]: osmo-bsc: Split abisip-find into its own package

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

Change subject: osmo-bsc: Split abisip-find into its own package
..


osmo-bsc: Split abisip-find into its own package

Change-Id: I9de9b676502370c2dcd0fb9d54b25884d4110af5
---
M recipes-osmocom/osmo-bsc/osmo-bsc.inc
1 file changed, 3 insertions(+), 1 deletion(-)

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



diff --git a/recipes-osmocom/osmo-bsc/osmo-bsc.inc 
b/recipes-osmocom/osmo-bsc/osmo-bsc.inc
index 9fa1764..d25322b 100644
--- a/recipes-osmocom/osmo-bsc/osmo-bsc.inc
+++ b/recipes-osmocom/osmo-bsc/osmo-bsc.inc
@@ -19,12 +19,14 @@
install -m 0644 ${S}/contrib/systemd/osmo-bsc.service 
${D}${systemd_system_unitdir}/
 }
 
-PACKAGES =+ "osmo-bsc-nat-doc osmo-bsc-nat ipaccess-utils bs11-utils"
+PACKAGES =+ "osmo-bsc-nat-doc osmo-bsc-nat ipaccess-utils bs11-utils 
abisip-find"
 SYSTEMD_PACKAGES = "osmo-bsc"
 SYSTEMD_SERVICE_osmo-bsc = "osmo-bsc.service"
 
 CONFFILES_osmo-bsc = "${sysconfdir}/osmocom/osmo-bsc.cfg"
 
+FILES_abisip-find = "${bindir}/abisip-find"
+
 FILES_bs11-utils = " \
${bindir}/bs11_config \
${bindir}/isdnsync \

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I9de9b676502370c2dcd0fb9d54b25884d4110af5
Gerrit-PatchSet: 1
Gerrit-Project: meta-telephony
Gerrit-Branch: laforge/nightly
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Pau Espin Pedrol 


[MERGED] meta-telephony[laforge/nightly]: osmo-bsc: Split meas-utils into its own package

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

Change subject: osmo-bsc: Split meas-utils into its own package
..


osmo-bsc: Split meas-utils into its own package

Additionally, libpcap dependency is added to have osmo-meas-pcap2db
available.

Change-Id: Ia6b33dbdf882394fa14270c34306dccf46b724e4
---
M recipes-osmocom/osmo-bsc/osmo-bsc.inc
1 file changed, 8 insertions(+), 2 deletions(-)

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



diff --git a/recipes-osmocom/osmo-bsc/osmo-bsc.inc 
b/recipes-osmocom/osmo-bsc/osmo-bsc.inc
index d25322b..d14fdd2 100644
--- a/recipes-osmocom/osmo-bsc/osmo-bsc.inc
+++ b/recipes-osmocom/osmo-bsc/osmo-bsc.inc
@@ -3,7 +3,7 @@
 LICENSE = "AGPLv3"
 LIC_FILES_CHKSUM = "file://COPYING;md5=73f1eb20517c55bf9493b7dd6e480788"
 
-DEPENDS = "sqlite3 libosmocore libosmo-abis libosmo-sccp libosmo-netif 
osmo-mgw"
+DEPENDS = "sqlite3 libpcap libosmocore libosmo-abis libosmo-sccp libosmo-netif 
osmo-mgw"
 
 INC_PR="r1.${META_TELEPHONY_OSMO_INC}"
 
@@ -19,7 +19,7 @@
install -m 0644 ${S}/contrib/systemd/osmo-bsc.service 
${D}${systemd_system_unitdir}/
 }
 
-PACKAGES =+ "osmo-bsc-nat-doc osmo-bsc-nat ipaccess-utils bs11-utils 
abisip-find"
+PACKAGES =+ "osmo-bsc-nat-doc osmo-bsc-nat meas-utils ipaccess-utils 
bs11-utils abisip-find"
 SYSTEMD_PACKAGES = "osmo-bsc"
 SYSTEMD_SERVICE_osmo-bsc = "osmo-bsc.service"
 
@@ -38,6 +38,12 @@
${bindir}/ipaccess-proxy \
"
 
+FILES_meas-utils = " \
+   ${bindir}/osmo-meas-udp2db \
+   ${bindir}/osmo-meas-pcap2db \
+   ${bindir}/meas_json \
+   "
+
 FILES_osmo-bsc-nat = " \
${bindir}/osmo-bsc_nat \
${sysconfdir}/osmocom/osmo-bsc_nat.cfg \

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

Gerrit-MessageType: merged
Gerrit-Change-Id: Ia6b33dbdf882394fa14270c34306dccf46b724e4
Gerrit-PatchSet: 1
Gerrit-Project: meta-telephony
Gerrit-Branch: laforge/nightly
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Pau Espin Pedrol 


meta-telephony[laforge/nightly]: osmo-bsc: Split bs11-utils into its own package

2018-03-23 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I9dfa9489af56a4c580a63906e950568849333c2b
Gerrit-PatchSet: 1
Gerrit-Project: meta-telephony
Gerrit-Branch: laforge/nightly
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: No


meta-telephony[laforge/nightly]: osmo-bsc: Split abisip-find into its own package

2018-03-23 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I9de9b676502370c2dcd0fb9d54b25884d4110af5
Gerrit-PatchSet: 1
Gerrit-Project: meta-telephony
Gerrit-Branch: laforge/nightly
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: No


meta-telephony[laforge/nightly]: osmo-bsc: Split meas-utils into its own package

2018-03-23 Thread Pau Espin Pedrol

Patch Set 1: Verified+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ia6b33dbdf882394fa14270c34306dccf46b724e4
Gerrit-PatchSet: 1
Gerrit-Project: meta-telephony
Gerrit-Branch: laforge/nightly
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: No


[PATCH] meta-telephony[laforge/nightly]: osmo-bsc: Split meas-utils into its own package

2018-03-23 Thread Pau Espin Pedrol

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

osmo-bsc: Split meas-utils into its own package

Additionally, libpcap dependency is added to have osmo-meas-pcap2db
available.

Change-Id: Ia6b33dbdf882394fa14270c34306dccf46b724e4
---
M recipes-osmocom/osmo-bsc/osmo-bsc.inc
1 file changed, 8 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/86/7486/1

diff --git a/recipes-osmocom/osmo-bsc/osmo-bsc.inc 
b/recipes-osmocom/osmo-bsc/osmo-bsc.inc
index d25322b..d14fdd2 100644
--- a/recipes-osmocom/osmo-bsc/osmo-bsc.inc
+++ b/recipes-osmocom/osmo-bsc/osmo-bsc.inc
@@ -3,7 +3,7 @@
 LICENSE = "AGPLv3"
 LIC_FILES_CHKSUM = "file://COPYING;md5=73f1eb20517c55bf9493b7dd6e480788"
 
-DEPENDS = "sqlite3 libosmocore libosmo-abis libosmo-sccp libosmo-netif 
osmo-mgw"
+DEPENDS = "sqlite3 libpcap libosmocore libosmo-abis libosmo-sccp libosmo-netif 
osmo-mgw"
 
 INC_PR="r1.${META_TELEPHONY_OSMO_INC}"
 
@@ -19,7 +19,7 @@
install -m 0644 ${S}/contrib/systemd/osmo-bsc.service 
${D}${systemd_system_unitdir}/
 }
 
-PACKAGES =+ "osmo-bsc-nat-doc osmo-bsc-nat ipaccess-utils bs11-utils 
abisip-find"
+PACKAGES =+ "osmo-bsc-nat-doc osmo-bsc-nat meas-utils ipaccess-utils 
bs11-utils abisip-find"
 SYSTEMD_PACKAGES = "osmo-bsc"
 SYSTEMD_SERVICE_osmo-bsc = "osmo-bsc.service"
 
@@ -38,6 +38,12 @@
${bindir}/ipaccess-proxy \
"
 
+FILES_meas-utils = " \
+   ${bindir}/osmo-meas-udp2db \
+   ${bindir}/osmo-meas-pcap2db \
+   ${bindir}/meas_json \
+   "
+
 FILES_osmo-bsc-nat = " \
${bindir}/osmo-bsc_nat \
${sysconfdir}/osmocom/osmo-bsc_nat.cfg \

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ia6b33dbdf882394fa14270c34306dccf46b724e4
Gerrit-PatchSet: 1
Gerrit-Project: meta-telephony
Gerrit-Branch: laforge/nightly
Gerrit-Owner: Pau Espin Pedrol 


meta-telephony[laforge/nightly]: osmo-bsc: Split abisip-find into its own package

2018-03-23 Thread Pau Espin Pedrol

Patch Set 1: Verified+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I9de9b676502370c2dcd0fb9d54b25884d4110af5
Gerrit-PatchSet: 1
Gerrit-Project: meta-telephony
Gerrit-Branch: laforge/nightly
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: No


[PATCH] meta-telephony[laforge/nightly]: osmo-bsc: Split bs11-utils into its own package

2018-03-23 Thread Pau Espin Pedrol

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

osmo-bsc: Split bs11-utils into its own package

Change-Id: I9dfa9489af56a4c580a63906e950568849333c2b
---
M recipes-osmocom/osmo-bsc/osmo-bsc.inc
1 file changed, 6 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/84/7484/1

diff --git a/recipes-osmocom/osmo-bsc/osmo-bsc.inc 
b/recipes-osmocom/osmo-bsc/osmo-bsc.inc
index 820baf5..9fa1764 100644
--- a/recipes-osmocom/osmo-bsc/osmo-bsc.inc
+++ b/recipes-osmocom/osmo-bsc/osmo-bsc.inc
@@ -19,12 +19,17 @@
install -m 0644 ${S}/contrib/systemd/osmo-bsc.service 
${D}${systemd_system_unitdir}/
 }
 
-PACKAGES =+ "osmo-bsc-nat-doc osmo-bsc-nat ipaccess-utils"
+PACKAGES =+ "osmo-bsc-nat-doc osmo-bsc-nat ipaccess-utils bs11-utils"
 SYSTEMD_PACKAGES = "osmo-bsc"
 SYSTEMD_SERVICE_osmo-bsc = "osmo-bsc.service"
 
 CONFFILES_osmo-bsc = "${sysconfdir}/osmocom/osmo-bsc.cfg"
 
+FILES_bs11-utils = " \
+   ${bindir}/bs11_config \
+   ${bindir}/isdnsync \
+   "
+
 FILES_ipaccess-utils = " \
${bindir}/ipaccess-find \
${bindir}/ipaccess-config \

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9dfa9489af56a4c580a63906e950568849333c2b
Gerrit-PatchSet: 1
Gerrit-Project: meta-telephony
Gerrit-Branch: laforge/nightly
Gerrit-Owner: Pau Espin Pedrol 


meta-telephony[laforge/nightly]: osmo-bsc: Split bs11-utils into its own package

2018-03-23 Thread Pau Espin Pedrol

Patch Set 1: Verified+1

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I9dfa9489af56a4c580a63906e950568849333c2b
Gerrit-PatchSet: 1
Gerrit-Project: meta-telephony
Gerrit-Branch: laforge/nightly
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-HasComments: No


[PATCH] meta-telephony[laforge/nightly]: osmo-bsc: Split abisip-find into its own package

2018-03-23 Thread Pau Espin Pedrol

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

osmo-bsc: Split abisip-find into its own package

Change-Id: I9de9b676502370c2dcd0fb9d54b25884d4110af5
---
M recipes-osmocom/osmo-bsc/osmo-bsc.inc
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/meta-telephony refs/changes/85/7485/1

diff --git a/recipes-osmocom/osmo-bsc/osmo-bsc.inc 
b/recipes-osmocom/osmo-bsc/osmo-bsc.inc
index 9fa1764..d25322b 100644
--- a/recipes-osmocom/osmo-bsc/osmo-bsc.inc
+++ b/recipes-osmocom/osmo-bsc/osmo-bsc.inc
@@ -19,12 +19,14 @@
install -m 0644 ${S}/contrib/systemd/osmo-bsc.service 
${D}${systemd_system_unitdir}/
 }
 
-PACKAGES =+ "osmo-bsc-nat-doc osmo-bsc-nat ipaccess-utils bs11-utils"
+PACKAGES =+ "osmo-bsc-nat-doc osmo-bsc-nat ipaccess-utils bs11-utils 
abisip-find"
 SYSTEMD_PACKAGES = "osmo-bsc"
 SYSTEMD_SERVICE_osmo-bsc = "osmo-bsc.service"
 
 CONFFILES_osmo-bsc = "${sysconfdir}/osmocom/osmo-bsc.cfg"
 
+FILES_abisip-find = "${bindir}/abisip-find"
+
 FILES_bs11-utils = " \
${bindir}/bs11_config \
${bindir}/isdnsync \

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I9de9b676502370c2dcd0fb9d54b25884d4110af5
Gerrit-PatchSet: 1
Gerrit-Project: meta-telephony
Gerrit-Branch: laforge/nightly
Gerrit-Owner: Pau Espin Pedrol 


osmo-bsc[master]: debian: Move meas related binaries into new package osmo-bsc...

2018-03-23 Thread Pau Espin Pedrol

Patch Set 1: Code-Review-1

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

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


osmo-bts[master]: cosmetic: remove dead code

2018-03-23 Thread dexter

Patch Set 2:

> the fact we're not using this most likely is a sign that we are
 > never logging/vty-printing an important value that we should

It was probably never used. Octasic also removed it from its latest header 
release.

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

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


osmo-bsc[master]: debian: Move meas related binaries into new package osmo-bsc...

2018-03-23 Thread Pau Espin Pedrol

Patch Set 1:

I didn't test to build the debian package as I don't have the setup in my 
archlinux to do so. If somebody can take the opportunity before merging it 
would be great. Also, I'm not sure how to handle the conditionally built 
binaries.

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

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


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

2018-03-23 Thread dexter
Hello Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/7480

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

cosmetic: remove dead code

Patch by Octasic inc.

Change-Id: I40ff0b95349308693bec5f4ae56ec7f2f14202e5
---
M src/osmo-bts-octphy/octphy_hw_api.c
1 file changed, 0 insertions(+), 8 deletions(-)


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

diff --git a/src/osmo-bts-octphy/octphy_hw_api.c 
b/src/osmo-bts-octphy/octphy_hw_api.c
index 7b988fe..91b84de 100644
--- a/src/osmo-bts-octphy/octphy_hw_api.c
+++ b/src/osmo-bts-octphy/octphy_hw_api.c
@@ -285,14 +285,6 @@
{ 0, NULL }
 };
 
-static const struct value_string clocksync_source_state_vals[] = {
-   { cOCTVC1_HW_CLOCK_SYNC_MGR_SOURCE_STATE_ENUM_INVALID, "Invalid" },
-   { cOCTVC1_HW_CLOCK_SYNC_MGR_SOURCE_STATE_ENUM_VALID, "Valid" },
-   { cOCTVC1_HW_CLOCK_SYNC_MGR_SOURCE_STATE_ENUM_UNSPECIFIED,
-   "Unspecified" },
-   { 0, NULL }
-};
-
 /* Chapter 12.15 */
 static int get_clock_sync_compl_cb(struct octphy_hdl *fl1, struct msgb *resp,
   void *data)

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

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


[PATCH] osmo-bsc[master]: debian: Move meas related binaries into new package osmo-bsc...

2018-03-23 Thread Pau Espin Pedrol

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

debian: Move meas related binaries into new package osmo-bsc-meas-utils

Only meas_json is added so far, since the other related ones are
conditionally built.

Change-Id: I35ba3c19fcdfb5663691a67c9876537765963c5d
---
M debian/control
A debian/osmo-bsc-meas-utils.install
2 files changed, 7 insertions(+), 0 deletions(-)


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

diff --git a/debian/control b/debian/control
index c2627a1..c0ee002 100644
--- a/debian/control
+++ b/debian/control
@@ -58,3 +58,9 @@
  There is a tool in this package for configuring the Siemens BS-11 BTS.
  Additionally, it contains one tool for making use of an ISDN-card and the
  public telephone network as frequency standard for the E1 line.
+
+Package: osmo-bsc-meas-utils
+Architecture: any
+Multi-Arch: foreign
+Depends: ${misc:Depends}, ${shlibs:Depends}
+Description: Command line utilities to manage measurement reports.
diff --git a/debian/osmo-bsc-meas-utils.install 
b/debian/osmo-bsc-meas-utils.install
new file mode 100644
index 000..d8fb318
--- /dev/null
+++ b/debian/osmo-bsc-meas-utils.install
@@ -0,0 +1 @@
+usr/bin/meas_json

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

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


osmo-bts[master]: cosmetic: remove dead code

2018-03-23 Thread Harald Welte

Patch Set 1: Code-Review-1

the fact we're not using this most likely is a sign that we are never 
logging/vty-printing an important value that we should

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

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


osmo-bts[master]: cosmetic: remove unused variable

2018-03-23 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


osmo-bts[master]: cosmetic: remove unused variable in osmo-bts-omldummy/main.c

2018-03-23 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


[PATCH] osmo-bts[master]: cosmetic: remove unused variable in osmo-bts-omldummy/main.c

2018-03-23 Thread dexter

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

cosmetic: remove unused variable in osmo-bts-omldummy/main.c

Change-Id: I85d8c77589eae511f47b8b9b7439a2c47fe350d8
---
M src/osmo-bts-omldummy/main.c
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/src/osmo-bts-omldummy/main.c b/src/osmo-bts-omldummy/main.c
index b9334b1..39f2ac2 100644
--- a/src/osmo-bts-omldummy/main.c
+++ b/src/osmo-bts-omldummy/main.c
@@ -11,7 +11,7 @@
struct gsm_bts *bts;
struct gsm_bts_trx *trx;
struct e1inp_line *line;
-   int rc, i;
+   int i;
 
char *dst_host = argv[1];
int site_id = atoi(argv[2]);

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I85d8c77589eae511f47b8b9b7439a2c47fe350d8
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: dexter 


[PATCH] osmo-bts[master]: cosmetic: remove unused variable

2018-03-23 Thread dexter

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

cosmetic: remove unused variable

Change-Id: Icbec00ec63950b785dcb71e3b9d70541e70be536
---
M src/osmo-bts-octphy/l1_if.c
1 file changed, 0 insertions(+), 1 deletion(-)


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

diff --git a/src/osmo-bts-octphy/l1_if.c b/src/osmo-bts-octphy/l1_if.c
index 0d63d51..f178029 100644
--- a/src/osmo-bts-octphy/l1_if.c
+++ b/src/osmo-bts-octphy/l1_if.c
@@ -1162,7 +1162,6 @@
struct msgb *l1p_msg)
 {
struct gsm_bts_trx *trx = trx_by_l1h(fl1, ra_ind->TrxId.byTrxId);
-   struct gsm_bts *bts = trx->bts;
struct osmo_phsap_prim *l1sap;
int rc;
struct ph_rach_ind_param rach_ind_param;

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Icbec00ec63950b785dcb71e3b9d70541e70be536
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: dexter 


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

2018-03-23 Thread dexter

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

cosmetic: remove dead code

Change-Id: I40ff0b95349308693bec5f4ae56ec7f2f14202e5
---
M src/osmo-bts-octphy/octphy_hw_api.c
1 file changed, 0 insertions(+), 8 deletions(-)


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

diff --git a/src/osmo-bts-octphy/octphy_hw_api.c 
b/src/osmo-bts-octphy/octphy_hw_api.c
index 7b988fe..91b84de 100644
--- a/src/osmo-bts-octphy/octphy_hw_api.c
+++ b/src/osmo-bts-octphy/octphy_hw_api.c
@@ -285,14 +285,6 @@
{ 0, NULL }
 };
 
-static const struct value_string clocksync_source_state_vals[] = {
-   { cOCTVC1_HW_CLOCK_SYNC_MGR_SOURCE_STATE_ENUM_INVALID, "Invalid" },
-   { cOCTVC1_HW_CLOCK_SYNC_MGR_SOURCE_STATE_ENUM_VALID, "Valid" },
-   { cOCTVC1_HW_CLOCK_SYNC_MGR_SOURCE_STATE_ENUM_UNSPECIFIED,
-   "Unspecified" },
-   { 0, NULL }
-};
-
 /* Chapter 12.15 */
 static int get_clock_sync_compl_cb(struct octphy_hdl *fl1, struct msgb *resp,
   void *data)

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I40ff0b95349308693bec5f4ae56ec7f2f14202e5
Gerrit-PatchSet: 1
Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-Owner: dexter 


osmo-bsc[master]: contrib: osmo-bsc.service: Update description

2018-03-23 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


osmo-bsc[master]: contrib: osmo-bsc.service: Fix osmo-mgw.service dependency

2018-03-23 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


[MERGED] osmo-bsc[master]: contrib: osmo-bsc.service: Update description

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

Change subject: contrib: osmo-bsc.service: Update description
..


contrib: osmo-bsc.service: Update description

Change-Id: I99d02bd8bd5842580518b34865dd0cbd0433bf27
---
M contrib/systemd/osmo-bsc.service
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/contrib/systemd/osmo-bsc.service b/contrib/systemd/osmo-bsc.service
index 4047fef..cf0c277 100644
--- a/contrib/systemd/osmo-bsc.service
+++ b/contrib/systemd/osmo-bsc.service
@@ -1,5 +1,5 @@
 [Unit]
-Description=OpenBSC BSC
+Description=Osmocom Base Station Controller (BSC)
 Wants=osmo-bsc-mgcp.service
 
 [Service]

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I99d02bd8bd5842580518b34865dd0cbd0433bf27
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[MERGED] osmo-bsc[master]: contrib: osmo-bsc.service: Fix osmo-mgw.service dependency

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

Change subject: contrib: osmo-bsc.service: Fix osmo-mgw.service dependency
..


contrib: osmo-bsc.service: Fix osmo-mgw.service dependency

Since a while ago, osmo-bsc works only with osmo-mgw.

Change-Id: If95d20db4d379b9632342f7e552237066124ac40
---
M contrib/systemd/osmo-bsc.service
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/contrib/systemd/osmo-bsc.service b/contrib/systemd/osmo-bsc.service
index cf0c277..67dcd7e 100644
--- a/contrib/systemd/osmo-bsc.service
+++ b/contrib/systemd/osmo-bsc.service
@@ -1,6 +1,6 @@
 [Unit]
 Description=Osmocom Base Station Controller (BSC)
-Wants=osmo-bsc-mgcp.service
+Wants=osmo-mgw.service
 
 [Service]
 Type=simple

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

Gerrit-MessageType: merged
Gerrit-Change-Id: If95d20db4d379b9632342f7e552237066124ac40
Gerrit-PatchSet: 2
Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


osmo-msc[master]: contrib: osmo-msc.service: Depend on osmo-mgw.service

2018-03-23 Thread Harald Welte

Patch Set 1: Code-Review+2

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

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


[MERGED] osmo-msc[master]: contrib: osmo-msc.service: Depend on osmo-mgw.service

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

Change subject: contrib: osmo-msc.service: Depend on osmo-mgw.service
..


contrib: osmo-msc.service: Depend on osmo-mgw.service

Change-Id: Ia50eb02843bf6d145040fbe5032071a3be7b0794
---
M contrib/systemd/osmo-msc.service
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/contrib/systemd/osmo-msc.service b/contrib/systemd/osmo-msc.service
index 7cebb14..343639c 100644
--- a/contrib/systemd/osmo-msc.service
+++ b/contrib/systemd/osmo-msc.service
@@ -1,6 +1,7 @@
 [Unit]
 Description=Osmocom Mobile Switching Center (MSC)
 Wants=osmo-hlr.service
+Wants=osmo-mgw.service
 After=osmo-hlr.service
 After=osmo-hnbgw.service
 

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

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


[MERGED] libosmocore[master]: fix gsm0808_enc_cell_id_list2 for leading-zero MNC

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

Change subject: fix gsm0808_enc_cell_id_list2 for leading-zero MNC
..


fix gsm0808_enc_cell_id_list2 for leading-zero MNC

Use non-deprecated API to decode encode in gsm0808_enc_cell_id_list2().

Adjust gsm0808_test.c to now expect the correct results instead of previous
failure.

Change-Id: I1ce78883995e0d484368046b69db5afb2b4adc97
---
M src/gsm/gsm0808_utils.c
M tests/gsm0808/gsm0808_test.c
2 files changed, 3 insertions(+), 6 deletions(-)

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



diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c
index 776f091..e4872b8 100644
--- a/src/gsm/gsm0808_utils.c
+++ b/src/gsm/gsm0808_utils.c
@@ -595,7 +595,7 @@
for (i = 0; i < cil->id_list_len; i++) {
const struct osmo_cell_global_id *id = 
&cil->id_list[i].global;
struct gsm48_loc_area_id lai;
-   gsm48_generate_lai(&lai, id->lai.plmn.mcc, 
id->lai.plmn.mnc, id->lai.lac);
+   gsm48_generate_lai2(&lai, &id->lai);
memcpy(msgb_put(msg, sizeof(lai)), &lai, sizeof(lai));
msgb_put_u16(msg, id->cell_identity);
}
@@ -615,7 +615,7 @@
for (i = 0; i < cil->id_list_len; i++) {
const struct osmo_location_area_id *id = 
&cil->id_list[i].lai_and_lac;
struct gsm48_loc_area_id lai;
-   gsm48_generate_lai(&lai, id->plmn.mcc, id->plmn.mnc, 
id->lac);
+   gsm48_generate_lai2(&lai, id);
memcpy(msgb_put(msg, sizeof(lai)), &lai, sizeof(lai));
}
break;
diff --git a/tests/gsm0808/gsm0808_test.c b/tests/gsm0808/gsm0808_test.c
index f6a7bc4..4bf61e7 100644
--- a/tests/gsm0808/gsm0808_test.c
+++ b/tests/gsm0808/gsm0808_test.c
@@ -1003,8 +1003,7 @@
uint8_t cil_enc_expected[] = { GSM0808_IE_CELL_IDENTIFIER_LIST, 0x16, 
0x00,
0x21,  0x63,  0x54,  0x23,  0x42,  0x00,  0x1,
0x21,  0xf4,  0x75,  0x24,  0x43,  0x00,  0x2,
-   0x21,  0xf5,  0x70,  0x25,  0x44,  0x00,  0x77
-   /*   ERROR! This  should be 0x75, 0x00, i.e. a 3-digit MNC with 
leading zeros! */
+   0x21,  0x75,  0x00,  0x25,  0x44,  0x00,  0x77
};
uint8_t rc_enc;
int rc_dec, i;
@@ -1057,9 +1056,7 @@
struct osmo_cell_global_id *dec_id;
enc_id = &enc_cil.id_list[i].global;
dec_id = &dec_cil.id_list[i].global;
-   /* ERROR: the decoded PLMN will mismatch, because the leading 
zero was not preserved:
OSMO_ASSERT(osmo_plmn_cmp(&enc_id->lai.plmn, &dec_id->lai.plmn) 
== 0);
-   */
OSMO_ASSERT(enc_id->lai.lac == dec_id->lai.lac);
OSMO_ASSERT(enc_id->cell_identity == dec_id->cell_identity);
}

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I1ce78883995e0d484368046b69db5afb2b4adc97
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 
Gerrit-Reviewer: Stefan Sperling 


[MERGED] osmo-bsc[master]: cosmetic: remove dead code: osmo_bsc_reset.c

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

Change subject: cosmetic: remove dead code: osmo_bsc_reset.c
..


cosmetic: remove dead code: osmo_bsc_reset.c

Change-Id: I22f92541982489a0948bd1dedc008439981fb33e
Related: OS#3102
---
D src/osmo-bsc/osmo_bsc_reset.c
1 file changed, 0 insertions(+), 190 deletions(-)

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



diff --git a/src/osmo-bsc/osmo_bsc_reset.c b/src/osmo-bsc/osmo_bsc_reset.c
deleted file mode 100644
index e482a44..000
--- a/src/osmo-bsc/osmo_bsc_reset.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/* (C) 2017 by sysmocom s.f.m.c. GmbH
- * All Rights Reserved
- *
- * Author: Philipp Maier
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see .
- *
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#define RESET_RESEND_INTERVAL 2/* sec */
-#define RESET_RESEND_TIMER_NO 1234 /* FIXME: dig out the real timer number 
*/
-#define BAD_CONNECTION_THRESOLD 3  /* connection failures */
-
-enum fsm_bsc_reset_states {
-   ST_DISC,/* Disconnected from MSC */
-   ST_CONN,/* We have a confirmed connection to the MSC */
-};
-
-static const struct value_string fsm_bsc_reset_state_names[] = {
-   {ST_DISC, "ST_DISC (disconnected)"},
-   {ST_CONN, "ST_CONN (connected)"},
-   {0, NULL},
-};
-
-enum fsm_bsc_reset_evt {
-   EV_RESET_ACK,   /* got reset acknowlegement from the MSC */
-   EV_N_DISCONNECT,/* lost a connection */
-   EV_N_CONNECT,   /* made a successful connection */
-};
-
-static const struct value_string fsm_bsc_reset_evt_names[] = {
-   {EV_RESET_ACK, "EV_RESET_ACK"},
-   {EV_N_DISCONNECT, "EV_N_DISCONNECT"},
-   {EV_N_CONNECT, "EV_N_CONNECT"},
-   {0, NULL},
-};
-
-/* Disconnected state */
-static void fsm_disc_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data)
-{
-   struct bsc_msc_data *msc = (struct bsc_msc_data *)data;
-
-   LOGP(DMSC, LOGL_NOTICE, "fsm-state (msc-reset): %s, fsm-event: %s, MSC 
No.: %i\n",
-get_value_string(fsm_bsc_reset_state_names, ST_DISC), 
get_value_string(fsm_bsc_reset_evt_names, event), msc->nr);
-   msc->msc_con->msc_conn_loss_count = 0;
-   osmo_fsm_inst_state_chg(fi, ST_CONN, 0, 0);
-}
-
-/* Connected state */
-static void fsm_conn_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data)
-{
-   struct bsc_msc_data *msc = (struct bsc_msc_data *)data;
-
-   LOGP(DMSC, LOGL_NOTICE, "fsm-state (msc-reset): %s, fsm-event: %s, MSC 
No.: %i\n",
-get_value_string(fsm_bsc_reset_state_names, ST_CONN), 
get_value_string(fsm_bsc_reset_evt_names, event), msc->nr);
-
-   OSMO_ASSERT(msc);
-
-   switch (event) {
-   case EV_N_DISCONNECT:
-   if (msc->msc_con->msc_conn_loss_count >= 
BAD_CONNECTION_THRESOLD) {
-   LOGP(DMSC, LOGL_NOTICE, "SIGTRAN connection to MSC No.: 
%i down, reconnecting...\n", msc->nr);
-   osmo_fsm_inst_state_chg(fi, ST_DISC, 
RESET_RESEND_INTERVAL, RESET_RESEND_TIMER_NO);
-   } else
-   msc->msc_con->msc_conn_loss_count++;
-   break;
-   case EV_N_CONNECT:
-   msc->msc_con->msc_conn_loss_count = 0;
-   break;
-   }
-}
-
-/* Timer callback to retransmit the reset signal */
-static int fsm_reset_ack_timeout_cb(struct osmo_fsm_inst *fi)
-{
-   struct bsc_msc_data *msc = (struct bsc_msc_data *)fi->priv;
-
-   LOGP(DMSC, LOGL_NOTICE, "reset-ack timeout (T%i) in state %s, MSC No.: 
%i, resending...\n", fi->T,
-get_value_string(fsm_bsc_reset_state_names, fi->state), msc->nr);
-
-   osmo_bsc_sigtran_reset(msc);
-   osmo_bsc_sigtran_tx_reset(msc);
-
-   osmo_fsm_inst_state_chg(fi, ST_DISC, RESET_RESEND_INTERVAL, 
RESET_RESEND_TIMER_NO);
-   return 0;
-}
-
-static struct osmo_fsm_state fsm_bsc_reset_states[] = {
-   [ST_DISC] = {
-.in_event_mask = (1 << EV_RESET_ACK),
-.out_state_mask = (1 << ST_DISC) | (1 << ST_CONN),
-.name = "DISC",
-.action = fsm_disc_cb,
-},
-   [ST_CONN] = {
- 

osmo-bsc[master]: cosmetic: remove dead code: osmo_bsc_reset.c

2018-03-23 Thread Neels Hofmeyr

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

also setting V+1 because jenkins did succeed, yet it doesn't show as a vote for 
some reason.

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

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


[PATCH] osmo-msc[master]: contrib: osmo-msc.service: Depend on osmo-mgw.service

2018-03-23 Thread Pau Espin Pedrol

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

contrib: osmo-msc.service: Depend on osmo-mgw.service

Change-Id: Ia50eb02843bf6d145040fbe5032071a3be7b0794
---
M contrib/systemd/osmo-msc.service
1 file changed, 1 insertion(+), 0 deletions(-)


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

diff --git a/contrib/systemd/osmo-msc.service b/contrib/systemd/osmo-msc.service
index 7cebb14..343639c 100644
--- a/contrib/systemd/osmo-msc.service
+++ b/contrib/systemd/osmo-msc.service
@@ -1,6 +1,7 @@
 [Unit]
 Description=Osmocom Mobile Switching Center (MSC)
 Wants=osmo-hlr.service
+Wants=osmo-mgw.service
 After=osmo-hlr.service
 After=osmo-hnbgw.service
 

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

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


[PATCH] osmo-bsc[master]: contrib: osmo-bsc.service: Update description

2018-03-23 Thread Pau Espin Pedrol

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

contrib: osmo-bsc.service: Update description

Change-Id: I99d02bd8bd5842580518b34865dd0cbd0433bf27
---
M contrib/systemd/osmo-bsc.service
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/contrib/systemd/osmo-bsc.service b/contrib/systemd/osmo-bsc.service
index 4047fef..cf0c277 100644
--- a/contrib/systemd/osmo-bsc.service
+++ b/contrib/systemd/osmo-bsc.service
@@ -1,5 +1,5 @@
 [Unit]
-Description=OpenBSC BSC
+Description=Osmocom Base Station Controller (BSC)
 Wants=osmo-bsc-mgcp.service
 
 [Service]

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

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


[PATCH] osmo-bsc[master]: contrib: osmo-bsc.service: Fix osmo-mgw.service dependency

2018-03-23 Thread Pau Espin Pedrol

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

contrib: osmo-bsc.service: Fix osmo-mgw.service dependency

Since a while ago, osmo-bsc works only with osmo-mgw.

Change-Id: If95d20db4d379b9632342f7e552237066124ac40
---
M contrib/systemd/osmo-bsc.service
1 file changed, 1 insertion(+), 1 deletion(-)


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

diff --git a/contrib/systemd/osmo-bsc.service b/contrib/systemd/osmo-bsc.service
index cf0c277..67dcd7e 100644
--- a/contrib/systemd/osmo-bsc.service
+++ b/contrib/systemd/osmo-bsc.service
@@ -1,6 +1,6 @@
 [Unit]
 Description=Osmocom Base Station Controller (BSC)
-Wants=osmo-bsc-mgcp.service
+Wants=osmo-mgw.service
 
 [Service]
 Type=simple

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

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


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

2018-03-23 Thread Neels Hofmeyr

cosmetic: remove dead code: osmo_bsc_reset.c

Change-Id: I22f92541982489a0948bd1dedc008439981fb33e
Related: OS#3102
---
D src/osmo-bsc/osmo_bsc_reset.c
1 file changed, 0 insertions(+), 190 deletions(-)


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

diff --git a/src/osmo-bsc/osmo_bsc_reset.c b/src/osmo-bsc/osmo_bsc_reset.c
deleted file mode 100644
index e482a44..000
--- a/src/osmo-bsc/osmo_bsc_reset.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/* (C) 2017 by sysmocom s.f.m.c. GmbH
- * All Rights Reserved
- *
- * Author: Philipp Maier
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see .
- *
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#define RESET_RESEND_INTERVAL 2/* sec */
-#define RESET_RESEND_TIMER_NO 1234 /* FIXME: dig out the real timer number 
*/
-#define BAD_CONNECTION_THRESOLD 3  /* connection failures */
-
-enum fsm_bsc_reset_states {
-   ST_DISC,/* Disconnected from MSC */
-   ST_CONN,/* We have a confirmed connection to the MSC */
-};
-
-static const struct value_string fsm_bsc_reset_state_names[] = {
-   {ST_DISC, "ST_DISC (disconnected)"},
-   {ST_CONN, "ST_CONN (connected)"},
-   {0, NULL},
-};
-
-enum fsm_bsc_reset_evt {
-   EV_RESET_ACK,   /* got reset acknowlegement from the MSC */
-   EV_N_DISCONNECT,/* lost a connection */
-   EV_N_CONNECT,   /* made a successful connection */
-};
-
-static const struct value_string fsm_bsc_reset_evt_names[] = {
-   {EV_RESET_ACK, "EV_RESET_ACK"},
-   {EV_N_DISCONNECT, "EV_N_DISCONNECT"},
-   {EV_N_CONNECT, "EV_N_CONNECT"},
-   {0, NULL},
-};
-
-/* Disconnected state */
-static void fsm_disc_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data)
-{
-   struct bsc_msc_data *msc = (struct bsc_msc_data *)data;
-
-   LOGP(DMSC, LOGL_NOTICE, "fsm-state (msc-reset): %s, fsm-event: %s, MSC 
No.: %i\n",
-get_value_string(fsm_bsc_reset_state_names, ST_DISC), 
get_value_string(fsm_bsc_reset_evt_names, event), msc->nr);
-   msc->msc_con->msc_conn_loss_count = 0;
-   osmo_fsm_inst_state_chg(fi, ST_CONN, 0, 0);
-}
-
-/* Connected state */
-static void fsm_conn_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data)
-{
-   struct bsc_msc_data *msc = (struct bsc_msc_data *)data;
-
-   LOGP(DMSC, LOGL_NOTICE, "fsm-state (msc-reset): %s, fsm-event: %s, MSC 
No.: %i\n",
-get_value_string(fsm_bsc_reset_state_names, ST_CONN), 
get_value_string(fsm_bsc_reset_evt_names, event), msc->nr);
-
-   OSMO_ASSERT(msc);
-
-   switch (event) {
-   case EV_N_DISCONNECT:
-   if (msc->msc_con->msc_conn_loss_count >= 
BAD_CONNECTION_THRESOLD) {
-   LOGP(DMSC, LOGL_NOTICE, "SIGTRAN connection to MSC No.: 
%i down, reconnecting...\n", msc->nr);
-   osmo_fsm_inst_state_chg(fi, ST_DISC, 
RESET_RESEND_INTERVAL, RESET_RESEND_TIMER_NO);
-   } else
-   msc->msc_con->msc_conn_loss_count++;
-   break;
-   case EV_N_CONNECT:
-   msc->msc_con->msc_conn_loss_count = 0;
-   break;
-   }
-}
-
-/* Timer callback to retransmit the reset signal */
-static int fsm_reset_ack_timeout_cb(struct osmo_fsm_inst *fi)
-{
-   struct bsc_msc_data *msc = (struct bsc_msc_data *)fi->priv;
-
-   LOGP(DMSC, LOGL_NOTICE, "reset-ack timeout (T%i) in state %s, MSC No.: 
%i, resending...\n", fi->T,
-get_value_string(fsm_bsc_reset_state_names, fi->state), msc->nr);
-
-   osmo_bsc_sigtran_reset(msc);
-   osmo_bsc_sigtran_tx_reset(msc);
-
-   osmo_fsm_inst_state_chg(fi, ST_DISC, RESET_RESEND_INTERVAL, 
RESET_RESEND_TIMER_NO);
-   return 0;
-}
-
-static struct osmo_fsm_state fsm_bsc_reset_states[] = {
-   [ST_DISC] = {
-.in_event_mask = (1 << EV_RESET_ACK),
-.out_state_mask = (1 << ST_DISC) | (1 << ST_CONN),
-.name = "DISC",
-.action = fsm_disc_cb,
-},
-   [ST_CONN] = {
-.in_event_mask = (1 << EV_N_DISCONNECT) | (1 << 
EV_N_CONNECT),
-.out_state_mask = (1 << ST_DISC) | (1 << ST_CONN),
-.name = "CONN",
-

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

2018-03-23 Thread dexter

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

cosmetic: remove dead code

Change-Id: I22f92541982489a0948bd1dedc008439981fb33e
Related: OS#3102
---
D src/osmo-bsc/osmo_bsc_reset.c
1 file changed, 0 insertions(+), 190 deletions(-)


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

diff --git a/src/osmo-bsc/osmo_bsc_reset.c b/src/osmo-bsc/osmo_bsc_reset.c
deleted file mode 100644
index e482a44..000
--- a/src/osmo-bsc/osmo_bsc_reset.c
+++ /dev/null
@@ -1,190 +0,0 @@
-/* (C) 2017 by sysmocom s.f.m.c. GmbH
- * All Rights Reserved
- *
- * Author: Philipp Maier
- *
- * This program is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Affero General Public License as published by
- * the Free Software Foundation; either version 3 of the License, or
- * (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU Affero General Public License for more details.
- *
- * You should have received a copy of the GNU Affero General Public License
- * along with this program.  If not, see .
- *
- */
-
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-#include 
-
-#define RESET_RESEND_INTERVAL 2/* sec */
-#define RESET_RESEND_TIMER_NO 1234 /* FIXME: dig out the real timer number 
*/
-#define BAD_CONNECTION_THRESOLD 3  /* connection failures */
-
-enum fsm_bsc_reset_states {
-   ST_DISC,/* Disconnected from MSC */
-   ST_CONN,/* We have a confirmed connection to the MSC */
-};
-
-static const struct value_string fsm_bsc_reset_state_names[] = {
-   {ST_DISC, "ST_DISC (disconnected)"},
-   {ST_CONN, "ST_CONN (connected)"},
-   {0, NULL},
-};
-
-enum fsm_bsc_reset_evt {
-   EV_RESET_ACK,   /* got reset acknowlegement from the MSC */
-   EV_N_DISCONNECT,/* lost a connection */
-   EV_N_CONNECT,   /* made a successful connection */
-};
-
-static const struct value_string fsm_bsc_reset_evt_names[] = {
-   {EV_RESET_ACK, "EV_RESET_ACK"},
-   {EV_N_DISCONNECT, "EV_N_DISCONNECT"},
-   {EV_N_CONNECT, "EV_N_CONNECT"},
-   {0, NULL},
-};
-
-/* Disconnected state */
-static void fsm_disc_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data)
-{
-   struct bsc_msc_data *msc = (struct bsc_msc_data *)data;
-
-   LOGP(DMSC, LOGL_NOTICE, "fsm-state (msc-reset): %s, fsm-event: %s, MSC 
No.: %i\n",
-get_value_string(fsm_bsc_reset_state_names, ST_DISC), 
get_value_string(fsm_bsc_reset_evt_names, event), msc->nr);
-   msc->msc_con->msc_conn_loss_count = 0;
-   osmo_fsm_inst_state_chg(fi, ST_CONN, 0, 0);
-}
-
-/* Connected state */
-static void fsm_conn_cb(struct osmo_fsm_inst *fi, uint32_t event, void *data)
-{
-   struct bsc_msc_data *msc = (struct bsc_msc_data *)data;
-
-   LOGP(DMSC, LOGL_NOTICE, "fsm-state (msc-reset): %s, fsm-event: %s, MSC 
No.: %i\n",
-get_value_string(fsm_bsc_reset_state_names, ST_CONN), 
get_value_string(fsm_bsc_reset_evt_names, event), msc->nr);
-
-   OSMO_ASSERT(msc);
-
-   switch (event) {
-   case EV_N_DISCONNECT:
-   if (msc->msc_con->msc_conn_loss_count >= 
BAD_CONNECTION_THRESOLD) {
-   LOGP(DMSC, LOGL_NOTICE, "SIGTRAN connection to MSC No.: 
%i down, reconnecting...\n", msc->nr);
-   osmo_fsm_inst_state_chg(fi, ST_DISC, 
RESET_RESEND_INTERVAL, RESET_RESEND_TIMER_NO);
-   } else
-   msc->msc_con->msc_conn_loss_count++;
-   break;
-   case EV_N_CONNECT:
-   msc->msc_con->msc_conn_loss_count = 0;
-   break;
-   }
-}
-
-/* Timer callback to retransmit the reset signal */
-static int fsm_reset_ack_timeout_cb(struct osmo_fsm_inst *fi)
-{
-   struct bsc_msc_data *msc = (struct bsc_msc_data *)fi->priv;
-
-   LOGP(DMSC, LOGL_NOTICE, "reset-ack timeout (T%i) in state %s, MSC No.: 
%i, resending...\n", fi->T,
-get_value_string(fsm_bsc_reset_state_names, fi->state), msc->nr);
-
-   osmo_bsc_sigtran_reset(msc);
-   osmo_bsc_sigtran_tx_reset(msc);
-
-   osmo_fsm_inst_state_chg(fi, ST_DISC, RESET_RESEND_INTERVAL, 
RESET_RESEND_TIMER_NO);
-   return 0;
-}
-
-static struct osmo_fsm_state fsm_bsc_reset_states[] = {
-   [ST_DISC] = {
-.in_event_mask = (1 << EV_RESET_ACK),
-.out_state_mask = (1 << ST_DISC) | (1 << ST_CONN),
-.name = "DISC",
-.action = fsm_disc_cb,
-},
-   [ST_CONN] = {
-.in_event_mask = (1 << EV_N_DISCONNECT) | (1 << 
EV_N_CONNECT),
-.out_state_mask = (1 << ST_DISC) | (1 << ST_CONN),
-   

[MERGED] libosmocore[master]: show failure in gsm0808_enc_cell_id_list2() in gsm0808_test

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

Change subject: show failure in gsm0808_enc_cell_id_list2() in gsm0808_test
..


show failure in gsm0808_enc_cell_id_list2() in gsm0808_test

Change-Id: I763b18d2922701ad97382269747ff0cbb7bd657b
---
M tests/gsm0808/gsm0808_test.c
1 file changed, 8 insertions(+), 4 deletions(-)

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 abdb26e..f6a7bc4 100644
--- a/tests/gsm0808/gsm0808_test.c
+++ b/tests/gsm0808/gsm0808_test.c
@@ -1002,8 +1002,9 @@
struct msgb *msg;
uint8_t cil_enc_expected[] = { GSM0808_IE_CELL_IDENTIFIER_LIST, 0x16, 
0x00,
0x21,  0x63,  0x54,  0x23,  0x42,  0x00,  0x1,
-   0x21,  0x74,  0x54,  0x24,  0x43,  0x00,  0x2,
-   0x21,  0x85,  0x54,  0x25,  0x44,  0x00,  0x77
+   0x21,  0xf4,  0x75,  0x24,  0x43,  0x00,  0x2,
+   0x21,  0xf5,  0x70,  0x25,  0x44,  0x00,  0x77
+   /*   ERROR! This  should be 0x75, 0x00, i.e. a 3-digit MNC with 
leading zeros! */
};
uint8_t rc_enc;
int rc_dec, i;
@@ -1021,14 +1022,15 @@
},
{
.global = {
-   .lai = { .plmn = { .mcc = 124, .mnc = 
457 },
+   .lai = { .plmn = { .mcc = 124, .mnc = 
57 },
 .lac = 0x2443 },
.cell_identity = 2,
}
},
{
.global = {
-   .lai = { .plmn = { .mcc = 125, .mnc = 
458 },
+   .lai = { .plmn = { .mcc = 125, .mnc = 7,
+  .mnc_3_digits = true 
},
 .lac = 0x2544 },
.cell_identity = 119,
}
@@ -1055,7 +1057,9 @@
struct osmo_cell_global_id *dec_id;
enc_id = &enc_cil.id_list[i].global;
dec_id = &dec_cil.id_list[i].global;
+   /* ERROR: the decoded PLMN will mismatch, because the leading 
zero was not preserved:
OSMO_ASSERT(osmo_plmn_cmp(&enc_id->lai.plmn, &dec_id->lai.plmn) 
== 0);
+   */
OSMO_ASSERT(enc_id->lai.lac == dec_id->lai.lac);
OSMO_ASSERT(enc_id->cell_identity == dec_id->cell_identity);
}

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

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


osmo-ttcn3-hacks[master]: bsc: Fix tons of TTCN3 compiler warnings

2018-03-23 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I60dc054d19a249d46d44585c17626746c34f4b09
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]: bsc: Fix tons of TTCN3 compiler warnings

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

Change subject: bsc: Fix tons of TTCN3 compiler warnings
..


bsc: Fix tons of TTCN3 compiler warnings

Change-Id: I60dc054d19a249d46d44585c17626746c34f4b09
---
M bsc/BSC_Tests.ttcn
M bsc/MSC_ConnectionHandler.ttcn
M library/BSSMAP_Emulation.ttcn
M library/MGCP_Emulation.ttcn
M library/Osmocom_VTY_Functions.ttcn
M library/RSL_Emulation.ttcn
6 files changed, 32 insertions(+), 25 deletions(-)

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



diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index d392a71..e4601eb 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -353,11 +353,12 @@
 /* verify we get a CHAN_ACT after CHAN RQD */
 testcase TC_chan_act_noreply() runs on test_CT {
var BSSAP_N_UNITDATA_ind ud_ind;
+   var RSL_Message rsl_unused;
 
f_init(1);
 

IPA_RSL[0].send(ts_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0,ts_RSL_CHAN_RQD('23'O, 23)));
-   f_exp_ipa_rx(0, tr_RSL_MsgTypeD(RSL_MT_CHAN_ACTIV));
+   rsl_unused := f_exp_ipa_rx(0, tr_RSL_MsgTypeD(RSL_MT_CHAN_ACTIV));
setverdict(pass);
 }
 
@@ -365,12 +366,13 @@
 testcase TC_chan_act_counter() runs on test_CT {
var BSSAP_N_UNITDATA_ind ud_ind;
var integer chreq_total;
+   var RSL_Message rsl_unused;
 
f_init(1);
 
chreq_total := f_ctrl_get_ratectr_abs(IPA_CTRL, "bts", 0, 
"chreq:total");

IPA_RSL[0].send(ts_ASP_RSL_UD(IPAC_PROTO_RSL_TRX0,ts_RSL_CHAN_RQD('23'O, 23)));
-   f_exp_ipa_rx(0, tr_RSL_MsgTypeD(RSL_MT_CHAN_ACTIV));
+   rsl_unused := f_exp_ipa_rx(0, tr_RSL_MsgTypeD(RSL_MT_CHAN_ACTIV));
f_ctrl_get_exp_ratectr_abs(IPA_CTRL, "bts", 0, "chreq:total", 
chreq_total+1);
 
setverdict(pass);
@@ -479,7 +481,7 @@
 
/* expect 5xTCH/F to succeed */
for (i := 0; i < NUM_TCHF_PER_BTS + NUM_SDCCH_PER_BTS; i := i+1) {
-   f_chreq_act_ack('23'O, i);
+   var RslChannelNr chan_nr := f_chreq_act_ack('23'O, i);
}
 
IPA_RSL[0].clear;
@@ -1359,7 +1361,6 @@
[] IPA_RSL[0].receive { repeat }
[] T.timeout {
self.stop;
-   return false;
}
}
 
diff --git a/bsc/MSC_ConnectionHandler.ttcn b/bsc/MSC_ConnectionHandler.ttcn
index 659ac36..e648427 100644
--- a/bsc/MSC_ConnectionHandler.ttcn
+++ b/bsc/MSC_ConnectionHandler.ttcn
@@ -119,7 +119,6 @@
}
setverdict(fail, "Only 2 Connections per EP!");
self.stop;
-   return -1;
 }
 
 private function f_get_mgcp_conn(MgcpConnectionId cid) runs on MSC_ConnHdlr 
return integer {
@@ -130,7 +129,6 @@
}
setverdict(fail, "No Connection for ID ", cid);
self.stop;
-   return -1;
 }
 
 
@@ -140,6 +138,7 @@
var RSL_Message rsl;
var MgcpCommand mgcp_cmd;
var RSL_IE_Body ie;
+   var boolean b_unused;
[not g_media.bts.ipa_crcx_seen] RSL.receive(tr_RSL_IPA_CRCX(g_chan_nr)) 
-> value rsl {
/* Extract parameters from request + use in response */
if (f_rsl_find_ie(rsl, RSL_IE_IPAC_RTP_PAYLOAD, ie)) {
@@ -157,15 +156,15 @@
}
[g_media.bts.ipa_crcx_seen] RSL.receive(tr_RSL_IPA_MDCX(g_chan_nr, ?)) 
-> value rsl{
/* Extract conn_id, ip, port, rtp_pt2 from request + use in 
response */
-   f_rsl_find_ie(rsl, RSL_IE_IPAC_CONN_ID, ie);
+   b_unused := f_rsl_find_ie(rsl, RSL_IE_IPAC_CONN_ID, ie);
if (g_media.bts.conn_id != ie.ipa_conn_id) {
setverdict(fail, "IPA MDCX for unknown ConnId", rsl);
self.stop;
}
/* mandatory */
-   f_rsl_find_ie(rsl, RSL_IE_IPAC_REMOTE_IP, ie);
+   b_unused := f_rsl_find_ie(rsl, RSL_IE_IPAC_REMOTE_IP, ie);
g_media.bts.peer.host := f_inet_ntoa(int2oct(ie.ipa_remote_ip, 
4));
-   f_rsl_find_ie(rsl, RSL_IE_IPAC_REMOTE_PORT, ie);
+   b_unused := f_rsl_find_ie(rsl, RSL_IE_IPAC_REMOTE_PORT, ie);
g_media.bts.peer.port_nr := ie.ipa_remote_port;
/* optional */
if (f_rsl_find_ie(rsl, RSL_IE_IPAC_RTP_PAYLOAD, ie)) {
@@ -201,15 +200,15 @@
/* on second (new) BTS during hand-over */
[g_media.bts1.ipa_crcx_seen] RSL1.receive(tr_RSL_IPA_MDCX(g_chan_nr, 
?)) -> value rsl{
/* Extract conn_id, ip, port, rtp_pt2 from request + use in 
response */
-   f_rsl_find_ie(rsl, RSL_IE_IPAC_CONN_ID, ie);
+   b_unused := f_rsl_find_ie(rsl, RSL_IE_IPAC_CONN_ID, ie);
if (g_media.bts1.conn_id != ie.ipa_conn_id) {
setverdict(fail, "IPA MDCX for unknown ConnId", rsl);
self.stop;
}
/* mandatory */
-   f_rsl_find_ie(rsl, RSL_IE_IPAC_RE

[MERGED] libosmocore[master]: gsm0808_test: cosmetic: test non-hex MCC

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

Change subject: gsm0808_test: cosmetic: test non-hex MCC
..


gsm0808_test: cosmetic: test non-hex MCC

The test currently sets the MCC by a hex value, which is a weird choice. The
MCC gets BCD'd and hence we will see the decimal values 1:1 in the encoded
octets as hex digits. Using hex as input obscures that:

Right now it sets mcc = 0x123, which is actually 291 in decimal, and we hence
see "92 .1" in the expected BCD result. Using 0x124 in the test source actually
makes it hard to see where the 0x123 went.

Change the MCC to decimal notation (123, 124, 125) and adjust the expected
encoded output.

Change-Id: I973835c54a90fefe50d2b3581324d12556715f58
---
M tests/gsm0808/gsm0808_test.c
1 file changed, 6 insertions(+), 6 deletions(-)

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 c25344a..abdb26e 100644
--- a/tests/gsm0808/gsm0808_test.c
+++ b/tests/gsm0808/gsm0808_test.c
@@ -1001,9 +1001,9 @@
struct gsm0808_cell_id_list2 dec_cil;
struct msgb *msg;
uint8_t cil_enc_expected[] = { GSM0808_IE_CELL_IDENTIFIER_LIST, 0x16, 
0x00,
-   0x92,  0x61,  0x54,  0x23,  0x42,  0x00,  0x1,
-   0x92,  0x72,  0x54,  0x24,  0x43,  0x00,  0x2,
-   0x92,  0x83,  0x54,  0x25,  0x44,  0x00,  0x77
+   0x21,  0x63,  0x54,  0x23,  0x42,  0x00,  0x1,
+   0x21,  0x74,  0x54,  0x24,  0x43,  0x00,  0x2,
+   0x21,  0x85,  0x54,  0x25,  0x44,  0x00,  0x77
};
uint8_t rc_enc;
int rc_dec, i;
@@ -1014,21 +1014,21 @@
.id_list = {
{
.global = {
-   .lai = { .plmn = { .mcc = 0x123, .mnc = 
456 },
+   .lai = { .plmn = { .mcc = 123, .mnc = 
456 },
 .lac = 0x2342 },
.cell_identity = 1,
}
},
{
.global = {
-   .lai = { .plmn = { .mcc = 0x124, .mnc = 
457 },
+   .lai = { .plmn = { .mcc = 124, .mnc = 
457 },
 .lac = 0x2443 },
.cell_identity = 2,
}
},
{
.global = {
-   .lai = { .plmn = { .mcc = 0x125, .mnc = 
458 },
+   .lai = { .plmn = { .mcc = 125, .mnc = 
458 },
 .lac = 0x2544 },
.cell_identity = 119,
}

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

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


[MERGED] libosmocore[master]: gsm0808_test: cosmetic: re-arrange struct init; print hexdum...

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

Change subject: gsm0808_test: cosmetic: re-arrange struct init; print hexdump 
on failure
..


gsm0808_test: cosmetic: re-arrange struct init; print hexdump on failure

I am going to ehance the test to actually include leading-zero MNC, but first I
would like to simplify how the test source struct is initialized, before I edit
around in it.

Also, when the memcmp() fails, print hexdumps of expected and actual result for
comparison. I needed it to figure out a test failure, might as well keep it.

Change-Id: I77cd4b9142510c6914298b720d9c19ab68f9ebef
---
M tests/gsm0808/gsm0808_test.c
1 file changed, 32 insertions(+), 24 deletions(-)

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 c3c86dc..c25344a 100644
--- a/tests/gsm0808/gsm0808_test.c
+++ b/tests/gsm0808/gsm0808_test.c
@@ -1005,37 +1005,45 @@
0x92,  0x72,  0x54,  0x24,  0x43,  0x00,  0x2,
0x92,  0x83,  0x54,  0x25,  0x44,  0x00,  0x77
};
-   struct osmo_cell_global_id id;
uint8_t rc_enc;
int rc_dec, i;
 
-   memset(&enc_cil, 0, sizeof(enc_cil));
-
-   enc_cil.id_discr = CELL_IDENT_WHOLE_GLOBAL;
-
-   id.lai.plmn.mcc = 0x123;
-   osmo_mnc_from_str("456", &id.lai.plmn.mnc, &id.lai.plmn.mnc_3_digits);
-   id.lai.lac = 0x2342;
-   id.cell_identity = 1;
-   memcpy(&enc_cil.id_list[0].global, &id, sizeof(id));
-
-   id.lai.plmn.mcc = 0x124;
-   osmo_mnc_from_str("457", &id.lai.plmn.mnc, &id.lai.plmn.mnc_3_digits);
-   id.lai.lac = 0x2443;
-   id.cell_identity = 2;
-   memcpy(&enc_cil.id_list[1].global, &id, sizeof(id));
-
-   id.lai.plmn.mcc = 0x125;
-   osmo_mnc_from_str("458", &id.lai.plmn.mnc, &id.lai.plmn.mnc_3_digits);
-   id.lai.lac = 0x2544;
-   id.cell_identity = 119;
-   memcpy(&enc_cil.id_list[2].global, &id, sizeof(id));
-
-   enc_cil.id_list_len = 3;
+   enc_cil = (struct gsm0808_cell_id_list2){
+   .id_discr = CELL_IDENT_WHOLE_GLOBAL,
+   .id_list_len = 3,
+   .id_list = {
+   {
+   .global = {
+   .lai = { .plmn = { .mcc = 0x123, .mnc = 
456 },
+.lac = 0x2342 },
+   .cell_identity = 1,
+   }
+   },
+   {
+   .global = {
+   .lai = { .plmn = { .mcc = 0x124, .mnc = 
457 },
+.lac = 0x2443 },
+   .cell_identity = 2,
+   }
+   },
+   {
+   .global = {
+   .lai = { .plmn = { .mcc = 0x125, .mnc = 
458 },
+.lac = 0x2544 },
+   .cell_identity = 119,
+   }
+   },
+   }
+   };
 
msg = msgb_alloc(1024, "output buffer");
rc_enc = gsm0808_enc_cell_id_list2(msg, &enc_cil);
OSMO_ASSERT(rc_enc == sizeof(cil_enc_expected));
+   if (memcmp(cil_enc_expected, msg->data, msg->len)) {
+   printf("   got: %s\n", osmo_hexdump(msg->data, msg->len));
+   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(&dec_cil, msg->data + 2, msg->len - 
2);

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

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


[MERGED] libosmocore[master]: gsm_08_08: correct speech codec defaults

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

Change subject: gsm_08_08: correct speech codec defaults
..


gsm_08_08: correct speech codec defaults

The speech codec defaults are not correct. The defaults recommended
in 3GPP TS 28.062, Table 7.11.3.1.3-2 are limited by 3GPP TS 48.008,
Section 3.2.2.103. Some defaults are actually reserved for future
use. Also the endianess of the 16 bit values is reversed.

- correct values so that they match the specification
- transmit bytes in the correct endianess

Change-Id: I6c3a34d39a375d71c4128fd38f06629e8b98b100
---
M include/osmocom/gsm/protocol/gsm_08_08.h
M src/gsm/gsm0808_utils.c
M tests/gsm0808/gsm0808_test.c
3 files changed, 13 insertions(+), 13 deletions(-)

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



diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h 
b/include/osmocom/gsm/protocol/gsm_08_08.h
index 947f90f..4539b96 100644
--- a/include/osmocom/gsm/protocol/gsm_08_08.h
+++ b/include/osmocom/gsm/protocol/gsm_08_08.h
@@ -460,16 +460,16 @@
  *  configuration that is used on the air interface (Um).
  *
  *  Default values for FR_AMR, HR_AMR and OHR_AMR:
- *  See also: 3GPP TS 28.062, Table 7.11.3.1.3-2: Preferred
- *  Configurations for the Adaptive Multi-Rate Codec Types
+ *  See also: 3GPP TS 28.062, Table 7.11.3.1.3-2: Preferred Configurations for
+ *  the Adaptive Multi-Rate Codec Types and 3GPP TS 48.008, Section 3.2.2.103.
  *
  *  Default values for FR_AMR_WB, OFR_AMR_WB and OHR_AMR_WB:
  *  See also: 3GPP TS 26.103, Table 5.7-1: Allowed Configurations
  *  for the Adaptive Multi-Rate - Wideband Codec Types */
 enum gsm0808_speech_codec_defaults {
-   GSM0808_SC_CFG_DEFAULT_FR_AMR   = 0x,
+   GSM0808_SC_CFG_DEFAULT_FR_AMR   = 0x57ff,
GSM0808_SC_CFG_DEFAULT_HR_AMR   = 0x073f,
-   GSM0808_SC_CFG_DEFAULT_OHR_AMR  = 0x,
+   GSM0808_SC_CFG_DEFAULT_OHR_AMR  = 0x57ff,
GSM0808_SC_CFG_DEFAULT_FR_AMR_WB= 0x01,
GSM0808_SC_CFG_DEFAULT_OFR_AMR_WB   = 0x3f,
GSM0808_SC_CFG_DEFAULT_OHR_AMR_WB   = 0x01,
diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c
index b58a4b8..776f091 100644
--- a/src/gsm/gsm0808_utils.c
+++ b/src/gsm/gsm0808_utils.c
@@ -210,7 +210,7 @@
case GSM0808_SCT_FR3:
case GSM0808_SCT_HR3:
case GSM0808_SCT_HR6:
-   msgb_put_u16(msg, sc->cfg);
+   msgb_put_u16(msg, osmo_ntohs(sc->cfg));
break;
case GSM0808_SCT_FR4:
case GSM0808_SCT_FR5:
@@ -320,7 +320,7 @@
case GSM0808_SCT_HR6:
if (len < 2)
return -EINVAL;
-   sc->cfg = osmo_load16be(elem);
+   sc->cfg = osmo_load16le(elem);
elem += 2;
break;
default:
diff --git a/tests/gsm0808/gsm0808_test.c b/tests/gsm0808/gsm0808_test.c
index 4bd81b4..c3c86dc 100644
--- a/tests/gsm0808/gsm0808_test.c
+++ b/tests/gsm0808/gsm0808_test.c
@@ -88,7 +88,7 @@
0x00, 0x17, 0x57, 0x05, 0x08, 0x00, 0x77, 0x62,
0x83, 0x33, 0x66, 0x44, 0x88, 0x17, 0x01, 0x23,
GSM0808_IE_SPEECH_CODEC_LIST, 0x07, GSM0808_SCT_FR3 | 0x50,
-   0xcd, 0xef, GSM0808_SCT_FR2 | 0xa0, 0x9f,
+   0xef, 0xcd, GSM0808_SCT_FR2 | 0xa0, 0x9f,
GSM0808_SCT_CSD | 0x90, 0xc0
};
 
@@ -284,7 +284,7 @@
{ 0x00, 0x20, 0x01, 0x0b, 0x04, 0x01, 0x0b, 0xa1, 0x25, 0x01, 0x00,
  0x04, GSM0808_IE_AOIP_TRASP_ADDR, 0x06, 0xc0, 0xa8, 0x64, 0x17,
  0x04, 0xd2, GSM0808_IE_SPEECH_CODEC_LIST, 0x07,
- GSM0808_SCT_FR3 | 0x50, 0xcd, 0xef, GSM0808_SCT_FR2 | 0xa0, 0x9f,
+ GSM0808_SCT_FR3 | 0x50, 0xef, 0xcd, GSM0808_SCT_FR2 | 0xa0, 0x9f,
  GSM0808_SCT_CSD | 0x90, 0xc0, GSM0808_IE_CALL_ID, 0xaa, 0xbb,
  0xcc, 0xdd };
 
@@ -354,8 +354,8 @@
{ 0x00, 0x1d, 0x02, 0x15, 0x23, 0x21, 0x42, 0x2c, 0x11, 0x40, 0x22,
  GSM0808_IE_AOIP_TRASP_ADDR, 0x06, 0xc0, 0xa8, 0x64, 0x17, 0x04,
  0xd2, GSM0808_IE_SPEECH_CODEC, 0x01, GSM0808_SCT_HR1 | 0x90,
- GSM0808_IE_SPEECH_CODEC_LIST, 0x07, GSM0808_SCT_FR3 | 0x50, 0xcd,
- 0xef, GSM0808_SCT_FR2 | 0xa0, 0x9f, GSM0808_SCT_CSD | 0x90, 0xc0 
};
+ GSM0808_IE_SPEECH_CODEC_LIST, 0x07, GSM0808_SCT_FR3 | 0x50, 0xef,
+ 0xcd, GSM0808_SCT_FR2 | 0xa0, 0x9f, GSM0808_SCT_CSD | 0x90, 0xc0 
};
struct msgb *msg;
 
memset(&sin, 0, sizeof(sin));
@@ -402,12 +402,12 @@
 {
static const uint8_t res1[] =
{ 0x00, 0x0d, 0x03, 0x04, 0x01, 0x23, GSM0808_IE_SPEECH_CODEC_LIST,
- 0x07, GSM0808_SCT_FR3 | 0x50, 0xcd, 0xef, GSM0808_SCT_FR2 | 0xa0,
+ 0x07, GSM0808_SCT_FR3 | 0x50, 0xef, 0xcd, GSM0808_SCT_FR2 | 0xa0,
  0x9f, GSM0808_SCT_CSD | 

libosmocore[master]: gsm_08_08: correct speech codec defaults

2018-03-23 Thread Harald Welte

Patch Set 3: Code-Review+2

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

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


[PATCH] libosmocore[master]: gsm_08_08: correct speech codec defaults

2018-03-23 Thread dexter
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/7458

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

gsm_08_08: correct speech codec defaults

The speech codec defaults are not correct. The defaults recommended
in 3GPP TS 28.062, Table 7.11.3.1.3-2 are limited by 3GPP TS 48.008,
Section 3.2.2.103. Some defaults are actually reserved for future
use. Also the endianess of the 16 bit values is reversed.

- correct values so that they match the specification
- transmit bytes in the correct endianess

Change-Id: I6c3a34d39a375d71c4128fd38f06629e8b98b100
---
M include/osmocom/gsm/protocol/gsm_08_08.h
M src/gsm/gsm0808_utils.c
M tests/gsm0808/gsm0808_test.c
3 files changed, 13 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/58/7458/2

diff --git a/include/osmocom/gsm/protocol/gsm_08_08.h 
b/include/osmocom/gsm/protocol/gsm_08_08.h
index 947f90f..4539b96 100644
--- a/include/osmocom/gsm/protocol/gsm_08_08.h
+++ b/include/osmocom/gsm/protocol/gsm_08_08.h
@@ -460,16 +460,16 @@
  *  configuration that is used on the air interface (Um).
  *
  *  Default values for FR_AMR, HR_AMR and OHR_AMR:
- *  See also: 3GPP TS 28.062, Table 7.11.3.1.3-2: Preferred
- *  Configurations for the Adaptive Multi-Rate Codec Types
+ *  See also: 3GPP TS 28.062, Table 7.11.3.1.3-2: Preferred Configurations for
+ *  the Adaptive Multi-Rate Codec Types and 3GPP TS 48.008, Section 3.2.2.103.
  *
  *  Default values for FR_AMR_WB, OFR_AMR_WB and OHR_AMR_WB:
  *  See also: 3GPP TS 26.103, Table 5.7-1: Allowed Configurations
  *  for the Adaptive Multi-Rate - Wideband Codec Types */
 enum gsm0808_speech_codec_defaults {
-   GSM0808_SC_CFG_DEFAULT_FR_AMR   = 0x,
+   GSM0808_SC_CFG_DEFAULT_FR_AMR   = 0x57ff,
GSM0808_SC_CFG_DEFAULT_HR_AMR   = 0x073f,
-   GSM0808_SC_CFG_DEFAULT_OHR_AMR  = 0x,
+   GSM0808_SC_CFG_DEFAULT_OHR_AMR  = 0x57ff,
GSM0808_SC_CFG_DEFAULT_FR_AMR_WB= 0x01,
GSM0808_SC_CFG_DEFAULT_OFR_AMR_WB   = 0x3f,
GSM0808_SC_CFG_DEFAULT_OHR_AMR_WB   = 0x01,
diff --git a/src/gsm/gsm0808_utils.c b/src/gsm/gsm0808_utils.c
index b58a4b8..776f091 100644
--- a/src/gsm/gsm0808_utils.c
+++ b/src/gsm/gsm0808_utils.c
@@ -210,7 +210,7 @@
case GSM0808_SCT_FR3:
case GSM0808_SCT_HR3:
case GSM0808_SCT_HR6:
-   msgb_put_u16(msg, sc->cfg);
+   msgb_put_u16(msg, osmo_ntohs(sc->cfg));
break;
case GSM0808_SCT_FR4:
case GSM0808_SCT_FR5:
@@ -320,7 +320,7 @@
case GSM0808_SCT_HR6:
if (len < 2)
return -EINVAL;
-   sc->cfg = osmo_load16be(elem);
+   sc->cfg = osmo_load16le(elem);
elem += 2;
break;
default:
diff --git a/tests/gsm0808/gsm0808_test.c b/tests/gsm0808/gsm0808_test.c
index 4bd81b4..c3c86dc 100644
--- a/tests/gsm0808/gsm0808_test.c
+++ b/tests/gsm0808/gsm0808_test.c
@@ -88,7 +88,7 @@
0x00, 0x17, 0x57, 0x05, 0x08, 0x00, 0x77, 0x62,
0x83, 0x33, 0x66, 0x44, 0x88, 0x17, 0x01, 0x23,
GSM0808_IE_SPEECH_CODEC_LIST, 0x07, GSM0808_SCT_FR3 | 0x50,
-   0xcd, 0xef, GSM0808_SCT_FR2 | 0xa0, 0x9f,
+   0xef, 0xcd, GSM0808_SCT_FR2 | 0xa0, 0x9f,
GSM0808_SCT_CSD | 0x90, 0xc0
};
 
@@ -284,7 +284,7 @@
{ 0x00, 0x20, 0x01, 0x0b, 0x04, 0x01, 0x0b, 0xa1, 0x25, 0x01, 0x00,
  0x04, GSM0808_IE_AOIP_TRASP_ADDR, 0x06, 0xc0, 0xa8, 0x64, 0x17,
  0x04, 0xd2, GSM0808_IE_SPEECH_CODEC_LIST, 0x07,
- GSM0808_SCT_FR3 | 0x50, 0xcd, 0xef, GSM0808_SCT_FR2 | 0xa0, 0x9f,
+ GSM0808_SCT_FR3 | 0x50, 0xef, 0xcd, GSM0808_SCT_FR2 | 0xa0, 0x9f,
  GSM0808_SCT_CSD | 0x90, 0xc0, GSM0808_IE_CALL_ID, 0xaa, 0xbb,
  0xcc, 0xdd };
 
@@ -354,8 +354,8 @@
{ 0x00, 0x1d, 0x02, 0x15, 0x23, 0x21, 0x42, 0x2c, 0x11, 0x40, 0x22,
  GSM0808_IE_AOIP_TRASP_ADDR, 0x06, 0xc0, 0xa8, 0x64, 0x17, 0x04,
  0xd2, GSM0808_IE_SPEECH_CODEC, 0x01, GSM0808_SCT_HR1 | 0x90,
- GSM0808_IE_SPEECH_CODEC_LIST, 0x07, GSM0808_SCT_FR3 | 0x50, 0xcd,
- 0xef, GSM0808_SCT_FR2 | 0xa0, 0x9f, GSM0808_SCT_CSD | 0x90, 0xc0 
};
+ GSM0808_IE_SPEECH_CODEC_LIST, 0x07, GSM0808_SCT_FR3 | 0x50, 0xef,
+ 0xcd, GSM0808_SCT_FR2 | 0xa0, 0x9f, GSM0808_SCT_CSD | 0x90, 0xc0 
};
struct msgb *msg;
 
memset(&sin, 0, sizeof(sin));
@@ -402,12 +402,12 @@
 {
static const uint8_t res1[] =
{ 0x00, 0x0d, 0x03, 0x04, 0x01, 0x23, GSM0808_IE_SPEECH_CODEC_LIST,
- 0x07, GSM0808_SCT_FR3 | 0x50, 0xcd, 0xef, GSM0808_SCT_FR2 | 0xa0,
+ 0x07, GSM0808_SCT_FR3 | 0x50, 0xef, 0xcd, GSM0808_SCT_FR2 | 0xa0,
  0x9f, GSM0808_SCT_CSD | 0x90, 0xc0 };
static const uint8_t res2

libosmocore[master]: gsm_08_08: correct speech codec defaults

2018-03-23 Thread dexter

Patch Set 1:

> I'm not sure this is the right solution.  The structures we are
 > using  (like struct gsm0808_speech_codec) are parsed , host data
 > structures and not on-wire data structures.  So as a user, I would
 > expect the bits to be in host byte order.  If I want to enable e.g.
 > S11, then I expect to be able to do cfg |= (1 << 11).  The encoder
 > then has to convert this to network byte order, and the decoder has
 > to do the inverse.   Would you agree?

I thought it would be easier by just flipping the bytes, but yes, the encoder 
should handle that.

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

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


[MERGED] osmocom-bb[fixeria/trx]: trxcon/scheduler: share lchan link identifiers

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

Change subject: trxcon/scheduler: share lchan link identifiers
..


trxcon/scheduler: share lchan link identifiers

Change-Id: Ie1632f274b2ae6147a8e918ebfea60eeeb6a234c
---
M src/host/trxcon/sched_lchan_desc.c
M src/host/trxcon/sched_trx.h
2 files changed, 41 insertions(+), 41 deletions(-)

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



diff --git a/src/host/trxcon/sched_lchan_desc.c 
b/src/host/trxcon/sched_lchan_desc.c
index e94a208..37d1273 100644
--- a/src/host/trxcon/sched_lchan_desc.c
+++ b/src/host/trxcon/sched_lchan_desc.c
@@ -25,9 +25,6 @@
 
 #include "sched_trx.h"
 
-#define LID_DEDIC  0x00
-#define LID_SACCH  0x40
-
 /* TODO: implement */
 #define tx_pdtch_fnNULL
 #define tx_tchh_fn NULL
@@ -60,7 +57,7 @@
 const struct trx_lchan_desc trx_lchan_desc[_TRX_CHAN_MAX] = {
{
TRXC_IDLE,  "IDLE",
-   0x00,   LID_DEDIC,
+   0x00,   TRX_CH_LID_DEDIC,
0x00,   0x00,
 
/**
@@ -71,7 +68,7 @@
},
{
TRXC_FCCH,  "FCCH",
-   0x00,   LID_DEDIC,
+   0x00,   TRX_CH_LID_DEDIC,
0x00,   0x00,
 
/* FCCH is handled by transceiver */
@@ -79,7 +76,7 @@
},
{
TRXC_SCH,   "SCH",
-   0x00,   LID_DEDIC,
+   0x00,   TRX_CH_LID_DEDIC,
0x00,   TRX_CH_FLAG_AUTO,
 
/**
@@ -90,211 +87,211 @@
},
{
TRXC_BCCH,  "BCCH",
-   0x80,   LID_DEDIC,
+   0x80,   TRX_CH_LID_DEDIC,
4 * GSM_BURST_PL_LEN,   TRX_CH_FLAG_AUTO,
rx_data_fn, NULL,
},
{
TRXC_RACH,  "RACH",
-   0x88,   LID_DEDIC,
+   0x88,   TRX_CH_LID_DEDIC,
0x00,   TRX_CH_FLAG_AUTO,
NULL,   tx_rach_fn,
},
{
TRXC_CCCH,  "CCCH",
-   0x90,   LID_DEDIC,
+   0x90,   TRX_CH_LID_DEDIC,
4 * GSM_BURST_PL_LEN,   TRX_CH_FLAG_AUTO,
rx_data_fn, NULL,
},
{
TRXC_TCHF,  "TCH/F",
-   0x08,   LID_DEDIC,
+   0x08,   TRX_CH_LID_DEDIC,
8 * GSM_BURST_PL_LEN,   TRX_CH_FLAG_CBTX,
rx_tchf_fn, tx_tchf_fn,
},
{
TRXC_TCHH_0,"TCH/H(0)",
-   0x10,   LID_DEDIC,
+   0x10,   TRX_CH_LID_DEDIC,
6 * GSM_BURST_PL_LEN,   TRX_CH_FLAG_CBTX,
rx_tchh_fn, tx_tchh_fn,
},
{
TRXC_TCHH_1,"TCH/H(1)",
-   0x18,   LID_DEDIC,
+   0x18,   TRX_CH_LID_DEDIC,
6 * GSM_BURST_PL_LEN,   TRX_CH_FLAG_CBTX,
rx_tchh_fn, tx_tchh_fn,
},
{
TRXC_SDCCH4_0,  "SDCCH/4(0)",
-   0x20,   LID_DEDIC,
+   0x20,   TRX_CH_LID_DEDIC,
4 * GSM_BURST_PL_LEN,   TRX_CH_FLAG_CBTX,
rx_data_fn, tx_data_fn,
},
{
TRXC_SDCCH4_1,  "SDCCH/4(1)",
-   0x28,   LID_DEDIC,
+   0x28,   TRX_CH_LID_DEDIC,
4 * GSM_BURST_PL_LEN,   TRX_CH_FLAG_CBTX,
rx_data_fn, tx_data_fn,
},
{
TRXC_SDCCH4_2,  "SDCCH/4(2)",
-   0x30,   LID_DEDIC,
+   0x30,   TRX_CH_LID_DEDIC,
4 * GSM_BURST_PL_LEN,   TRX_CH_FLAG_CBTX,
rx_data_fn, tx_data_fn,
},
{
TRXC_SDCCH4_3,  "SDCCH/4(3)",
-   0x38,   LID_DEDIC,
+   0x38,   TRX_CH_LID_DEDIC,
4 * GSM_BURST_PL_LEN,   TRX_CH_FLAG_CBTX,
rx_data_fn, tx_data_fn,
},
{
TRXC_SDCCH8_0,  "SDCCH/8(0)",
-   0x40,   LID_DEDIC,
+   0x40,   TRX_CH_LID_DEDIC,
4 * GSM_BURST_PL_LEN,   TRX_CH_FLAG_CBTX,
rx_data_fn, tx_data_fn,
 

osmocom-bb[fixeria/trx]: trxcon/scheduler: fix Measurement Reporting on SACCH

2018-03-23 Thread Harald Welte

Patch Set 1:

Please look at jolly branches, he had implemented measurement reporting and 
handover with real l1 some years back

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

Gerrit-MessageType: comment
Gerrit-Change-Id: If1b8dc74ced746d6270676fdde75fcda32f91a3d
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: fixeria/trx
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-HasComments: No


[MERGED] osmocom-bb[fixeria/trx]: trxcon/sched_prim.c: fix: correct the first padding byte

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

Change subject: trxcon/sched_prim.c: fix: correct the first padding byte
..


trxcon/sched_prim.c: fix: correct the first padding byte

According to TS 144.006, section 5.2, the first octet containing
fill bits shall be set to the binary value "00101011" == 0x2b.

Change-Id: I8f0304bf84613a2dc07cb78aff0cb8bb4c5adf6c
---
M src/host/trxcon/sched_prim.c
1 file changed, 10 insertions(+), 9 deletions(-)

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



diff --git a/src/host/trxcon/sched_prim.c b/src/host/trxcon/sched_prim.c
index c17fb2a..e1c87bb 100644
--- a/src/host/trxcon/sched_prim.c
+++ b/src/host/trxcon/sched_prim.c
@@ -251,7 +251,7 @@
 * and with an information field of 0 octet length.
 */
static const uint8_t lapdm_fill_frame[] = {
-   0x01, 0x03, 0x01,
+   0x01, 0x03, 0x01, 0x2b,
/* Pending part is to be randomized */
};
 
@@ -275,15 +275,16 @@
/* FIXME: should we do anything for CSD? */
return 0;
} else {
-   /**
-* TS 144.006, section 8.1.2.3 "Fill frames"
-* A fill frame is a UI command frame for SAPI 0, P=0
-* and with an information field of 0 octet length.
-*/
-   memcpy(prim_buffer, lapdm_fill_frame, 3);
+   /* Copy a fill frame payload */
+   memcpy(prim_buffer, lapdm_fill_frame, sizeof(lapdm_fill_frame));
 
-   /* Randomize pending unused bytes */
-   for (i = 3; i < GSM_MACBLOCK_LEN; i++)
+   /**
+* TS 144.006, section 5.2 "Frame delimitation and fill bits"
+* Except for the first octet containing fill bits which shall
+* be set to the binary value "00101011", each fill bit should
+* be set to a random value when sent by the network.
+*/
+   for (i = sizeof(lapdm_fill_frame); i < GSM_MACBLOCK_LEN; i++)
prim_buffer[i] = (uint8_t) rand();
 
/* Define a prim length */

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I8f0304bf84613a2dc07cb78aff0cb8bb4c5adf6c
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: fixeria/trx
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


[MERGED] osmocom-bb[fixeria/trx]: trxcon/scheduler: add CHAN_IS_SACCH macro

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

Change subject: trxcon/scheduler: add CHAN_IS_SACCH macro
..


trxcon/scheduler: add CHAN_IS_SACCH macro

Change-Id: I2fc90d4732433f221c628058c9812815edf9c8cb
---
M src/host/trxcon/sched_trx.h
1 file changed, 3 insertions(+), 0 deletions(-)

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



diff --git a/src/host/trxcon/sched_trx.h b/src/host/trxcon/sched_trx.h
index bba8bcf..ce1c7f4 100644
--- a/src/host/trxcon/sched_trx.h
+++ b/src/host/trxcon/sched_trx.h
@@ -292,6 +292,9 @@
 #define CHAN_IS_TCH(chan) \
(chan == TRXC_TCHF || chan == TRXC_TCHH_0 || chan == TRXC_TCHH_1)
 
+#define CHAN_IS_SACCH(chan) \
+   (trx_lchan_desc[chan].link_id & TRX_CH_LID_SACCH)
+
 #define PRIM_IS_TCH(prim) \
CHAN_IS_TCH(prim->chan) && prim->payload_len != GSM_MACBLOCK_LEN
 

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2fc90d4732433f221c628058c9812815edf9c8cb
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: fixeria/trx
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder


osmocom-bb[fixeria/trx]: trxcon/sched_prim.c: fix: correct the first padding byte

2018-03-23 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I8f0304bf84613a2dc07cb78aff0cb8bb4c5adf6c
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: fixeria/trx
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmocom-bb[fixeria/trx]: trxcon/scheduler: add CHAN_IS_SACCH macro

2018-03-23 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I2fc90d4732433f221c628058c9812815edf9c8cb
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: fixeria/trx
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


osmocom-bb[fixeria/trx]: trxcon/scheduler: share lchan link identifiers

2018-03-23 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ie1632f274b2ae6147a8e918ebfea60eeeb6a234c
Gerrit-PatchSet: 1
Gerrit-Project: osmocom-bb
Gerrit-Branch: fixeria/trx
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-HasComments: No


[MERGED] osmo-ttcn3-hacks[master]: RSL_Emulation: Introduce LastActTable

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

Change subject: RSL_Emulation: Introduce LastActTable
..


RSL_Emulation: Introduce LastActTable

The LastActTable stores a copy of the decoded RSL CHAN_ACT for
each channel number.  This can be used by a RSL_DchanHandler to
learn parameters of its own activation.

Change-Id: I629d66e27cbe4c8b02e704a7181b3bff843e9aa4
---
M library/RSL_Emulation.ttcn
1 file changed, 70 insertions(+), 2 deletions(-)

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



diff --git a/library/RSL_Emulation.ttcn b/library/RSL_Emulation.ttcn
index 635ee42..20a54a9 100644
--- a/library/RSL_Emulation.ttcn
+++ b/library/RSL_Emulation.ttcn
@@ -10,7 +10,13 @@
  * Outbound RSL connections are initiated by sending a RSLDC_ChanRqd primitive
  * to the component running the RSL_Emulation.main() function.
  *
- * (C) 2017 by Harald Welte 
+ * in case we're emulating the BTS-side of RSL: We have no clue as to which 
particular logical
+ * channel the BSC may decide to activate at which point, so we have to 
blindly acknowledge all
+ * channel activations.  Still, a test case might be interested in the exact 
assignment message to
+ * determine the type of activation, encryption, codec flags etc. at some 
later point, when it's
+ * clear for which transaction this activation happened.  We keep this in the 
LastChanAct table.
+ *
+ * (C) 2017-2018 by Harald Welte 
  * All rights reserved.
  *
  * Released under the terms of GNU General Public License, Version 2 or
@@ -60,9 +66,10 @@
 signature RSLEM_register(uint8_t trx_nr, RslChannelNr chan_nr, RSL_DchanHdlr 
hdlr);
 signature RSLEM_unregister(uint8_t trx_nr, RslChannelNr chan_nr, RSL_DchanHdlr 
hdlr);
 signature RSLEM_suspend(boolean suspend);
+signature RSLEM_get_last_act(in uint8_t trx_nr, in RslChannelNr chan_nr, out 
RSL_Message chan_act);
 
 type port RSLEM_PROC_PT procedure {
-   inout RSLEM_register, RSLEM_unregister, RSLEM_suspend;
+   inout RSLEM_register, RSLEM_unregister, RSLEM_suspend, 
RSLEM_get_last_act;
 } with { extension "internal" };
 
 /***
@@ -240,6 +247,46 @@
ConnectionTable[cid].comp_ref := null;
 }
 
+/* last activation for a given channel number */
+type record LastActData {
+   uint8_t trx_nr optional,
+   RslChannelNrchan_nr optional,
+   RSL_Message chan_act optional
+}
+
+private function f_store_last_act_data(uint8_t trx_nr, RslChannelNr chan_nr, 
RSL_Message chan_act)
+runs on RSL_Emulation_CT {
+   for (var integer i := 0; i < sizeof(LastActTable); i := i+1) {
+   if (not ispresent(LastActTable[i].chan_nr) or
+   (LastActTable[i].chan_nr == chan_nr and 
LastActTable[i].trx_nr == trx_nr)) {
+   LastActTable[i].trx_nr := trx_nr;
+   LastActTable[i].chan_nr := chan_nr;
+   LastActTable[i].chan_act := chan_act;
+   return;
+   }
+   }
+   setverdict(fail, "No space left in LastActTable to store chan_act for 
", chan_nr);
+   self.stop;
+}
+
+private function f_lookup_last_act(uint8_t trx_nr, RslChannelNr chan_nr)
+runs on RSL_Emulation_CT return RSL_Message {
+   for (var integer i := 0; i < sizeof(LastActTable); i := i+1) {
+   if (ispresent(LastActTable[i].chan_nr) and 
LastActTable[i].chan_nr == chan_nr
+   and LastActTable[i].trx_nr == trx_nr) {
+   return LastActTable[i].chan_act;
+   }
+   }
+   setverdict(fail, "No LastActTable entry found for TRX ", trx_nr, " ", 
chan_nr);
+   self.stop;
+}
+
+private function f_last_act_table_init() runs on RSL_Emulation_CT {
+   for (var integer i := 0; i < sizeof(LastActTable); i := i+1) {
+   LastActTable[i] := { omit, omit, omit };
+   }
+}
+
 type component RSL_Emulation_CT {
/* port facing down towards IPA emulation */
port IPA_RSL_PT IPA_PT;
@@ -252,6 +299,9 @@
 
/* state of all concurrent connections / dedicated channels */
var ConnectionData ConnectionTable[64];
+
+   /* last RSL CHAN ACT for each chan_nr */
+   var LastActData LastActTable[64];
 }
 
 
@@ -290,6 +340,7 @@
var boolean dchan_suspended := false;
 
f_conn_table_init();
+   f_last_act_table_init();
 
while (true) {
alt {
@@ -364,6 +415,8 @@
/* blindly acknowledge all channel activations */
[bts_role] 
IPA_PT.receive(tr_RSL(tr_RSL_MsgTypeD(RSL_MT_CHAN_ACTIV))) -> value rx_rsl {
chan_nr := rx_rsl.rsl.ies[0].body.chan_nr;
+   trx_nr := f_trx_by_streamId(rx_rsl.streamId);
+   f_store_last_act_data(trx_nr, chan_nr, rx_rsl.rsl);
IPA_PT.send(ts_ASP_RSL_UD(rx_rsl.st

[MERGED] osmo-ttcn3-hacks[master]: sip: Add SIP_Emulation and first osmo-sip-connector test case

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

Change subject: sip: Add SIP_Emulation and first osmo-sip-connector test case
..


sip: Add SIP_Emulation and first osmo-sip-connector test case

Change-Id: Ifd47b0d48c609b4a678ea47aa7f89f5c12e6c0d2
---
M library/MNCC_Emulation.ttcn
M library/MNCC_Types.ttcn
A library/SIP_Emulation.ttcn
A sip/SIP_Tests.cfg
A sip/SIP_Tests.default
A sip/SIP_Tests.ttcn
A sip/gen_links.sh
A sip/regen_makefile.sh
8 files changed, 769 insertions(+), 9 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 60ec58b..856575e 100644
--- a/library/MNCC_Emulation.ttcn
+++ b/library/MNCC_Emulation.ttcn
@@ -193,7 +193,7 @@
 }
 
 
-function f_connect(charstring sock) runs on MNCC_Emulation_CT {
+private function f_connect(charstring sock) runs on MNCC_Emulation_CT {
var UD_connect_result res;
timer T := 5.0;
 
@@ -215,6 +215,40 @@
}
 }
 
+private function f_listen(charstring sock) runs on MNCC_Emulation_CT {
+   var UD_listen_result res;
+   var UD_connected udc;
+   timer T := 5.0;
+
+   T.start;
+   MNCC.send(UD_listen:{sock});
+   alt {
+   [] MNCC.receive(UD_listen_result:?) -> value res {
+   if (ispresent(res.result) and ispresent(res.result.result_code) 
and res.result.result_code == ERROR) {
+   setverdict(fail, "Error listening to MNCC socket", res);
+   self.stop;
+   } else {
+   g_mncc_ud_id := res.id;
+   }
+   }
+   [] T.timeout {
+   setverdict(fail, "Timeout listening to MNCC socket");
+   self.stop;
+   }
+   }
+
+   T.start;
+   alt {
+   [] MNCC.receive(UD_connected:?) -> value udc {
+   g_mncc_ud_id := res.id;
+   }
+   [] T.timeout {
+   setverdict(fail, "Timeout waiting for MNCC connection");
+   self.stop;
+   }
+   }
+}
+
 /* call-back type, to be provided by specific implementation; called when new 
SCCP connection
  * arrives */
 type function MnccCreateCallback(MNCC_PDU conn_ind, charstring id)
@@ -228,9 +262,14 @@
MnccUnitdataCallback unitdata_cb
 }
 
-function main(MnccOps ops, charstring id, charstring sock) runs on 
MNCC_Emulation_CT {
+function main(MnccOps ops, charstring id, charstring sock, boolean role_server 
:= false)
+runs on MNCC_Emulation_CT {
 
-   f_connect(sock);
+   if (role_server) {
+   f_listen(sock);
+   } else {
+   f_connect(sock);
+   }
f_expect_table_init();
f_call_table_init();
 
@@ -289,15 +328,19 @@
f_call_table_del(call_id);
}
 
-   /* Client -> MNCC Socket: SETUP.req: forward + add call table 
entry */
-   [] MNCC_CLIENT.receive(MNCC_PDU:{msg_type := MNCC_SETUP_REQ, 
u:=?}) -> value mncc sender vc_conn {
-   /* add to call table */
-   f_call_table_add(vc_conn, f_mncc_get_call_id(mncc));
+   /* Client -> MNCC Socket: Normal message */
+   [] MNCC_CLIENT.receive(MNCC_PDU:?) -> value mncc sender vc_conn 
{
+   if (mncc.msg_type == MNCC_SETUP_REQ and not 
role_server) {
+   /* ConnHdlr -> MNCC Server: SETUP.req: add to 
call table */
+   f_call_table_add(vc_conn, 
f_mncc_get_call_id(mncc));
+   } else if (mncc.msg_type == MNCC_SETUP_IND and 
role_server) {
+   /* ConnHdlr -> MNCC Client: SETUP.ind: add to 
call table */
+   f_call_table_add(vc_conn, 
f_mncc_get_call_id(mncc));
+   }
/* forward to MNCC socket */
MNCC.send(t_SD_MNCC(g_mncc_ud_id, mncc));
}
 
-   /* Client -> MNCC Socket: Normal message */
[] MNCC_CLIENT.receive(MNCC_PDU:?) -> value mncc sender vc_conn 
{
/* forward to MNCC socket */
MNCC.send(t_SD_MNCC(g_mncc_ud_id, mncc));
diff --git a/library/MNCC_Types.ttcn b/library/MNCC_Types.ttcn
index 001b4b8..8d47efb 100644
--- a/library/MNCC_Types.ttcn
+++ b/library/MNCC_Types.ttcn
@@ -561,7 +561,38 @@
lchan_mode := ?
}
}
-
+}
+template (value) MNCC_PDU ts_MNCC_SETUP_ind(uint32_t call_id, MNCC_number 
called,
+   template (omit) MNCC_number calling := omit,
+   template (omit) charstring imsi := omit,
+   template (value) MNCC_bearer_cap bcap := 
ts_MNCC_bcap_voice) := {
+   msg_type := MNCC_SETUP_I

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

2018-03-23 Thread Harald Welte
Harald Welte has abandoned this change.

Change subject: WIP: SIP progress
..


Abandoned

Pushed by accident

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

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


[MERGED] osmo-ttcn3-hacks[master]: bsc: TC_assignment_codec_*: Verify RSL side codec/mode

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

Change subject: bsc: TC_assignment_codec_*: Verify RSL side codec/mode
..


bsc: TC_assignment_codec_*: Verify RSL side codec/mode

Let's not only match if the BSSMAP ASSIGNMENT COMPL matches what codec
was requested in BSSMAP ASSIGNMENT CMD, but also verify that the
RSL side channel was activated with the right channel mode IE.

Change-Id: I6ef24b5b82a5c100e056adadd26e69b968b9
---
M bsc/BSC_Tests.ttcn
1 file changed, 52 insertions(+), 0 deletions(-)

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



diff --git a/bsc/BSC_Tests.ttcn b/bsc/BSC_Tests.ttcn
index ea67105..d392a71 100644
--- a/bsc/BSC_Tests.ttcn
+++ b/bsc/BSC_Tests.ttcn
@@ -1652,6 +1652,45 @@
return ret;
 }
 
+private function f_rsl_chmod_tmpl_from_codec(BSSMAP_FIELD_CodecElement a_elem)
+return template RSL_IE_Body {
+   var template RSL_IE_Body mode_ie := {
+   chan_mode := {
+   len := ?,
+   reserved := ?,
+   dtx_d := ?,
+   dtx_u := ?,
+   spd_ind := RSL_SPDI_SPEECH,
+   ch_rate_type := -,
+   coding_alg_rate := -
+   }
+   }
+
+   select (a_elem.codecType) {
+   case (GSM_FR) {
+   mode_ie.chan_mode.ch_rate_type := RSL_CHRT_TCH_F;
+   mode_ie.chan_mode.coding_alg_rate := RSL_CMOD_SP_GSM1;
+   }
+   case (GSM_HR) {
+   mode_ie.chan_mode.ch_rate_type := RSL_CHRT_TCH_H;
+   mode_ie.chan_mode.coding_alg_rate := RSL_CMOD_SP_GSM1;
+   }
+   case (GSM_EFR) {
+   mode_ie.chan_mode.ch_rate_type := RSL_CHRT_TCH_F;
+   mode_ie.chan_mode.coding_alg_rate := RSL_CMOD_SP_GSM2;
+   }
+   case (FR_AMR) {
+   mode_ie.chan_mode.ch_rate_type := RSL_CHRT_TCH_F;
+   mode_ie.chan_mode.coding_alg_rate := RSL_CMOD_SP_GSM3;
+   }
+   case (HR_AMR) {
+   mode_ie.chan_mode.ch_rate_type := RSL_CHRT_TCH_H;
+   mode_ie.chan_mode.coding_alg_rate := RSL_CMOD_SP_GSM3;
+   }
+   }
+   return mode_ie;
+}
+
 type record CodecListTest {
BSSMAP_IE_SpeechCodecList codec_list,
charstring id
@@ -1672,6 +1711,19 @@
log("expecting ASS COMPL like this: ", exp_compl);
 
f_establish_fully(ass_cmd, exp_compl);
+
+   /* Verify that the RSL-side activation actually matches our 
expectations */
+   var RSL_Message rsl := f_rslem_get_last_act(RSL_PROC, 0, g_chan_nr);
+
+   var RSL_IE_Body mode_ie;
+   if (f_rsl_find_ie(rsl, RSL_IE_CHAN_MODE, mode_ie) == false) {
+   setverdict(fail, "Couldn't find CHAN_MODE IE");
+   self.stop;
+   }
+   var template RSL_IE_Body t_mode_ie := 
f_rsl_chmod_tmpl_from_codec(g_pars.ass_codec_list.codecElements[0]);
+   if (not match(mode_ie, t_mode_ie)) {
+   setverdict(fail, "RSL Channel Mode IE doesn't match 
expectation");
+   }
 }
 
 testcase TC_assignment_codec_fr() runs on test_CT {

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

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


osmo-ttcn3-hacks[master]: RSL_Emulation: Introduce LastActTable

2018-03-23 Thread Harald Welte

Patch Set 2: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I629d66e27cbe4c8b02e704a7181b3bff843e9aa4
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]: sip: Add SIP_Emulation and first osmo-sip-connector test case

2018-03-23 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifd47b0d48c609b4a678ea47aa7f89f5c12e6c0d2
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


libosmocore[master]: show failure in gsm0808_enc_cell_id_list2() in gsm0808_test

2018-03-23 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I763b18d2922701ad97382269747ff0cbb7bd657b
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-HasComments: No


osmo-ttcn3-hacks[master]: bsc: TC_assignment_codec_*: Verify RSL side codec/mode

2018-03-23 Thread Harald Welte

Patch Set 2: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I6ef24b5b82a5c100e056adadd26e69b968b9
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


libosmocore[master]: gsm0808_test: cosmetic: test non-hex MCC

2018-03-23 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I973835c54a90fefe50d2b3581324d12556715f58
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-HasComments: No


libosmocore[master]: fix gsm0808_enc_cell_id_list2 for leading-zero MNC

2018-03-23 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I1ce78883995e0d484368046b69db5afb2b4adc97
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-HasComments: No


libosmocore[master]: gsm0808_test: cosmetic: re-arrange struct init; print hexdum...

2018-03-23 Thread Harald Welte

Patch Set 1: Code-Review+2

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

Gerrit-MessageType: comment
Gerrit-Change-Id: I77cd4b9142510c6914298b720d9c19ab68f9ebef
Gerrit-PatchSet: 1
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-HasComments: No