Change in osmo-gsm-tester[master]: Revert "modem: workaround ofono crash"

2019-04-08 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13550 )

Change subject: Revert "modem: workaround ofono crash"
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: osmo-gsm-tester
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I884f6d4f3df4f3b4e2ac05e4dba2ad8704697521
Gerrit-Change-Number: 13550
Gerrit-PatchSet: 1
Gerrit-Owner: Pau Espin Pedrol 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Tue, 09 Apr 2019 06:33:49 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-ci[master]: jenkins docker: Install lcov and lcov-cobertura

2019-04-08 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13551 )

Change subject: jenkins docker: Install lcov and lcov-cobertura
..


Patch Set 1:

Hi Vasil,

could you outline somewhere (mailinglist? maybe a wiki page?) how this would 
work together?  This Dockerfile which you're patching is used for build 
verification of gerrit patches.  Do you want to run coverage reports on every 
build of every patch before commit?

I would argue it makes more sense to have coverage reports done once per day?

I really appreciate you investing time on this, I just want to know how 
everything fits together before merging individual changes before knowing the 
bigger picture.  Thanks!


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

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I26896a9807e756b1f935cd3ed524d25ee22efaed
Gerrit-Change-Number: 13551
Gerrit-PatchSet: 1
Gerrit-Owner: Vasil Velichkov 
Gerrit-CC: Harald Welte 
Gerrit-Comment-Date: Tue, 09 Apr 2019 06:32:28 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in libosmocore[master]: Add code coverage support

2019-04-08 Thread Vasil Velichkov
Vasil Velichkov has posted comments on this change. ( 
https://gerrit.osmocom.org/13496 )

Change subject: Add code coverage support
..


Patch Set 4:

> https://jenkins.osmocom.org/jenkins/job/gerrit-libosmocore/1795/ : FAILURE

> checking for lcov... no
checking for genhtml... no
configure: error: To enable code coverage reporting you must have lcov installed

Just added installation of lcov and lcov_cobertura to 
osmo-ci/docker/Dockerfile_osmocom_jenkins.amd64 in 
https://gerrit.osmocom.org/c/osmo-ci/+/13551


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I6f4ffb91bd7f3dd070aa09dd16d5ad1faf130a4c
Gerrit-Change-Number: 13496
Gerrit-PatchSet: 4
Gerrit-Owner: Vasil Velichkov 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: Vasil Velichkov 
Gerrit-Comment-Date: Tue, 09 Apr 2019 03:28:44 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-ci[master]: jenkins docker: Install lcov and lcov-cobertura

2019-04-08 Thread Vasil Velichkov
Vasil Velichkov has uploaded this change for review. ( 
https://gerrit.osmocom.org/13551


Change subject: jenkins docker: Install lcov and lcov-cobertura
..

jenkins docker: Install lcov and lcov-cobertura

They are used for generating code coverage reports

Change-Id: I26896a9807e756b1f935cd3ed524d25ee22efaed
---
M docker/Dockerfile_osmocom_jenkins.amd64
1 file changed, 4 insertions(+), 0 deletions(-)



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

diff --git a/docker/Dockerfile_osmocom_jenkins.amd64 
b/docker/Dockerfile_osmocom_jenkins.amd64
index f87d80d..3f499ad 100644
--- a/docker/Dockerfile_osmocom_jenkins.amd64
+++ b/docker/Dockerfile_osmocom_jenkins.amd64
@@ -66,3 +66,7 @@
 dpkg-reconfigure --frontend=noninteractive locales && \
 update-locale LANG=en_US.UTF-8
 ENV LANG en_US.UTF-8
+
+# Code coverage tools
+RUN DEBIAN_FRONTEND=noninteractive apt-get install -y lcov
+RUN pip3 install git+https://github.com/eriwen/lcov-to-cobertura-xml/

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

Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I26896a9807e756b1f935cd3ed524d25ee22efaed
Gerrit-Change-Number: 13551
Gerrit-PatchSet: 1
Gerrit-Owner: Vasil Velichkov 


Change in osmo-pcu[master]: Fix help message formatting of osmo-pcu.

2019-04-08 Thread Rafael Diniz
Rafael Diniz has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13542 )

Change subject: Fix help message formatting of osmo-pcu.
..

Fix help message formatting of osmo-pcu.

Change-Id: If4ecf9be5a0739bb54aedb077eda51ad091b4c3f
---
M src/pcu_main.cpp
1 file changed, 8 insertions(+), 8 deletions(-)

Approvals:
  Vadim Yanitskiy: Looks good to me, approved
  Rafael Diniz: Looks good to me, but someone else must approve
  Jenkins Builder: Verified



diff --git a/src/pcu_main.cpp b/src/pcu_main.cpp
index c39c337..1003e3c 100644
--- a/src/pcu_main.cpp
+++ b/src/pcu_main.cpp
@@ -65,20 +65,20 @@

 static void print_help()
 {
-   printf( "Some useful options:\n"
-   "  -h   --help  this text\n"
+   printf( "Options:\n"
+   "  -h   --help  This text\n"
"  -c   --config-file   Specify the filename of the config "
"file\n"
-   "  -m   --mcc MCC   use given MCC instead of value "
+   "  -m   --mcc MCC   Use given MCC instead of value "
"provided by BTS\n"
-   "  -n   --mnc MNC   use given MNC instead of value "
+   "  -n   --mnc MNC   Use given MNC instead of value "
"provided by BTS\n"
-   "  -V   --version   print version\n"
-   "  -r   --realtime PRIO Use SCHED_RR with the specified "
+   "  -V   --version   Print version\n"
+   "  -r   --realtime PRIO Use SCHED_RR with the specified "
"priority\n"
-   "  -D   --daemonize Fork the process into a background"
+   "  -D   --daemonize Fork the process into a background "
"daemon\n"
-   "  -i   --gsmtap-ip The destination IP used for GSMTAP.\n"
+   "  -i   --gsmtap-ip The destination IP used for GSMTAP\n"
);
 }


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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: If4ecf9be5a0739bb54aedb077eda51ad091b4c3f
Gerrit-Change-Number: 13542
Gerrit-PatchSet: 4
Gerrit-Owner: Rafael Diniz 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Rafael Diniz 
Gerrit-Reviewer: Vadim Yanitskiy 


Change in osmo-gsm-tester[master]: Revert "modem: workaround ofono crash"

2019-04-08 Thread Pau Espin Pedrol
Pau Espin Pedrol has uploaded this change for review. ( 
https://gerrit.osmocom.org/13550


Change subject: Revert "modem: workaround ofono crash"
..

Revert "modem: workaround ofono crash"

We already updated our ofono branch to current master (after 1.28),
and this fix is not longer required, as stated in ticket OS#3064.

Related: OS#3064
This reverts commit f8d12196f05b20aa28b3103db26ea37ba6849362.

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



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

diff --git a/src/osmo_gsm_tester/modem.py b/src/osmo_gsm_tester/modem.py
index 7e58e32..2d539eb 100644
--- a/src/osmo_gsm_tester/modem.py
+++ b/src/osmo_gsm_tester/modem.py
@@ -590,7 +590,6 @@
 req_ifaces = self._required_ifaces()
 if self.is_powered():
 self.dbg('Power cycling')
-MainLoop.sleep(self, 1.0) # workaround for ofono bug OS#3064
 self.power_off()
 else:
 self.dbg('Powering on')

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

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


Change in osmo-hlr[master]: USSD: fix routing to multiple MSC

2019-04-08 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/13479 )

Change subject: USSD: fix routing to multiple MSC
..


Patch Set 8:

(2 comments)

Just a few final recommendations, looks fine to me ;)

https://gerrit.osmocom.org/#/c/13479/8/src/hlr_ussd.c
File src/hlr_ussd.c:

https://gerrit.osmocom.org/#/c/13479/8/src/hlr_ussd.c@239
PS8, Line 239: for IMSI %s
This is redundant, LOGPSS() does print IMSI.


https://gerrit.osmocom.org/#/c/13479/8/src/hlr_ussd.c@248
PS8, Line 248: LOGP
LOGPSS()? There will be no need to print "for subscriber %s...".



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

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3
Gerrit-Change-Number: 13479
Gerrit-PatchSet: 8
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Mon, 08 Apr 2019 17:47:39 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-hlr[master]: Cosmetic: gsup_route_find: comment addr, addrlen

2019-04-08 Thread osmith
osmith has posted comments on this change. ( https://gerrit.osmocom.org/13549 )

Change subject: Cosmetic: gsup_route_find: comment addr, addrlen
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ib79878970bd07caac6eb921af8ae95403b90a4cb
Gerrit-Change-Number: 13549
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Mon, 08 Apr 2019 15:34:58 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-hlr[master]: Cosmetic: gsup_route_find: comment addr, addrlen

2019-04-08 Thread osmith
osmith has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13549 )

Change subject: Cosmetic: gsup_route_find: comment addr, addrlen
..

Cosmetic: gsup_route_find: comment addr, addrlen

Describe the addr, addrlen parameters in gsup_route_find() and (more
commonly used) osmo_gsup_addr_send(). Without this description, it is
easy to get the parameters wrong and have routes not being found, as
shown with debug prints like these:

gsup_route_find: addr, addrlen: "MSC-13-37-00-00-00-00", 21
gsup_route_find: comparing with: "MSC-13-37-00-00-00-00\0", 22

Change-Id: Ib79878970bd07caac6eb921af8ae95403b90a4cb
---
M src/gsup_router.c
M src/gsup_send.c
2 files changed, 15 insertions(+), 2 deletions(-)

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



diff --git a/src/gsup_router.c b/src/gsup_router.c
index 16ea202..4fedd38 100644
--- a/src/gsup_router.c
+++ b/src/gsup_router.c
@@ -33,7 +33,13 @@
struct osmo_gsup_conn *conn;
 };

-/* find a route for the given address */
+/*! Find a route for the given address.
+ * \param[in] gs gsup server
+ * \param[in] addr IPA name of the client (SGSN, MSC/VLR). Although this is 
passed like a blob, together with the
+ * length, it must be nul-terminated! This is for legacy 
reasons, see the discussion here:
+ * https://gerrit.osmocom.org/#/c/osmo-hlr/+/13048/
+ * \param[in] addrlen length of addr, *including the nul-byte* (strlen(addr) + 
1).
+ */
 struct osmo_gsup_conn *gsup_route_find(struct osmo_gsup_server *gs,
const uint8_t *addr, size_t addrlen)
 {
diff --git a/src/gsup_send.c b/src/gsup_send.c
index b2c4e02..889cf63 100644
--- a/src/gsup_send.c
+++ b/src/gsup_send.c
@@ -26,7 +26,14 @@

 #include 

-/* Send a msgb to a given address using routing */
+/*! Send a msgb to a given address using routing.
+ * \param[in] gs gsup server
+ * \param[in] addr IPA name of the client (SGSN, MSC/VLR). Although this is 
passed like a blob, together with the
+ * length, it must be nul-terminated! This is for legacy 
reasons, see the discussion here:
+ * https://gerrit.osmocom.org/#/c/osmo-hlr/+/13048/
+ * \param[in] addrlen length of addr, *including the nul-byte* (strlen(addr) + 
1).
+ * \param[in] msg message buffer
+ */
 int osmo_gsup_addr_send(struct osmo_gsup_server *gs,
const uint8_t *addr, size_t addrlen,
struct msgb *msg)

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

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib79878970bd07caac6eb921af8ae95403b90a4cb
Gerrit-Change-Number: 13549
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: osmith 


Change in osmo-hlr[master]: USSD: save MO USSD's originating MSC's vlr_number

2019-04-08 Thread Neels Hofmeyr
Neels Hofmeyr has posted comments on this change. ( 
https://gerrit.osmocom.org/13515 )

Change subject: USSD: save MO USSD's originating MSC's vlr_number
..


Patch Set 7:

(3 comments)

https://gerrit.osmocom.org/#/c/13515/7/src/hlr_ussd.c
File src/hlr_ussd.c:

https://gerrit.osmocom.org/#/c/13515/7/src/hlr_ussd.c@538
PS7, Line 538:  }
> Need to store ss->vlr_number from conn->* here
wrong again! :/
the function is also called for GSUP from the EUSE, so in fact the place below 
looks correct. Sorry for the confusion.


https://gerrit.osmocom.org/#/c/13515/7/src/hlr_ussd.c@562
PS7, Line 562:  if (gsup->source_name) {
> and drop this chunk
ok so this place is correct, but use 
conn->where_ever_you_find_the_peers_ipa_name


https://gerrit.osmocom.org/#/c/13515/7/src/hlr_ussd.c@569
PS7, Line 569:  } else {
with the limitation that I don't understand this else case



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

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If5a65f471672949192061c5fe396603611123bc1
Gerrit-Change-Number: 13515
Gerrit-PatchSet: 7
Gerrit-Owner: osmith 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Mon, 08 Apr 2019 15:25:21 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-pcu[master]: Fix help message formatting of osmo-pcu.

2019-04-08 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/13542 )

Change subject: Fix help message formatting of osmo-pcu.
..


Patch Set 3: Code-Review+2


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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If4ecf9be5a0739bb54aedb077eda51ad091b4c3f
Gerrit-Change-Number: 13542
Gerrit-PatchSet: 3
Gerrit-Owner: Rafael Diniz 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Rafael Diniz 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Mon, 08 Apr 2019 15:21:23 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-hlr[master]: Cosmetic: gsup_route_find: comment addr, addrlen

2019-04-08 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/13549 )

Change subject: Cosmetic: gsup_route_find: comment addr, addrlen
..


Patch Set 1: Code-Review+1


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

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ib79878970bd07caac6eb921af8ae95403b90a4cb
Gerrit-Change-Number: 13549
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Mon, 08 Apr 2019 15:20:56 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-hlr[master]: USSD: save MO USSD's originating MSC's vlr_number

2019-04-08 Thread Neels Hofmeyr
Neels Hofmeyr has posted comments on this change. ( 
https://gerrit.osmocom.org/13515 )

Change subject: USSD: save MO USSD's originating MSC's vlr_number
..


Patch Set 7:

(2 comments)

https://gerrit.osmocom.org/#/c/13515/7/src/hlr_ussd.c
File src/hlr_ussd.c:

https://gerrit.osmocom.org/#/c/13515/7/src/hlr_ussd.c@538
PS7, Line 538:  }
Need to store ss->vlr_number from conn->* here


https://gerrit.osmocom.org/#/c/13515/7/src/hlr_ussd.c@562
PS7, Line 562:  if (gsup->source_name) {
> gsup->source_name and gsup->destination_name are only included in messages 
> that need routing, i.e. […]
and drop this chunk



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

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If5a65f471672949192061c5fe396603611123bc1
Gerrit-Change-Number: 13515
Gerrit-PatchSet: 7
Gerrit-Owner: osmith 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Mon, 08 Apr 2019 15:10:48 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-hlr[master]: USSD: save MO USSD's originating MSC's vlr_number

2019-04-08 Thread Neels Hofmeyr
Neels Hofmeyr has posted comments on this change. ( 
https://gerrit.osmocom.org/13515 )

Change subject: USSD: save MO USSD's originating MSC's vlr_number
..


Patch Set 7:

(1 comment)

https://gerrit.osmocom.org/#/c/13515/7/src/hlr_ussd.c
File src/hlr_ussd.c:

https://gerrit.osmocom.org/#/c/13515/7/src/hlr_ussd.c@562
PS7, Line 562:  if (gsup->source_name) {
> Why do you think we can skip this patch chunk? This is how I've interpreted 
> your comment [1]: […]
gsup->source_name and gsup->destination_name are only included in messages that 
need routing, i.e. currently exactly for inter-MSC E-interface messages. No 
other messages contain a source name IE.

Here we are in USSD negotiation land, a completely separate level from 
inter-MSC routing.

For USSD, you always have the VLR/MSC directly talking to the osmo-hlr, and 
there is the single GSUP connection on which the response should go back. So 
that would be stored on the MO USSD request coming in. Otherwise we would 
lookup the database's vlr_number for the subscriber, but IIUC that doesn't 
apply here. Definitely never source_name.



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

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If5a65f471672949192061c5fe396603611123bc1
Gerrit-Change-Number: 13515
Gerrit-PatchSet: 7
Gerrit-Owner: osmith 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Mon, 08 Apr 2019 15:04:57 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-hlr[master]: USSD: don't use gsm0480_msgb_alloc_name()

2019-04-08 Thread osmith
osmith has posted comments on this change. ( https://gerrit.osmocom.org/13548 )

Change subject: USSD: don't use gsm0480_msgb_alloc_name()
..


Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/#/c/13548/1/src/hlr_ussd.c
File src/hlr_ussd.c:

https://gerrit.osmocom.org/#/c/13548/1/src/hlr_ussd.c@244
PS1, Line 244:  resp_msg = msgb_alloc_headroom(4000, 64, __func__);
> just wndering why do we need so much space/headroom. […]
To match what osmo_gsup_client_msgb_alloc() is doing, so the server messages 
have the same size as the client messages.



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

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Icdab40c6a933888eb9f51bee9c5264c8919dbf7b
Gerrit-Change-Number: 13548
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Mon, 08 Apr 2019 15:04:32 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-hlr[master]: USSD: fix routing to multiple MSC

2019-04-08 Thread osmith
osmith has uploaded a new patch set (#8) to the change originally created by 
Neels Hofmeyr. ( https://gerrit.osmocom.org/13479 )

Change subject: USSD: fix routing to multiple MSC
..

USSD: fix routing to multiple MSC

hlr_ussd.c so far hardcoded osmo-msc's default IPA-name and hence was
only able to negotiate USSD sessions to
- a single osmo-msc
- that has no custom IPA-name set.
Fix: correctly route USSD to any number of MSC with any custom IPA
names.

Resolve the right MSC's IPA name from the USSD session's IMSI, using
hlr_subscriber->vlr_number to determine the right GSUP peer. Cache it in
ss_session->vlr_number to have at most one db hit for routing per
session.

Related: OS#3710
Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3
---
M src/hlr_ussd.c
1 file changed, 35 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/79/13479/8
--
To view, visit https://gerrit.osmocom.org/13479
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3
Gerrit-Change-Number: 13479
Gerrit-PatchSet: 8
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: osmith 


Change in osmo-hlr[master]: USSD: save MO USSD's originating MSC's vlr_number

2019-04-08 Thread osmith
Hello Vadim Yanitskiy, Neels Hofmeyr, Jenkins Builder,

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

https://gerrit.osmocom.org/13515

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

Change subject: USSD: save MO USSD's originating MSC's vlr_number
..

USSD: save MO USSD's originating MSC's vlr_number

Save the source MSC/VLR in ss_session, so we can send "invalid IMSI"
messages to the originating MSC.

Related: OS#3710
Depends: Ic00b0601eacff6d72927cea51767801142ee75db (libosmocore.git)
Change-Id: If5a65f471672949192061c5fe396603611123bc1
---
M src/hlr_ussd.c
1 file changed, 16 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/15/13515/8
--
To view, visit https://gerrit.osmocom.org/13515
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: If5a65f471672949192061c5fe396603611123bc1
Gerrit-Change-Number: 13515
Gerrit-PatchSet: 8
Gerrit-Owner: osmith 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: osmith 


Change in osmo-hlr[master]: USSD: fix routing to multiple MSC

2019-04-08 Thread osmith
osmith has posted comments on this change. ( https://gerrit.osmocom.org/13479 )

Change subject: USSD: fix routing to multiple MSC
..


Patch Set 7:

(1 comment)

https://gerrit.osmocom.org/#/c/13479/7/src/hlr_ussd.c
File src/hlr_ussd.c:

https://gerrit.osmocom.org/#/c/13479/7/src/hlr_ussd.c@171
PS7, Line 171: vlr_number
> In the current state I would agree, but I know where this is coming from. […]
Done



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

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3
Gerrit-Change-Number: 13479
Gerrit-PatchSet: 7
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Mon, 08 Apr 2019 14:59:04 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-hlr[master]: USSD: save MO USSD's originating MSC's vlr_number

2019-04-08 Thread osmith
osmith has posted comments on this change. ( https://gerrit.osmocom.org/13515 )

Change subject: USSD: save MO USSD's originating MSC's vlr_number
..


Patch Set 7:

(2 comments)

https://gerrit.osmocom.org/#/c/13515/7/src/hlr_ussd.c
File src/hlr_ussd.c:

https://gerrit.osmocom.org/#/c/13515/7/src/hlr_ussd.c@248
PS7, Line 248:  ss->vlr_number_len = strlen(subscr.vlr_number) + 1;
> (I still don't like the +1 on the strlen, I think we may need to discuss the 
> blob plan separately so […]
Me neither, but at least I've documented the current state here:
https://gerrit.osmocom.org/#/c/osmo-hlr/+/13549/


https://gerrit.osmocom.org/#/c/13515/7/src/hlr_ussd.c@562
PS7, Line 562:  if (gsup->source_name) {
Why do you think we can skip this patch chunk? This is how I've interpreted 
your comment [1]:

> For all MO USSD sessions, store the originating MSC's vlr_name in ss-> on the 
> first message coming in from the MSC/VLR.

...and isn't the only place where we know if a message is MO USSD or MT USSD 
right here?

And if we do skip it, where should ss->vlr_number get filled out instead?

[1]: https://gerrit.osmocom.org/#/c/osmo-hlr/+/13479/5/src/hlr_ussd.c@175



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

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If5a65f471672949192061c5fe396603611123bc1
Gerrit-Change-Number: 13515
Gerrit-PatchSet: 7
Gerrit-Owner: osmith 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Mon, 08 Apr 2019 14:57:11 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-hlr[master]: Cosmetic: gsup_route_find: comment addr, addrlen

2019-04-08 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/13549 )

Change subject: Cosmetic: gsup_route_find: comment addr, addrlen
..


Patch Set 1: Code-Review+1


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

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Ib79878970bd07caac6eb921af8ae95403b90a4cb
Gerrit-Change-Number: 13549
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Mon, 08 Apr 2019 14:46:44 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-hlr[master]: USSD: don't use gsm0480_msgb_alloc_name()

2019-04-08 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/13548 )

Change subject: USSD: don't use gsm0480_msgb_alloc_name()
..


Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/#/c/13548/1/src/hlr_ussd.c
File src/hlr_ussd.c:

https://gerrit.osmocom.org/#/c/13548/1/src/hlr_ussd.c@244
PS1, Line 244:  resp_msg = msgb_alloc_headroom(4000, 64, __func__);
just wndering why do we need so much space/headroom. Why did you choose this 
number?



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

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Icdab40c6a933888eb9f51bee9c5264c8919dbf7b
Gerrit-Change-Number: 13548
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Mon, 08 Apr 2019 14:44:59 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-msc[master]: sgs_iface: fix nullpointer dereference

2019-04-08 Thread dexter
dexter has posted comments on this change. ( https://gerrit.osmocom.org/13513 )

Change subject: sgs_iface: fix nullpointer dereference
..


Patch Set 2:

(1 comment)

> (1 comment)

https://gerrit.osmocom.org/#/c/13513/2/src/libmsc/sgs_iface.c
File src/libmsc/sgs_iface.c:

https://gerrit.osmocom.org/#/c/13513/2/src/libmsc/sgs_iface.c@304
PS2, Line 304:  LOGP(LOGL_NOTICE, DSGS, "Cannot transmit %s: connection 
dead. Discarding\n",
> (could also do the NULL check in the log macro, which would solve all 
> possible null dereferences fro […]
I don't think that this would be a good idea since it would cover up problems 
like this.



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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I88b95e3f8cd35241ad68f08d94c6ad7067b842e6
Gerrit-Change-Number: 13513
Gerrit-PatchSet: 2
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: dexter 
Gerrit-Comment-Date: Mon, 08 Apr 2019 14:25:38 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-msc[master]: a_iface_bssap: check bssmap length field

2019-04-08 Thread Neels Hofmeyr
Neels Hofmeyr has posted comments on this change. ( 
https://gerrit.osmocom.org/13307 )

Change subject: a_iface_bssap: check bssmap length field
..


Patch Set 5:

> I had a look at your code. To me it looks ok to discard the whole message if 
> there is excess data as it either means that the message was damaged of the 
> receiving end has some significant problems. However, the ticket that is 
> related to the task says that the message should only be truncated: 
> http://osmocom.org/issues/3806

Ah ok, I've adopted this patch's truncation on my branch as:

if (msgb_l3len(bssmap) > h->length) {
LOG_NAS_A_DEC(nas_dec, LOGL_NOTICE, "There are %u extra bytes 
after the BSSMAP data, truncating\n",
 msgb_l3len(bssmap) - h->length);
msgb_l3trim(bssmap, h->length);
}


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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I3b89dd5a66ec83b03860b58b6b8eb58007f433a4
Gerrit-Change-Number: 13307
Gerrit-PatchSet: 5
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: dexter 
Gerrit-Comment-Date: Mon, 08 Apr 2019 14:20:17 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-msc[master]: sgs_iface: fix nullpointer dereference

2019-04-08 Thread Neels Hofmeyr
Neels Hofmeyr has posted comments on this change. ( 
https://gerrit.osmocom.org/13513 )

Change subject: sgs_iface: fix nullpointer dereference
..


Patch Set 2: Code-Review+1

(1 comment)

https://gerrit.osmocom.org/#/c/13513/2/src/libmsc/sgs_iface.c
File src/libmsc/sgs_iface.c:

https://gerrit.osmocom.org/#/c/13513/2/src/libmsc/sgs_iface.c@304
PS2, Line 304:  LOGP(LOGL_NOTICE, DSGS, "Cannot transmit %s: connection 
dead. Discarding\n",
(could also do the NULL check in the log macro, which would solve all possible 
null dereferences from SGC logging everywhere)



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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I88b95e3f8cd35241ad68f08d94c6ad7067b842e6
Gerrit-Change-Number: 13513
Gerrit-PatchSet: 2
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: dexter 
Gerrit-Comment-Date: Mon, 08 Apr 2019 14:13:32 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes


Change in osmo-pcu[master]: Fix help message formatting of osmo-pcu.

2019-04-08 Thread Rafael Diniz
Rafael Diniz has posted comments on this change. ( 
https://gerrit.osmocom.org/13542 )

Change subject: Fix help message formatting of osmo-pcu.
..


Patch Set 3: Code-Review+1

(2 comments)

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

https://gerrit.osmocom.org/#/c/13542/1//COMMIT_MSG@7
PS1, Line 7: Fix help message formatting of osmo-pcu.
> In general, all our commits make something better ;) […]
Removed the "better" assumption.


https://gerrit.osmocom.org/#/c/13542/1/src/pcu_main.cpp
File src/pcu_main.cpp:

https://gerrit.osmocom.org/#/c/13542/1/src/pcu_main.cpp@81
PS1, Line 81: \
> This dot could be also removed.
Done.



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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If4ecf9be5a0739bb54aedb077eda51ad091b4c3f
Gerrit-Change-Number: 13542
Gerrit-PatchSet: 3
Gerrit-Owner: Rafael Diniz 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Rafael Diniz 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Mon, 08 Apr 2019 14:08:21 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes


Change in libosmocore[master]: fsm: support graceful osmo_fsm_inst_term() cascades

2019-04-08 Thread Neels Hofmeyr
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/13392

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

Change subject: fsm: support graceful osmo_fsm_inst_term() cascades
..

fsm: support graceful osmo_fsm_inst_term() cascades

Add global flag osmo_fsm_term_safely() -- if set to true, enable the following
behavior:

Detect osmo_fsm_inst_term() occuring within osmo_fsm_inst_term():
- collect deallocations until the outermost osmo_fsm_inst_term() is done.
- call osmo_fsm_inst_free() *after* dispatching the parent event.

If a struct osmo_fsm_inst enters osmo_fsm_inst_term() while another is already
within osmo_fsm_inst_term(), do not directly deallocate it, but talloc-reparent
it to a separate talloc context, to be deallocated with the outermost FSM inst.

The effect is that all osmo_fsm_inst freed within an osmo_fsm_inst_term()
cascade will stay allocated until all osmo_fsm_inst_term() are complete and all
of them will be deallocated at the same time.

Mark the deferred deallocation state as __thread in an attempt to make cascaded
deallocation handling threadsafe.  Keep the enable/disable flag separate, so
that it is global and not per-thread.

The feature is showcased by fsm_dealloc_test.c: with this feature, all of those
wild deallocation scenarios succeed.

Make fsm_dealloc_test a normal regression test in testsuite.at.

Rationale:

It is difficult to gracefully handle deallocations of groups of FSM instances
that reference each other. As soon as one child dispatching a cleanup event
causes its parent to deallocate before fsm.c was ready for it, deallocation
will hit a use-after-free. Before this patch, by using parent_term events and
distinct "terminating" FSM states, parent/child FSMs can be taught to wait for
all children to deallocate before deallocating the parent. But as soon as a
non-child / non-parent FSM instance is involved, or actually any other
cleanup() action that triggers parent FSMs or parent talloc contexts to become
unused, it is near impossible to think of all possible deallocation events
ricocheting, and to avoid running into freeing FSM instances that were still in
the middle of osmo_fsm_inst_term(), or FSM instances to enter
osmo_fsm_inst_term() more than once. This patch makes deallocation of "all
possible" setups of complex cross referencing FSM instances easy to handle
correctly, without running into use-after-free or double free situations, and,
notably, without changing calling code.

Change-Id: I8eda67540a1cd91beb7856b9fcd0a3143b18
---
M include/osmocom/core/fsm.h
M src/fsm.c
M tests/Makefile.am
M tests/fsm/fsm_dealloc_test.c
M tests/fsm/fsm_dealloc_test.err
M tests/testsuite.at
6 files changed, 3,503 insertions(+), 301 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/92/13392/7
--
To view, visit https://gerrit.osmocom.org/13392
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I8eda67540a1cd91beb7856b9fcd0a3143b18
Gerrit-Change-Number: 13392
Gerrit-PatchSet: 7
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-CC: Harald Welte 


Change in libosmocore[master]: fsm: add flag to ensure osmo_fsm_inst_term() happens only once

2019-04-08 Thread Neels Hofmeyr
Neels Hofmeyr has posted comments on this change. ( 
https://gerrit.osmocom.org/13545 )

Change subject: fsm: add flag to ensure osmo_fsm_inst_term() happens only once
..


Patch Set 1:

(1 comment)

https://gerrit.osmocom.org/#/c/13545/1/include/osmocom/core/fsm.h
File include/osmocom/core/fsm.h:

https://gerrit.osmocom.org/#/c/13545/1/include/osmocom/core/fsm.h@118
PS1, Line 118:  bool terminating;
> one could use some "uint32_t flags" member and have a single-bit enum type 
> flag in case we'd expect  […]
I see, but IMHO saving a few bytes of ram is not worth the trouble



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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I0c02d76a86f90c49e0eae2f85db64704c96a7674
Gerrit-Change-Number: 13545
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Comment-Date: Mon, 08 Apr 2019 13:50:30 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in libosmocore[master]: add osmo_sockaddr_str API

2019-04-08 Thread Neels Hofmeyr
Neels Hofmeyr has posted comments on this change. ( 
https://gerrit.osmocom.org/13123 )

Change subject: add osmo_sockaddr_str API
..


Patch Set 10: Code-Review+2

testing done, re-applying previous +2


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id617265337f09dfb6ddfe111ef5e578cd3dc9f63
Gerrit-Change-Number: 13123
Gerrit-PatchSet: 10
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Assignee: osmith 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-CC: osmith 
Gerrit-Comment-Date: Mon, 08 Apr 2019 13:47:02 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in libosmocore[master]: add osmo_sockaddr_str API

2019-04-08 Thread Neels Hofmeyr
Neels Hofmeyr has posted comments on this change. ( 
https://gerrit.osmocom.org/13123 )

Change subject: add osmo_sockaddr_str API
..


Patch Set 10:

This change is ready for review.


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id617265337f09dfb6ddfe111ef5e578cd3dc9f63
Gerrit-Change-Number: 13123
Gerrit-PatchSet: 10
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Assignee: osmith 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-CC: osmith 
Gerrit-Comment-Date: Mon, 08 Apr 2019 13:46:47 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-hlr[master]: USSD: save MO USSD's originating MSC's vlr_number

2019-04-08 Thread Neels Hofmeyr
Neels Hofmeyr has posted comments on this change. ( 
https://gerrit.osmocom.org/13515 )

Change subject: USSD: save MO USSD's originating MSC's vlr_number
..


Patch Set 7:

(2 comments)

https://gerrit.osmocom.org/#/c/13515/7/src/hlr_ussd.c
File src/hlr_ussd.c:

https://gerrit.osmocom.org/#/c/13515/7/src/hlr_ussd.c@248
PS7, Line 248:  ss->vlr_number_len = strlen(subscr.vlr_number) + 1;
(I still don't like the +1 on the strlen, I think we may need to discuss the 
blob plan separately some time)


https://gerrit.osmocom.org/#/c/13515/7/src/hlr_ussd.c@562
PS7, Line 562:  if (gsup->source_name) {
SS/USSD GSUP does not include the source_name. You wrote the routing code, 
remember? ;)
Instead you need to get it from the osmo_gsup_conn if at all.
I think you can completely skip this patch chunk.



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

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If5a65f471672949192061c5fe396603611123bc1
Gerrit-Change-Number: 13515
Gerrit-PatchSet: 7
Gerrit-Owner: osmith 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Mon, 08 Apr 2019 13:35:46 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-hlr[master]: USSD: fix routing to multiple MSC

2019-04-08 Thread Neels Hofmeyr
Neels Hofmeyr has posted comments on this change. ( 
https://gerrit.osmocom.org/13479 )

Change subject: USSD: fix routing to multiple MSC
..


Patch Set 7:

(3 comments)

in general the approach looks good

https://gerrit.osmocom.org/#/c/13479/7/src/hlr_ussd.c
File src/hlr_ussd.c:

https://gerrit.osmocom.org/#/c/13479/7/src/hlr_ussd.c@171
PS7, Line 171: vlr_number
> What about static memory allocation? […]
In the current state I would agree, but I know where this is coming from.
In the long run, the aim is to have a blob as VLR identification, a uint8_t* 
plus an arbitrary len.
But I'm not entirely sure yet that we're approaching the blob plan in the right 
way.

So, yes, in this patch alone, the most sensible thing would be a vlr_number[32] 
array,
at least while hlr_subscriber also maintains a char[32] for it.


https://gerrit.osmocom.org/#/c/13479/7/src/hlr_ussd.c@171
PS7, Line 171: vlr_number
> I'm not sure if this is a good idea. I know that db.h has it defined that 
> way. […]
[2] is wrong, will comment over there


https://gerrit.osmocom.org/#/c/13479/7/src/hlr_ussd.c@244
PS7, Line 244:  ss->vlr_number = talloc_strdup(ss, subscr.vlr_number);
(maybe OSMO_ASSERT(ss->vlr_number) )



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

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3
Gerrit-Change-Number: 13479
Gerrit-PatchSet: 7
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Mon, 08 Apr 2019 13:32:12 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-hlr[master]: USSD: fix routing to multiple MSC

2019-04-08 Thread osmith
osmith has posted comments on this change. ( https://gerrit.osmocom.org/13479 )

Change subject: USSD: fix routing to multiple MSC
..


Patch Set 7:

(2 comments)

https://gerrit.osmocom.org/#/c/13479/4/src/hlr_ussd.c
File src/hlr_ussd.c:

https://gerrit.osmocom.org/#/c/13479/4/src/hlr_ussd.c@255
PS4, Line 255: en(ss->vlr_number) + 1, ms
> This must be […]
Patch to avoid this mistake with proper documentation for addr, addrlen:
https://gerrit.osmocom.org/#/c/osmo-hlr/+/13549


https://gerrit.osmocom.org/#/c/13479/7/src/hlr_ussd.c
File src/hlr_ussd.c:

https://gerrit.osmocom.org/#/c/13479/7/src/hlr_ussd.c@171
PS7, Line 171: vlr_number
> What about static memory allocation? […]
I'm not sure if this is a good idea. I know that db.h has it defined that way. 
But we don't seem to enforce that as max size in the VTY config of OsmoMSC [1]. 
Follow up patch [2] will save the gsup->source_name as vlr_number, where we 
also don't enforce that size limit. So we might end up shortening two IPA names 
that are longer than 32 bytes and cause a collision.

[1]: 
https://git.osmocom.org/osmo-msc/tree/src/libmsc/msc_vty.c?id=0f52319765e9834095c4774ef6a3b22825fa618c#n1622
[2]: https://gerrit.osmocom.org/#/c/osmo-hlr/+/13515/



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

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3
Gerrit-Change-Number: 13479
Gerrit-PatchSet: 7
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Mon, 08 Apr 2019 13:25:29 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-bts[master]: oc2gbts_mgr_calib: do not return NULL on integer function

2019-04-08 Thread dexter
dexter has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13272 )

Change subject: oc2gbts_mgr_calib: do not return NULL on integer function
..

oc2gbts_mgr_calib: do not return NULL on integer function

The functions oc2gbts_par_get_uptime() and oc2gbts_par_set_uptime() try
to return with NULL, but both functions are declared as int. Lets return
-EINVAL instead.

Change-Id: I63b61be2940c59b221089d3d1501371b0116d89a
---
M src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c 
b/src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c
index 33c0782..3ddf0e8 100644
--- a/src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c
+++ b/src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c
@@ -87,7 +87,7 @@

fpath = talloc_asprintf(ctx, "%s", UPTIME_TMP_PATH);
if (!fpath)
-   return NULL;
+   return -EINVAL;

fp = fopen(fpath, "r");
if (!fp)
@@ -117,7 +117,7 @@

fpath = talloc_asprintf(ctx, "%s", UPTIME_TMP_PATH);
if (!fpath)
-   return NULL;
+   return -EINVAL;

fp = fopen(fpath, "w");
if (!fp)

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I63b61be2940c59b221089d3d1501371b0116d89a
Gerrit-Change-Number: 13272
Gerrit-PatchSet: 4
Gerrit-Owner: dexter 
Gerrit-Reviewer: Daniel Willmann 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: dexter 


Change in osmo-bts[master]: oc2gbts_mgr_calib: don't use fsync() on *FILE pointer

2019-04-08 Thread dexter
dexter has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13271 )

Change subject: oc2gbts_mgr_calib: don't use fsync() on *FILE pointer
..

oc2gbts_mgr_calib: don't use fsync() on *FILE pointer

fsync() takes an integer file descriptor but we have a *FILE pointer
here. Lets use fileno() first to convert the integer file descriptor to
a FILE pointer.

Change-Id: I46ffd8c680ba0b445cbbd133d5ce92b79e3d8d87
---
M src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c
1 file changed, 1 insertion(+), 1 deletion(-)

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



diff --git a/src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c 
b/src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c
index eac8ed1..33c0782 100644
--- a/src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c
+++ b/src/osmo-bts-oc2g/misc/oc2gbts_mgr_calib.c
@@ -134,7 +134,7 @@
fclose(fp);
return -EIO;
}
-   fsync(fp);
+   fsync(fileno(fp));
fclose(fp);

return 0;

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I46ffd8c680ba0b445cbbd133d5ce92b79e3d8d87
Gerrit-Change-Number: 13271
Gerrit-PatchSet: 4
Gerrit-Owner: dexter 
Gerrit-Reviewer: Daniel Willmann 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: dexter 


Change in osmo-hlr[master]: gsup_router.c: gsup_route_find(): support blob

2019-04-08 Thread osmith
osmith has posted comments on this change. ( https://gerrit.osmocom.org/13048 )

Change subject: gsup_router.c: gsup_route_find(): support blob
..


Patch Set 2:

New patch that describes the addr, addrlen parameters instead:
https://gerrit.osmocom.org/#/c/osmo-hlr/+/13549


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

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I01a45900e14d41bcd338f50ad85d9fabf2c61405
Gerrit-Change-Number: 13048
Gerrit-PatchSet: 2
Gerrit-Owner: osmith 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: osmith 
Gerrit-CC: Vadim Yanitskiy 
Gerrit-Comment-Date: Mon, 08 Apr 2019 13:14:01 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-hlr[master]: Cosmetic: gsup_route_find: comment addr, addrlen

2019-04-08 Thread osmith
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/13549


Change subject: Cosmetic: gsup_route_find: comment addr, addrlen
..

Cosmetic: gsup_route_find: comment addr, addrlen

Describe the addr, addrlen parameters in gsup_route_find() and (more
commonly used) osmo_gsup_addr_send(). Without this description, it is
easy to get the parameters wrong and have routes not being found, as
shown with debug prints like these:

gsup_route_find: addr, addrlen: "MSC-13-37-00-00-00-00", 21
gsup_route_find: comparing with: "MSC-13-37-00-00-00-00\0", 22

Change-Id: Ib79878970bd07caac6eb921af8ae95403b90a4cb
---
M src/gsup_router.c
M src/gsup_send.c
2 files changed, 15 insertions(+), 2 deletions(-)



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

diff --git a/src/gsup_router.c b/src/gsup_router.c
index 16ea202..4fedd38 100644
--- a/src/gsup_router.c
+++ b/src/gsup_router.c
@@ -33,7 +33,13 @@
struct osmo_gsup_conn *conn;
 };

-/* find a route for the given address */
+/*! Find a route for the given address.
+ * \param[in] gs gsup server
+ * \param[in] addr IPA name of the client (SGSN, MSC/VLR). Although this is 
passed like a blob, together with the
+ * length, it must be nul-terminated! This is for legacy 
reasons, see the discussion here:
+ * https://gerrit.osmocom.org/#/c/osmo-hlr/+/13048/
+ * \param[in] addrlen length of addr, *including the nul-byte* (strlen(addr) + 
1).
+ */
 struct osmo_gsup_conn *gsup_route_find(struct osmo_gsup_server *gs,
const uint8_t *addr, size_t addrlen)
 {
diff --git a/src/gsup_send.c b/src/gsup_send.c
index b2c4e02..889cf63 100644
--- a/src/gsup_send.c
+++ b/src/gsup_send.c
@@ -26,7 +26,14 @@

 #include 

-/* Send a msgb to a given address using routing */
+/*! Send a msgb to a given address using routing.
+ * \param[in] gs gsup server
+ * \param[in] addr IPA name of the client (SGSN, MSC/VLR). Although this is 
passed like a blob, together with the
+ * length, it must be nul-terminated! This is for legacy 
reasons, see the discussion here:
+ * https://gerrit.osmocom.org/#/c/osmo-hlr/+/13048/
+ * \param[in] addrlen length of addr, *including the nul-byte* (strlen(addr) + 
1).
+ * \param[in] msg message buffer
+ */
 int osmo_gsup_addr_send(struct osmo_gsup_server *gs,
const uint8_t *addr, size_t addrlen,
struct msgb *msg)

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

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib79878970bd07caac6eb921af8ae95403b90a4cb
Gerrit-Change-Number: 13549
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 


Change in osmo-hlr[master]: USSD: fix routing to multiple MSC

2019-04-08 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/13479 )

Change subject: USSD: fix routing to multiple MSC
..


Patch Set 7: Code-Review+1

(1 comment)

https://gerrit.osmocom.org/#/c/13479/7/src/hlr_ussd.c
File src/hlr_ussd.c:

https://gerrit.osmocom.org/#/c/13479/7/src/hlr_ussd.c@171
PS7, Line 171: vlr_number
What about static memory allocation?

  char vlr_number[32];



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

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3
Gerrit-Change-Number: 13479
Gerrit-PatchSet: 7
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Mon, 08 Apr 2019 12:59:19 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes


Change in osmo-bts[master]: l1_if: add include for missing header file

2019-04-08 Thread dexter
dexter has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13273 )

Change subject: l1_if: add include for missing header file
..

l1_if: add include for missing header file

the function bts_cbch_get() is used in l1_if.c. The function is
declared in cbch.h. Lets include this header file in order to be
complete.

Change-Id: I95d7e89eed969dd5b3ccff0eebcc6c568196a97d
---
M src/osmo-bts-oc2g/l1_if.c
1 file changed, 1 insertion(+), 0 deletions(-)

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



diff --git a/src/osmo-bts-oc2g/l1_if.c b/src/osmo-bts-oc2g/l1_if.c
index e834879..87c7cf7 100644
--- a/src/osmo-bts-oc2g/l1_if.c
+++ b/src/osmo-bts-oc2g/l1_if.c
@@ -54,6 +54,7 @@
 #include 
 #include 
 #include 
+#include 

 #include 
 #include 

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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I95d7e89eed969dd5b3ccff0eebcc6c568196a97d
Gerrit-Change-Number: 13273
Gerrit-PatchSet: 4
Gerrit-Owner: dexter 
Gerrit-Reviewer: Daniel Willmann 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: dexter 


Change in osmo-hlr[master]: USSD: fix routing to multiple MSC

2019-04-08 Thread osmith
osmith has posted comments on this change. ( https://gerrit.osmocom.org/13479 )

Change subject: USSD: fix routing to multiple MSC
..


Patch Set 5:

(1 comment)

https://gerrit.osmocom.org/#/c/13479/5/src/hlr_ussd.c
File src/hlr_ussd.c:

https://gerrit.osmocom.org/#/c/13479/5/src/hlr_ussd.c@286
PS5, Line 286: resp_msg = gsm0480_msgb_alloc_name(__func__);
> agree, but separate patch.
https://gerrit.osmocom.org/#/c/osmo-hlr/+/13548



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

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3
Gerrit-Change-Number: 13479
Gerrit-PatchSet: 5
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Mon, 08 Apr 2019 12:42:58 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-hlr[master]: USSD: don't use gsm0480_msgb_alloc_name()

2019-04-08 Thread osmith
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/13548


Change subject: USSD: don't use gsm0480_msgb_alloc_name()
..

USSD: don't use gsm0480_msgb_alloc_name()

We have nothing to do with GSM 04.80 at the HLR - it's only used to
encapsulate the SS payload between MS and MSC. This is not that
critical, but may be misleading.

Also, gsm0480_msgb_alloc_name() allocates a smaller buffer:

  return msgb_alloc_headroom(1024, 128, name);

than osmo_gsup_client_msgb_alloc() does:

  return msgb_alloc_headroom(4000, 64, __func__);

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



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

diff --git a/src/hlr_ussd.c b/src/hlr_ussd.c
index cc6aa8a..4f9f023 100644
--- a/src/hlr_ussd.c
+++ b/src/hlr_ussd.c
@@ -241,7 +241,7 @@
resp.ss_info_len = msgb_length(ss_msg);
}

-   resp_msg = gsm0480_msgb_alloc_name(__func__);
+   resp_msg = msgb_alloc_headroom(4000, 64, __func__);
OSMO_ASSERT(resp_msg);
osmo_gsup_encode(resp_msg, &resp);
msgb_free(ss_msg);

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

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Icdab40c6a933888eb9f51bee9c5264c8919dbf7b
Gerrit-Change-Number: 13548
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 


Change in osmo-pcu[master]: Fix help message formatting of osmo-pcu.

2019-04-08 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/13542 )

Change subject: Fix help message formatting of osmo-pcu.
..


Patch Set 3: Code-Review+1


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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If4ecf9be5a0739bb54aedb077eda51ad091b4c3f
Gerrit-Change-Number: 13542
Gerrit-PatchSet: 3
Gerrit-Owner: Rafael Diniz 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Rafael Diniz 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Mon, 08 Apr 2019 12:15:34 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-hlr[master]: USSD: save MO USSD's originating MSC's vlr_number

2019-04-08 Thread osmith
Hello Vadim Yanitskiy, Neels Hofmeyr, Jenkins Builder,

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

https://gerrit.osmocom.org/13515

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

Change subject: USSD: save MO USSD's originating MSC's vlr_number
..

USSD: save MO USSD's originating MSC's vlr_number

Save the source MSC/VLR in ss_session, so we can send "invalid IMSI"
messages to the originating MSC.

Related: OS#3710
Depends: Ic00b0601eacff6d72927cea51767801142ee75db (libosmocore.git)
Change-Id: If5a65f471672949192061c5fe396603611123bc1
---
M src/hlr_ussd.c
1 file changed, 15 insertions(+), 5 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/15/13515/7
--
To view, visit https://gerrit.osmocom.org/13515
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: If5a65f471672949192061c5fe396603611123bc1
Gerrit-Change-Number: 13515
Gerrit-PatchSet: 7
Gerrit-Owner: osmith 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: osmith 


Change in osmo-hlr[master]: USSD: save MO USSD's originating MSC's vlr_number

2019-04-08 Thread osmith
osmith has posted comments on this change. ( https://gerrit.osmocom.org/13515 )

Change subject: USSD: save MO USSD's originating MSC's vlr_number
..


Set Ready For Review


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

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If5a65f471672949192061c5fe396603611123bc1
Gerrit-Change-Number: 13515
Gerrit-PatchSet: 6
Gerrit-Owner: osmith 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Mon, 08 Apr 2019 12:10:13 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-hlr[master]: USSD: fix routing to multiple MSC

2019-04-08 Thread osmith
osmith has uploaded a new patch set (#7) to the change originally created by 
Neels Hofmeyr. ( https://gerrit.osmocom.org/13479 )

Change subject: USSD: fix routing to multiple MSC
..

USSD: fix routing to multiple MSC

hlr_ussd.c so far hardcoded osmo-msc's default IPA-name and hence was
only able to negotiate USSD sessions to
- a single osmo-msc
- that has no custom IPA-name set.
Fix: correctly route USSD to any number of MSC with any custom IPA
names.

Resolve the right MSC's IPA name from the USSD session's IMSI, using
hlr_subscriber->vlr_number to determine the right GSUP peer. Cache it in
ss_session->vlr_number to have at most one db hit for routing per
session.

Related: OS#3710
Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3
---
M src/hlr_ussd.c
1 file changed, 35 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/79/13479/7
--
To view, visit https://gerrit.osmocom.org/13479
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3
Gerrit-Change-Number: 13479
Gerrit-PatchSet: 7
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: osmith 


Change in osmo-pcu[master]: Fix help message formatting of osmo-pcu.

2019-04-08 Thread Rafael Diniz
Hello Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/13542

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

Change subject: Fix help message formatting of osmo-pcu.
..

Fix help message formatting of osmo-pcu.

Change-Id: If4ecf9be5a0739bb54aedb077eda51ad091b4c3f
---
M src/pcu_main.cpp
1 file changed, 8 insertions(+), 8 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-pcu refs/changes/42/13542/3
--
To view, visit https://gerrit.osmocom.org/13542
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: If4ecf9be5a0739bb54aedb077eda51ad091b4c3f
Gerrit-Change-Number: 13542
Gerrit-PatchSet: 3
Gerrit-Owner: Rafael Diniz 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Rafael Diniz 
Gerrit-CC: Vadim Yanitskiy 


Change in osmo-hlr[master]: USSD: fix routing to multiple MSC

2019-04-08 Thread osmith
osmith has posted comments on this change. ( https://gerrit.osmocom.org/13479 )

Change subject: USSD: fix routing to multiple MSC
..


Patch Set 6:

(5 comments)

Thanks for the reviews, here's the next version.

https://gerrit.osmocom.org/#/c/13479/5/src/hlr_ussd.c
File src/hlr_ussd.c:

https://gerrit.osmocom.org/#/c/13479/5/src/hlr_ussd.c@175
PS5, Line 175:
> let's take this ss->subscr from the top. […]
Updated the patch to have ss->vlr_number, and look it up once if it is empty 
(like the MT USSD case you have described). The timer is dropped again.

The MO USSD case depends on the libosmocore.git MSC HO GSUP messages patch 
(needs gsup->source_name), so I've kept it as follow up patch here:
https://gerrit.osmocom.org/#/c/osmo-hlr/+/13515/

(I've used vlr_number instead of vlr_name, because it is also called vlr_number 
in hlr_subscriber->vlr_number, and so we don't introduce yet another name for 
the same thing.)


https://gerrit.osmocom.org/#/c/13479/5/src/hlr_ussd.c@251
PS5, Line 251: OGP(DLGSUP, LOG
> thx
Done


https://gerrit.osmocom.org/#/c/13479/5/src/hlr_ussd.c@260
PS5, Line 260:
> same here.
Done


https://gerrit.osmocom.org/#/c/13479/5/src/hlr_ussd.c@263
PS5, Line 263:
> (ack, I have no good idea about naming here)
Changed to "SS/USSD".


https://gerrit.osmocom.org/#/c/13479/5/src/hlr_ussd.c@343
PS5, Line 343:  ss_tx_error(ss, true, GSM0480_ERR_CODE_SYSTEM_FAILURE);
> (setting ss->subscr to point at local struct subscr becomes invalid memory as 
> soon as the function e […]
Now I get it - it worked in your patch (#4), because you had set it to NULL 
afterwards. Thanks for explaining.



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

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3
Gerrit-Change-Number: 13479
Gerrit-PatchSet: 6
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Mon, 08 Apr 2019 11:58:24 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-pcu[master]: Fix help message formatting of osmo-pcu.

2019-04-08 Thread Rafael Diniz
Hello Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/13542

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

Change subject: Fix help message formatting of osmo-pcu.
..

Fix help message formatting of osmo-pcu.

Change-Id: If4ecf9be5a0739bb54aedb077eda51ad091b4c3f
---
M src/pcu_main.cpp
1 file changed, 7 insertions(+), 7 deletions(-)


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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: If4ecf9be5a0739bb54aedb077eda51ad091b4c3f
Gerrit-Change-Number: 13542
Gerrit-PatchSet: 2
Gerrit-Owner: Rafael Diniz 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Rafael Diniz 
Gerrit-CC: Vadim Yanitskiy 


Change in osmo-hlr[master]: USSD: fix routing to multiple MSC

2019-04-08 Thread osmith
osmith has uploaded a new patch set (#6) to the change originally created by 
Neels Hofmeyr. ( https://gerrit.osmocom.org/13479 )

Change subject: USSD: fix routing to multiple MSC
..

USSD: fix routing to multiple MSC

hlr_ussd.c so far hardcoded osmo-msc's default IPA-name and hence was
only able to negotiate USSD sessions to
- a single osmo-msc
- that has no custom IPA-name set.
Fix: correctly route USSD to any number of MSC with any custom IPA
names.

Resolve the right MSC's IPA name from the USSD session's IMSI, using
hlr_subscriber->vlr_number to determine the right GSUP peer. Cache it in
ss_session->vlr_number to have at most one db hit for routing per
session.

Related: OS#3710
Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3
---
M src/hlr_ussd.c
1 file changed, 38 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-hlr refs/changes/79/13479/6
--
To view, visit https://gerrit.osmocom.org/13479
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hlr
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: I18067bfadd33a6bc59a9ee336b6937313826fce3
Gerrit-Change-Number: 13479
Gerrit-PatchSet: 6
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: osmith 


Change in libosmocore[master]: gsm_utils: fix use buf_len instead of sizeof in osmo_dump_gsmtime_buf

2019-04-08 Thread dexter
dexter has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13547 )

Change subject: gsm_utils: fix use buf_len instead of sizeof in 
osmo_dump_gsmtime_buf
..

gsm_utils: fix use buf_len instead of sizeof in osmo_dump_gsmtime_buf

The function osmo_dump_gsmtime_buf gets a pointer *buf and a parameter
buf_len. The pointer *buf is a string buffer and the function places an
\0 at the end of the buffer before it exists. However it uses
sizeof(buf) as part of the index calculation, which is incorrect. Lets
correct this by using buf_len instead.

Change-Id: Id24263aa7c9a53544f1639b6ceb09ce5615d5114
---
M src/gsm/gsm_utils.c
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Vadim Yanitskiy: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c
index f34d9ea..f2bf57b 100644
--- a/src/gsm/gsm_utils.c
+++ b/src/gsm/gsm_utils.c
@@ -890,7 +890,7 @@
 {
snprintf(buf, buf_len, 
"%06"PRIu32"/%02"PRIu16"/%02"PRIu8"/%02"PRIu8"/%02"PRIu8,
 tm->fn, tm->t1, tm->t2, tm->t3, (uint8_t)tm->fn%52);
-   buf[sizeof(buf)-1] = '\0';
+   buf[buf_len-1] = '\0';
return buf;
 }


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Id24263aa7c9a53544f1639b6ceb09ce5615d5114
Gerrit-Change-Number: 13547
Gerrit-PatchSet: 2
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: dexter 


Change in libosmocore[master]: gsm_utils: fix use buf_len instead of sizeof in osmo_dump_gsmtime_buf

2019-04-08 Thread Vadim Yanitskiy
Vadim Yanitskiy has posted comments on this change. ( 
https://gerrit.osmocom.org/13547 )

Change subject: gsm_utils: fix use buf_len instead of sizeof in 
osmo_dump_gsmtime_buf
..


Patch Set 2: Code-Review+2


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Id24263aa7c9a53544f1639b6ceb09ce5615d5114
Gerrit-Change-Number: 13547
Gerrit-PatchSet: 2
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Comment-Date: Mon, 08 Apr 2019 11:24:14 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-bts[master]: testme

2019-04-08 Thread dexter
dexter has abandoned this change. ( https://gerrit.osmocom.org/13546 )

Change subject: testme
..


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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: abandon
Gerrit-Change-Id: Icdf0bf56cb35ad2924958d8126d7a49ba1f36f9d
Gerrit-Change-Number: 13546
Gerrit-PatchSet: 1
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder (102)


Change in libosmocore[master]: gsm_utils: fix use buf_len instead of sizeof in osmo_dump_gsmtime_buf

2019-04-08 Thread dexter
Hello Pau Espin Pedrol, Jenkins Builder,

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

https://gerrit.osmocom.org/13547

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

Change subject: gsm_utils: fix use buf_len instead of sizeof in 
osmo_dump_gsmtime_buf
..

gsm_utils: fix use buf_len instead of sizeof in osmo_dump_gsmtime_buf

The function osmo_dump_gsmtime_buf gets a pointer *buf and a parameter
buf_len. The pointer *buf is a string buffer and the function places an
\0 at the end of the buffer before it exists. However it uses
sizeof(buf) as part of the index calculation, which is incorrect. Lets
correct this by using buf_len instead.

Change-Id: Id24263aa7c9a53544f1639b6ceb09ce5615d5114
---
M src/gsm/gsm_utils.c
1 file changed, 1 insertion(+), 1 deletion(-)


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Id24263aa7c9a53544f1639b6ceb09ce5615d5114
Gerrit-Change-Number: 13547
Gerrit-PatchSet: 2
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 


Change in libosmocore[master]: gsm_utils: fix use buf_len instead of sizeof() osmo_dump_gsmtime_buf

2019-04-08 Thread dexter
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/13547


Change subject: gsm_utils: fix use buf_len instead of sizeof() 
osmo_dump_gsmtime_buf
..

gsm_utils: fix use buf_len instead of sizeof() osmo_dump_gsmtime_buf

The function osmo_dump_gsmtime_buf gets a pointer *buf and a parameter
buf_len. The pointer *buf is a string buffer and the function places an
\0 at the end of the buffer before it exists. However it uses
sizeof(buf) as part of the index calculation, which is incorrect. Lets
correct this by using buf_len instead.

Change-Id: Id24263aa7c9a53544f1639b6ceb09ce5615d5114
---
M src/gsm/gsm_utils.c
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/47/13547/1

diff --git a/src/gsm/gsm_utils.c b/src/gsm/gsm_utils.c
index f34d9ea..f2bf57b 100644
--- a/src/gsm/gsm_utils.c
+++ b/src/gsm/gsm_utils.c
@@ -890,7 +890,7 @@
 {
snprintf(buf, buf_len, 
"%06"PRIu32"/%02"PRIu16"/%02"PRIu8"/%02"PRIu8"/%02"PRIu8,
 tm->fn, tm->t1, tm->t2, tm->t3, (uint8_t)tm->fn%52);
-   buf[sizeof(buf)-1] = '\0';
+   buf[buf_len-1] = '\0';
return buf;
 }


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: Id24263aa7c9a53544f1639b6ceb09ce5615d5114
Gerrit-Change-Number: 13547
Gerrit-PatchSet: 1
Gerrit-Owner: dexter 


Change in osmo-bts[master]: l1_if: add include for missing header file

2019-04-08 Thread dexter
dexter has posted comments on this change. ( https://gerrit.osmocom.org/13273 )

Change subject: l1_if: add include for missing header file
..


Patch Set 4:

(1 comment)

> It seems meas_test output changed, osmo_dump_gsmtime() provides
 > different output.

I am currently looking into this. First I wasn't able to reproduce this 
locally, but after libosmocore update it started failing.

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

https://gerrit.osmocom.org/#/c/13273/1//COMMIT_MSG@10
PS1, Line 10: declared in cbch.h. Lets include this header file in order to be
> typo: decleared
Done



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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I95d7e89eed969dd5b3ccff0eebcc6c568196a97d
Gerrit-Change-Number: 13273
Gerrit-PatchSet: 4
Gerrit-Owner: dexter 
Gerrit-Reviewer: Daniel Willmann 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: dexter 
Gerrit-Comment-Date: Mon, 08 Apr 2019 10:00:11 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in osmo-bts[master]: testme

2019-04-08 Thread dexter
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/13546


Change subject: testme
..

testme

Change-Id: Icdf0bf56cb35ad2924958d8126d7a49ba1f36f9d
---
A testme
1 file changed, 0 insertions(+), 0 deletions(-)



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

diff --git a/testme b/testme
new file mode 100644
index 000..e69de29
--- /dev/null
+++ b/testme

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

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


Change in osmo-bts[master]: l1_if: add include for missing header file

2019-04-08 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/13273 )

Change subject: l1_if: add include for missing header file
..


Patch Set 4:

It seems meas_test output changed, osmo_dump_gsmtime() provides different 
output.


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

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I95d7e89eed969dd5b3ccff0eebcc6c568196a97d
Gerrit-Change-Number: 13273
Gerrit-PatchSet: 4
Gerrit-Owner: dexter 
Gerrit-Reviewer: Daniel Willmann 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Mon, 08 Apr 2019 09:42:03 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in osmo-bts[master]: oc2gbts_mgr: use osmo_init_logging2() instead of osmo_init_logging()

2019-04-08 Thread dexter
Hello Pau Espin Pedrol, Daniel Willmann, Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/13275

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

Change subject: oc2gbts_mgr: use osmo_init_logging2() instead of 
osmo_init_logging()
..

oc2gbts_mgr: use osmo_init_logging2() instead of osmo_init_logging()

The function osmo_init_logging() is deprecated, lets use
osmo_init_logging2() as suggested.

Change-Id: Iebc80cd1f77f10a879d4536d788377f522dd853f
---
M src/osmo-bts-oc2g/misc/oc2gbts_mgr.c
1 file changed, 3 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/75/13275/4
--
To view, visit https://gerrit.osmocom.org/13275
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Iebc80cd1f77f10a879d4536d788377f522dd853f
Gerrit-Change-Number: 13275
Gerrit-PatchSet: 4
Gerrit-Owner: dexter 
Gerrit-Reviewer: Daniel Willmann 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 


Change in osmo-bts[master]: pcu_sock: use %zu conversion specifier for printing sizeof() result

2019-04-08 Thread dexter
Hello Pau Espin Pedrol, Daniel Willmann, Max, Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/13267

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

Change subject: pcu_sock: use %zu conversion specifier for printing sizeof() 
result
..

pcu_sock: use %zu conversion specifier for printing sizeof() result

When using %lu and sizeof() for printing the compiler may throw a
warning. Lets prevent this by using %zu instead of %lu as conversion
specifier.

Change-Id: If5cb656537b1b73b9361a132801ab47ab7f8a709
---
M src/common/pcu_sock.c
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bts refs/changes/67/13267/4
--
To view, visit https://gerrit.osmocom.org/13267
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bts
Gerrit-Branch: master
Gerrit-MessageType: newpatchset
Gerrit-Change-Id: If5cb656537b1b73b9361a132801ab47ab7f8a709
Gerrit-Change-Number: 13267
Gerrit-PatchSet: 4
Gerrit-Owner: dexter 
Gerrit-Reviewer: Daniel Willmann 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: dexter 


Change in libosmocore[master]: Add _c versions of functions that otherwise return static buffers

2019-04-08 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/13311 )

Change subject: Add _c versions of functions that otherwise return static 
buffers
..


Patch Set 9: Code-Review+1

I am not against this channge, I see the point of standariging options for 
APIs, but I'm not really sure about the benefit of introducing _c functions for 
APIs which already have a _buf one (meaning one can already use them in 
multithreaded env).

I don't like adding similar APIs for the sake of convenience, because on the 
other hand it grows libosmocore size, maintainership and complexity to find 
APIs as a user.

IMHO we should deprecate static buffers and keep only _buf ones, and drop _c or 
talloc functions as much as possible for simple return types like strings. Of 
course we want to have/keep _c for APIs returning complex stuff like msgb.


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I8481c19b68ff67cfa22abb93c405ebcfcb0ab19b
Gerrit-Change-Number: 13311
Gerrit-PatchSet: 9
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-CC: Neels Hofmeyr 
Gerrit-Comment-Date: Mon, 08 Apr 2019 09:22:01 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-bsc[master]: Use osmo_lcls instead of anonymous struct

2019-04-08 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13419 )

Change subject: Use osmo_lcls instead of anonymous struct
..


Patch Set 1: Code-Review-1

(1 comment)

I don't see a need for using dynamic allocations at all,  the 'struct 
osmo_lcls' is present in all subscr_conn, so why not make it a static member?

https://gerrit.osmocom.org/#/c/13419/1/include/osmocom/bsc/gsm_data.h
File include/osmocom/bsc/gsm_data.h:

https://gerrit.osmocom.org/#/c/13419/1/include/osmocom/bsc/gsm_data.h@295
PS1, Line 295:  struct osmo_lcls *par; /* LCLS parameters */
why is this not a static member here?  Your patch doesn't only change from 
discrete members to 'struct osmo_lcls', but it also switches from static to 
dynamic allocation.  I support the former, but I don't undestand why the latter 
change is required.



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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I0f2c2a065755d9051fc7d7ce52c19ab0b7d9288a
Gerrit-Change-Number: 13419
Gerrit-PatchSet: 1
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Comment-Date: Mon, 08 Apr 2019 07:39:44 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes


Change in osmo-pcu[master]: cosmetic: use const pointer for bts_data

2019-04-08 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/12246 )

Change subject: cosmetic: use const pointer for bts_data
..

cosmetic: use const pointer for bts_data

It's used several time for logging so let's call it once to make code
easier to follow.

Change-Id: Icfd9e5603a5d8701f487f17e9c0335d458e9e80b
---
M src/tbf_dl.cpp
M src/tbf_ul.cpp
2 files changed, 7 insertions(+), 4 deletions(-)

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



diff --git a/src/tbf_dl.cpp b/src/tbf_dl.cpp
index c97436a..d5e4a45 100644
--- a/src/tbf_dl.cpp
+++ b/src/tbf_dl.cpp
@@ -1350,9 +1350,11 @@

 void gprs_rlcmac_dl_tbf::set_window_size()
 {
-   uint16_t ws = egprs_window_size(bts->bts_data(), dl_slots());
+   const struct gprs_rlcmac_bts *b = bts->bts_data();
+   uint16_t ws = egprs_window_size(b, dl_slots());
+
LOGPTBFDL(this, LOGL_INFO, "setting EGPRS DL window size to %u, 
base(%u) slots(%u) ws_pdch(%u)\n",
- ws, bts->bts_data()->ws_base, pcu_bitcount(dl_slots()), 
bts->bts_data()->ws_pdch);
+ ws, b->ws_base, pcu_bitcount(dl_slots()), b->ws_pdch);
m_window.set_ws(ws);
 }

diff --git a/src/tbf_ul.cpp b/src/tbf_ul.cpp
index fd7d73b..e1a0fbd 100644
--- a/src/tbf_ul.cpp
+++ b/src/tbf_ul.cpp
@@ -588,8 +588,9 @@

 void gprs_rlcmac_ul_tbf::set_window_size()
 {
-   uint16_t ws = egprs_window_size(bts->bts_data(), ul_slots());
+   const struct gprs_rlcmac_bts *b = bts->bts_data();
+   uint16_t ws = egprs_window_size(b, ul_slots());
LOGPTBFUL(this, LOGL_INFO, "setting EGPRS UL window size to %u, 
base(%u) slots(%u) ws_pdch(%u)\n",
- ws, bts->bts_data()->ws_base, pcu_bitcount(ul_slots()), 
bts->bts_data()->ws_pdch);
+ ws, b->ws_base, pcu_bitcount(ul_slots()), b->ws_pdch);
m_window.set_ws(ws);
 }

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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Icfd9e5603a5d8701f487f17e9c0335d458e9e80b
Gerrit-Change-Number: 12246
Gerrit-PatchSet: 4
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: osmith 


Change in osmo-pcu[master]: cosmetic: use const pointer for bts_data

2019-04-08 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/12246 )

Change subject: cosmetic: use const pointer for bts_data
..


Patch Set 3: Code-Review+2


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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: Icfd9e5603a5d8701f487f17e9c0335d458e9e80b
Gerrit-Change-Number: 12246
Gerrit-PatchSet: 3
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Mon, 08 Apr 2019 07:36:10 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-pcu[master]: Update MCS selection for retransmission

2019-04-08 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13402 )

Change subject: Update MCS selection for retransmission
..

Update MCS selection for retransmission

In 3GPP TS 44.060 the selection of MCS for retransmissions is defined as
separate tables (8.1.1.1 and 8.1.1.2) depending on the value of
resegmentation bit (which is opposite to the way EGPRS_ARQ are defined
in the source code). Let's follow the same idea and explicitly check for
resegmentation bit value and use separate tables. This also makes it
easier to add proper support for special cases (MCS-6-9 and MCS-5-7) and
padding in future independently for different ARQ types. The code is
also moved to c to avoid unnecessary conversions to and from cpp class.

Change-Id: Ia73baeefee7a58834f0fc50e3b8bf8d5e3eb7815
---
M src/coding_scheme.c
M src/coding_scheme.h
M src/gprs_coding_scheme.cpp
M src/gprs_coding_scheme.h
M src/tbf_dl.cpp
5 files changed, 40 insertions(+), 50 deletions(-)

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



diff --git a/src/coding_scheme.c b/src/coding_scheme.c
index a4ae882..eaa4953 100644
--- a/src/coding_scheme.c
+++ b/src/coding_scheme.c
@@ -127,3 +127,39 @@
 const char *mode_name(enum mcs_kind val) {
return get_value_string(mode_names, val);
 }
+
+/* FIXME: take into account padding and special cases of commanded MCS 
(MCS-6-9 and MCS-5-7) */
+enum CodingScheme get_retx_mcs(enum CodingScheme initial_mcs, enum 
CodingScheme commanded_mcs, bool resegment_bit)
+{
+   OSMO_ASSERT(mcs_is_edge(initial_mcs));
+   OSMO_ASSERT(mcs_is_edge(commanded_mcs));
+   OSMO_ASSERT(NUM_SCHEMES - MCS1 == 9);
+
+   if (resegment_bit) { /* 3GPP TS 44.060 Table 8.1.1.1, reflected over 
antidiagonal */
+   enum CodingScheme egprs_reseg[NUM_SCHEMES - MCS1][NUM_SCHEMES - 
MCS1] = {
+   { MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1 
},
+   { MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2 
},
+   { MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3 
},
+   { MCS1, MCS1, MCS1, MCS4, MCS4, MCS4, MCS4, MCS4, MCS4 
},
+   { MCS2, MCS2, MCS2, MCS2, MCS5, MCS5, MCS7, MCS7, MCS7 
},
+   { MCS3, MCS3, MCS3, MCS3, MCS3, MCS6, MCS6, MCS6, MCS9 
},
+   { MCS2, MCS2, MCS2, MCS2, MCS5, MCS5, MCS7, MCS7, MCS7 
},
+   { MCS3, MCS3, MCS3, MCS3, MCS3, MCS6, MCS6, MCS8, MCS8 
},
+   { MCS3, MCS3, MCS3, MCS3, MCS3, MCS6, MCS6, MCS6, MCS9 
},
+   };
+   return 
egprs_reseg[mcs_chan_code(initial_mcs)][mcs_chan_code(commanded_mcs)];
+   } else { /* 3GPP TS 44.060 Table 8.1.1.2, reflected over antidiagonal */
+   enum CodingScheme egprs_no_reseg[NUM_SCHEMES - 
MCS1][NUM_SCHEMES - MCS1] = {
+   { MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1, MCS1 
},
+   { MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2, MCS2 
},
+   { MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3, MCS3 
},
+   { MCS4, MCS4, MCS4, MCS4, MCS4, MCS4, MCS4, MCS4, MCS4 
},
+   { MCS5, MCS5, MCS5, MCS5, MCS5, MCS5, MCS7, MCS7, MCS7 
},
+   { MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS9 
},
+   { MCS5, MCS5, MCS5, MCS5, MCS5, MCS5, MCS7, MCS7, MCS7 
},
+   { MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS8, MCS8 
},
+   { MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS6, MCS9 
},
+   };
+   return 
egprs_no_reseg[mcs_chan_code(initial_mcs)][mcs_chan_code(commanded_mcs)];
+   }
+}
diff --git a/src/coding_scheme.h b/src/coding_scheme.h
index aac4bba..24db86d 100644
--- a/src/coding_scheme.h
+++ b/src/coding_scheme.h
@@ -32,6 +32,7 @@

 extern const struct value_string mcs_names[];
 const char *mcs_name(enum CodingScheme val);
+enum CodingScheme get_retx_mcs(enum CodingScheme initial_mcs, enum 
CodingScheme commanded_mcs, bool resegment_bit);

 bool mcs_is_gprs(enum CodingScheme cs);
 bool mcs_is_edge(enum CodingScheme cs);
diff --git a/src/gprs_coding_scheme.cpp b/src/gprs_coding_scheme.cpp
index a149f81..0c22670 100644
--- a/src/gprs_coding_scheme.cpp
+++ b/src/gprs_coding_scheme.cpp
@@ -21,41 +21,6 @@

 #include "gprs_coding_scheme.h"

-#define MAX_NUM_ARQ   2 /* max. number of ARQ */
-#define MAX_NUM_MCS   9 /* max. number of MCS */
-
-/*
- * 44.060 Table 8.1.1.1 and Table 8.1.1.2
- * It has 3 level indexing. 0th level is ARQ type
- * 1st level is Original MCS( index 0 corresponds to MCS1 and so on)
- * 2nd level is MS MCS (index 0 corresponds to MCS1 and so on)
- */
-static enum CodingScheme egprs_mcs_retx_tbl[MAX_NUM_ARQ]
-   [MAX_NUM_MCS][MAX_NUM_MCS]

Change in osmo-pcu[master]: vty: add commands to show TBF of a certain kind

2019-04-08 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/6239 )

Change subject: vty: add commands to show TBF of a certain kind
..

vty: add commands to show TBF of a certain kind

Add vty commands to show only TBFs allocated via PACCH or CCCH.

Change-Id: I80f8df4fe663a0346f4289a4220b761e39726312
Related: OS#1759
---
M src/pcu_vty.c
M src/pcu_vty_functions.cpp
M src/pcu_vty_functions.h
3 files changed, 23 insertions(+), 8 deletions(-)

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



diff --git a/src/pcu_vty.c b/src/pcu_vty.c
index 960c90d..3a733ef 100644
--- a/src/pcu_vty.c
+++ b/src/pcu_vty.c
@@ -1083,11 +1083,20 @@

 DEFUN(show_tbf,
   show_tbf_cmd,
-  "show tbf all",
-  SHOW_STR "information about TBFs\n" "All TBFs\n")
+  "show tbf (all|ccch|pacch)",
+  SHOW_STR "information about TBFs\n"
+  "All TBFs\n"
+  "TBFs allocated via CCCH\n"
+  "TBFs allocated via PACCH\n")
 {
struct gprs_rlcmac_bts *bts = bts_main_data();
-   return pcu_vty_show_tbf_all(vty, bts);
+   if (!strcmp(argv[0], "all"))
+   return pcu_vty_show_tbf_all(vty, bts, true, true);
+
+   if (!strcmp(argv[0], "ccch"))
+   return pcu_vty_show_tbf_all(vty, bts_main_data(), true, false);
+
+   return pcu_vty_show_tbf_all(vty, bts_main_data(), false, true);
 }

 DEFUN(show_ms_all,
diff --git a/src/pcu_vty_functions.cpp b/src/pcu_vty_functions.cpp
index c93935d..98e8185 100644
--- a/src/pcu_vty_functions.cpp
+++ b/src/pcu_vty_functions.cpp
@@ -44,11 +44,17 @@
#include "coding_scheme.h"
 }

-static void tbf_print_vty_info(struct vty *vty, gprs_rlcmac_tbf *tbf)
+static void tbf_print_vty_info(struct vty *vty, gprs_rlcmac_tbf *tbf, bool 
show_ccch, bool show_pacch)
 {
gprs_rlcmac_ul_tbf *ul_tbf = as_ul_tbf(tbf);
gprs_rlcmac_dl_tbf *dl_tbf = as_dl_tbf(tbf);

+   if (show_ccch && !(tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_CCCH)))
+   return;
+
+   if (show_pacch && !(tbf->state_flags & (1 << GPRS_RLCMAC_FLAG_PACCH)))
+   return;
+
vty_out(vty, "TBF: TFI=%d TLLI=0x%08x (%s) TA=%u DIR=%s IMSI=%s%s", 
tbf->tfi(),
tbf->tlli(), tbf->is_tlli_valid() ? "valid" : "invalid",
tbf->ta(),
@@ -101,18 +107,18 @@
vty_out(vty, "%s%s", VTY_NEWLINE, VTY_NEWLINE);
 }

-int pcu_vty_show_tbf_all(struct vty *vty, struct gprs_rlcmac_bts *bts_data)
+int pcu_vty_show_tbf_all(struct vty *vty, struct gprs_rlcmac_bts *bts_data, 
bool show_ccch, bool show_pacch)
 {
BTS *bts = bts_data->bts;
LListHead *ms_iter;

vty_out(vty, "UL TBFs%s", VTY_NEWLINE);
llist_for_each(ms_iter, &bts->ul_tbfs())
-   tbf_print_vty_info(vty, ms_iter->entry());
+   tbf_print_vty_info(vty, ms_iter->entry(), show_ccch, 
show_pacch);

vty_out(vty, "%sDL TBFs%s", VTY_NEWLINE, VTY_NEWLINE);
llist_for_each(ms_iter, &bts->dl_tbfs())
-   tbf_print_vty_info(vty, ms_iter->entry());
+   tbf_print_vty_info(vty, ms_iter->entry(), show_ccch, 
show_pacch);

return CMD_SUCCESS;
 }
diff --git a/src/pcu_vty_functions.h b/src/pcu_vty_functions.h
index 470df0e..3fef208 100644
--- a/src/pcu_vty_functions.h
+++ b/src/pcu_vty_functions.h
@@ -27,7 +27,7 @@
 struct vty;
 struct gprs_rlcmac_bts;

-int pcu_vty_show_tbf_all(struct vty *vty, struct gprs_rlcmac_bts *bts_data);
+int pcu_vty_show_tbf_all(struct vty *vty, struct gprs_rlcmac_bts *bts_data, 
bool show_ccch, bool show_pacch);
 int pcu_vty_show_ms_all(struct vty *vty, struct gprs_rlcmac_bts *bts_data);
 int pcu_vty_show_ms_by_tlli(struct vty *vty, struct gprs_rlcmac_bts *bts_data,
uint32_t tlli);

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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I80f8df4fe663a0346f4289a4220b761e39726312
Gerrit-Change-Number: 6239
Gerrit-PatchSet: 7
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 


Change in osmo-pcu[master]: vty: add commands to show TBF of a certain kind

2019-04-08 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/6239 )

Change subject: vty: add commands to show TBF of a certain kind
..


Patch Set 6: Code-Review+2


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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I80f8df4fe663a0346f4289a4220b761e39726312
Gerrit-Change-Number: 6239
Gerrit-PatchSet: 6
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Mon, 08 Apr 2019 07:34:59 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-msc[master]: msc/gsm_data.h: drop unused SMS_HDR_SIZE macro

2019-04-08 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13483 )

Change subject: msc/gsm_data.h: drop unused SMS_HDR_SIZE macro
..

msc/gsm_data.h: drop unused SMS_HDR_SIZE macro

Change-Id: Iea32a26673ebb57b18dc7e86ad321d9ed48e0948
---
M include/osmocom/msc/gsm_data.h
1 file changed, 0 insertions(+), 1 deletion(-)

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



diff --git a/include/osmocom/msc/gsm_data.h b/include/osmocom/msc/gsm_data.h
index 7d3a1e7..1a0d144 100644
--- a/include/osmocom/msc/gsm_data.h
+++ b/include/osmocom/msc/gsm_data.h
@@ -239,7 +239,6 @@
SMS_SOURCE_SMPP,/* received via SMPP */
 };

-#define SMS_HDR_SIZE   128
 #define SMS_TEXT_SIZE  256

 struct gsm_sms_addr {

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

Gerrit-Project: osmo-msc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Iea32a26673ebb57b18dc7e86ad321d9ed48e0948
Gerrit-Change-Number: 13483
Gerrit-PatchSet: 3
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 


Change in docker-playground[master]: nplab-m3ua-test: support running without jenkins

2019-04-08 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13530 )

Change subject: nplab-m3ua-test: support running without jenkins
..


Patch Set 1: Verified+1


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

Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I200b4ee1760a879cbc0a80a30a062a3f2a8e703d
Gerrit-Change-Number: 13530
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 
Gerrit-Reviewer: Daniel Willmann 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Mon, 08 Apr 2019 07:33:53 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in docker-playground[master]: nplab-m3ua-test: support running without jenkins

2019-04-08 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13530 )

Change subject: nplab-m3ua-test: support running without jenkins
..

nplab-m3ua-test: support running without jenkins

Don't use $WORKSPACE anymore, use $VOL_BASE_DIR like in every other
jenkins.sh in this repository. Make it possible to run jenkins.sh
outside of jenkins (where $WORKSPACE is not set), because
jenkins_common.sh will set up $VOL_BASE_DIR to point to /tmp/logs.

Change-Id: I200b4ee1760a879cbc0a80a30a062a3f2a8e703d
---
M nplab-m3ua-test/jenkins.sh
1 file changed, 1 insertion(+), 1 deletion(-)

Approvals:
  Harald Welte: Looks good to me, approved; Verified



diff --git a/nplab-m3ua-test/jenkins.sh b/nplab-m3ua-test/jenkins.sh
index 0f189ea..5021ff2 100755
--- a/nplab-m3ua-test/jenkins.sh
+++ b/nplab-m3ua-test/jenkins.sh
@@ -30,7 +30,7 @@
--network $NET_NAME --ip 172.18.7.2 \
-v $VOL_BASE_DIR/m3ua-tester:/data \
--name ${BUILD_TAG}-m3ua-test \
-   $REPO_USER/nplab-m3ua-test > $WORKSPACE/logs/junit-xml-m3ua.log
+   $REPO_USER/nplab-m3ua-test > $VOL_BASE_DIR/junit-xml-m3ua.log

 docker container stop -t 1 ${BUILD_TAG}-stp


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

Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I200b4ee1760a879cbc0a80a30a062a3f2a8e703d
Gerrit-Change-Number: 13530
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 
Gerrit-Reviewer: Daniel Willmann 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Pau Espin Pedrol 


Change in docker-playground[master]: nplab-m3ua-test: add sigtran-tests dependency

2019-04-08 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13529 )

Change subject: nplab-m3ua-test: add sigtran-tests dependency
..

nplab-m3ua-test: add sigtran-tests dependency

Make sure to build sigtran-tests before building nplab-m3ua-tests. This
has been working by coincidence without the dependency so far, because
nplab-sua-test had the dependency listed and that test ran on the same
host.

Change-Id: I9df1d2b188e86b3c99c6ec793b6eb644ab3c27c9
---
M nplab-m3ua-test/jenkins.sh
1 file changed, 1 insertion(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved; Verified



diff --git a/nplab-m3ua-test/jenkins.sh b/nplab-m3ua-test/jenkins.sh
index 103ea13..0f189ea 100755
--- a/nplab-m3ua-test/jenkins.sh
+++ b/nplab-m3ua-test/jenkins.sh
@@ -4,6 +4,7 @@
 IMAGE_SUFFIX="${IMAGE_SUFFIX:-master}"
 docker_images_require \
"debian-stretch-build" \
+   "sigtran-tests" \
"osmo-stp-$IMAGE_SUFFIX" \
"debian-stretch-titan" \
"nplab-m3ua-test"

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

Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I9df1d2b188e86b3c99c6ec793b6eb644ab3c27c9
Gerrit-Change-Number: 13529
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 
Gerrit-Reviewer: Daniel Willmann 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: osmith 


Change in docker-playground[master]: nplab-m3ua-test: add sigtran-tests dependency

2019-04-08 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13529 )

Change subject: nplab-m3ua-test: add sigtran-tests dependency
..


Patch Set 1: Verified+1


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

Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I9df1d2b188e86b3c99c6ec793b6eb644ab3c27c9
Gerrit-Change-Number: 13529
Gerrit-PatchSet: 1
Gerrit-Owner: osmith 
Gerrit-Reviewer: Daniel Willmann 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: osmith 
Gerrit-Comment-Date: Mon, 08 Apr 2019 07:33:59 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in libosmocore[master]: Add _c versions of functions that otherwise return static buffers

2019-04-08 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13311 )

Change subject: Add _c versions of functions that otherwise return static 
buffers
..


Patch Set 9:

no review here? This has been around for almost three weeks. somebody must have 
an opinion about this...


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I8481c19b68ff67cfa22abb93c405ebcfcb0ab19b
Gerrit-Change-Number: 13311
Gerrit-PatchSet: 9
Gerrit-Owner: Harald Welte 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-CC: Neels Hofmeyr 
Gerrit-Comment-Date: Mon, 08 Apr 2019 07:32:40 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in libosmocore[master]: Add _buf() functions to bypass static string buffers

2019-04-08 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13310 )

Change subject: Add _buf() functions to bypass static string buffers
..

Add _buf() functions to bypass static string buffers

We have a number of static buffers in use in libosmo*.  This means
the related functions are not usable in a thread-safe way.  While
we so far don't have many multi-threaded programs in the osmocom
universe, the static buffers also prevent us from calling the same
e.g. string-ify function twice within a single printf() call.

Let's make sure there's an alternative function in all those cases,
where the user can pass in a caller-allocated buffer + size, and make
the 'classic' function with the static buffer a wrapper around that
_buf() variant.

Change-Id: Ibf85f79e93244f53b2684ff6f1095c5b41203e05
---
M include/osmocom/core/msgb.h
M include/osmocom/core/utils.h
M include/osmocom/gprs/gprs_ns.h
M include/osmocom/gsm/abis_nm.h
M include/osmocom/gsm/apn.h
M include/osmocom/gsm/gsm0808_utils.h
M include/osmocom/gsm/gsm23003.h
M include/osmocom/gsm/gsm48.h
M include/osmocom/gsm/gsm_utils.h
M include/osmocom/gsm/protocol/gsm_04_08.h
M include/osmocom/gsm/rsl.h
M include/osmocom/sim/sim.h
M src/gb/gprs_ns.c
M src/gb/libosmogb.map
M src/gsm/abis_nm.c
M src/gsm/apn.c
M src/gsm/gsm0808_utils.c
M src/gsm/gsm23003.c
M src/gsm/gsm48.c
M src/gsm/gsm_utils.c
M src/gsm/libosmogsm.map
M src/gsm/rsl.c
M src/msgb.c
M src/sim/core.c
M src/utils.c
25 files changed, 362 insertions(+), 118 deletions(-)

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



diff --git a/include/osmocom/core/msgb.h b/include/osmocom/core/msgb.h
index 5029225..0c51ce2 100644
--- a/include/osmocom/core/msgb.h
+++ b/include/osmocom/core/msgb.h
@@ -67,6 +67,7 @@
 extern void msgb_reset(struct msgb *m);
 uint16_t msgb_length(const struct msgb *msg);
 extern const char *msgb_hexdump(const struct msgb *msg);
+char *msgb_hexdump_buf(char *buf, size_t buf_len, const struct msgb *msg);
 extern int msgb_resize_area(struct msgb *msg, uint8_t *area,
int old_size, int new_size);
 extern struct msgb *msgb_copy(const struct msgb *msg, const char *name);
diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h
index e3728cd..6a2b7d5 100644
--- a/include/osmocom/core/utils.h
+++ b/include/osmocom/core/utils.h
@@ -53,6 +53,7 @@

 int osmo_hexparse(const char *str, uint8_t *b, int max_len);

+char *osmo_ubit_dump_buf(char *buf, size_t buf_len, const uint8_t *bits, 
unsigned int len);
 char *osmo_ubit_dump(const uint8_t *bits, unsigned int len);
 char *osmo_hexdump(const unsigned char *buf, int len);
 char *osmo_hexdump_nospc(const unsigned char *buf, int len);
@@ -139,7 +140,7 @@
 const char *osmo_escape_str(const char *str, int len);
 char *osmo_escape_str_buf(const char *str, int in_len, char *buf, size_t 
bufsize);
 const char *osmo_quote_str(const char *str, int in_len);
-const char *osmo_quote_str_buf(const char *str, int in_len, char *buf, size_t 
bufsize);
+char *osmo_quote_str_buf(const char *str, int in_len, char *buf, size_t 
bufsize);

 uint32_t osmo_isqrt32(uint32_t x);

diff --git a/include/osmocom/gprs/gprs_ns.h b/include/osmocom/gprs/gprs_ns.h
index c62ef98..ed155ff 100644
--- a/include/osmocom/gprs/gprs_ns.h
+++ b/include/osmocom/gprs/gprs_ns.h
@@ -211,6 +211,8 @@

 /* Resturn peer info as string (NOTE: the buffer is allocated statically) */
 const char *gprs_ns_ll_str(const struct gprs_nsvc *nsvc);
+/* Return peer info in user-supplied buffer */
+char *gprs_ns_ll_str_buf(char *buf, size_t buf_len, const struct gprs_nsvc 
*nsvc);

 /* Copy the link layer info from other into nsvc */
 void gprs_ns_ll_copy(struct gprs_nsvc *nsvc, struct gprs_nsvc *other);
diff --git a/include/osmocom/gsm/abis_nm.h b/include/osmocom/gsm/abis_nm.h
index 823b5a4..788727c 100644
--- a/include/osmocom/gsm/abis_nm.h
+++ b/include/osmocom/gsm/abis_nm.h
@@ -42,6 +42,7 @@
 extern const struct tlv_definition abis_nm_att_tlvdef_ipa;

 const char *abis_nm_dump_foh(const struct abis_om_fom_hdr *foh);
+char *abis_nm_dump_foh_buf(char *buf, size_t buf_len, const struct 
abis_om_fom_hdr *foh);

 /*! write a human-readable OML header to the debug log
  *  \param[in] ss Logging sub-system
diff --git a/include/osmocom/gsm/apn.h b/include/osmocom/gsm/apn.h
index 288b229..7899bb2 100644
--- a/include/osmocom/gsm/apn.h
+++ b/include/osmocom/gsm/apn.h
@@ -11,11 +11,14 @@
 #define APN_MAXLEN 100

 char *osmo_apn_qualify(unsigned int mcc, unsigned int mnc, const char *ni);
+char *osmo_apn_qualify_buf(char *buf, size_t buf_len, unsigned int mcc, 
unsigned int mnc, const char *ni);

 /* Compose a string of the form '.mnc001.mcc002.gprs\0', returned in a
  * static buffer. */
 char *osmo_apn_qualify_from_imsi(const char *imsi,
 const char *ni, int have_3dig

Change in osmo-pcu[master]: Help output of osmo-pcu looks better now.

2019-04-08 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13542 )

Change subject: Help output of osmo-pcu looks better now.
..


Patch Set 1: Code-Review+1


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

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: If4ecf9be5a0739bb54aedb077eda51ad091b4c3f
Gerrit-Change-Number: 13542
Gerrit-PatchSet: 1
Gerrit-Owner: Rafael Diniz 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Rafael Diniz 
Gerrit-CC: Vadim Yanitskiy 
Gerrit-Comment-Date: Mon, 08 Apr 2019 07:31:21 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in osmo-bsc[master]: gsm_data.c: use REG_NOSUB flag of regcomp()

2019-04-08 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13539 )

Change subject: gsm_data.c: use REG_NOSUB flag of regcomp()
..

gsm_data.c: use REG_NOSUB flag of regcomp()

We don't need to know position of matches: just yes or no.
This change would save some computation power.

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

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



diff --git a/src/osmo-bsc/gsm_data.c b/src/osmo-bsc/gsm_data.c
index 509f805..45c433c 100644
--- a/src/osmo-bsc/gsm_data.c
+++ b/src/osmo-bsc/gsm_data.c
@@ -260,7 +260,7 @@

if (argc > 0) {
*str = talloc_strdup(ctx, argv[0]);
-   ret = regcomp(reg, argv[0], 0);
+   ret = regcomp(reg, argv[0], REG_NOSUB);

/* handle compilation failures */
if (ret != 0) {

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ia8414bf83d030adfae806c0aeaa757bc4c8cda2b
Gerrit-Change-Number: 13539
Gerrit-PatchSet: 1
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)


Change in osmo-bsc[master]: ipaccess-config: use POSIX regex for Unit ID format check

2019-04-08 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13535 )

Change subject: ipaccess-config: use POSIX regex for Unit ID format check
..

ipaccess-config: use POSIX regex for Unit ID format check

Instead of counting digits and slashes of the IPA Unit ID manually,
use POSIX regex functions, so the code is easier to maintain and
read. As a bonus, this fixes CID#188854: variable 'remain_slash'
was of type 'uint8_t', so it could never be lower than zero.

Change-Id: Id613bf650833dd38eaad08fdfffdf8dbe2f002b1
Related: CID#188854 Unsigned integer overflow
---
M src/ipaccess/ipaccess-config.c
1 file changed, 9 insertions(+), 21 deletions(-)

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



diff --git a/src/ipaccess/ipaccess-config.c b/src/ipaccess/ipaccess-config.c
index da19ce2..54e4efd 100644
--- a/src/ipaccess/ipaccess-config.c
+++ b/src/ipaccess/ipaccess-config.c
@@ -27,6 +27,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -842,33 +843,20 @@

 static bool check_unitid_fmt(const char* unit_id)
 {
-   const char *p = unit_id;
-   bool must_digit = true;
-   uint8_t remain_slash = 2;
+   regex_t regexp;
+   int rc;

if (strlen(unit_id) < 5)
goto wrong_fmt;

-   while (*p != '\0') {
-   if (*p != '/' && !isdigit(*p))
-   goto wrong_fmt;
-   if (*p == '/' && must_digit)
-   goto wrong_fmt;
-   if (*p == '/') {
-   must_digit = true;
-   remain_slash--;
-   if (remain_slash < 0)
-   goto wrong_fmt;
-   } else {
-   must_digit = false;
-   }
-   p++;
-   }
+   rc = regcomp(®exp, "^[0-9]+/[0-9]+/[0-9]+$", REG_EXTENDED | 
REG_NOSUB);
+   OSMO_ASSERT(!rc);

-   if (*(p-1) == '/')
-   goto wrong_fmt;
+   rc = regexec(®exp, unit_id, 0, NULL, 0);
+   regfree(®exp);

-   return true;
+   if (rc == 0)
+   return true;

 wrong_fmt:
fprintf(stderr, "ERROR: unit-id wrong format. Must be 
'\\d+/\\d+/\\d+'\n");

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Id613bf650833dd38eaad08fdfffdf8dbe2f002b1
Gerrit-Change-Number: 13535
Gerrit-PatchSet: 3
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 


Change in osmo-bsc[master]: osmo_bsc_lcls.c: cosmetic: make Coverity happy

2019-04-08 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13533 )

Change subject: osmo_bsc_lcls.c: cosmetic: make Coverity happy
..

osmo_bsc_lcls.c: cosmetic: make Coverity happy

The 'return' that makes Coverity angry can be safely replaced by 'break'.

Change-Id: Ib3d7519421319fb0e6d65441bba123b7b01f4556
Fixes: CID#188873 Identical code for different branches
Fixes: CID#188850 Identical code for different branches
Fixes: CID#188845 Identical code for different branches
---
M src/osmo-bsc/osmo_bsc_lcls.c
1 file changed, 3 insertions(+), 3 deletions(-)

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



diff --git a/src/osmo-bsc/osmo_bsc_lcls.c b/src/osmo-bsc/osmo_bsc_lcls.c
index c1f62dc..98c74c7 100644
--- a/src/osmo-bsc/osmo_bsc_lcls.c
+++ b/src/osmo-bsc/osmo_bsc_lcls.c
@@ -388,7 +388,7 @@
case LCLS_EV_UPDATE_CFG_CSC:
if (lcls_handle_cfg_update(conn, data) != 0)
return;
-   return;
+   break;
case LCLS_EV_APPLY_CFG_CSC:
if (conn->lcls.config == GSM0808_LCLS_CFG_NA)
return;
@@ -426,7 +426,7 @@
case LCLS_EV_UPDATE_CFG_CSC:
if (lcls_handle_cfg_update(conn, data) != 0)
return;
-   return;
+   break;
case LCLS_EV_APPLY_CFG_CSC:
if (lcls_enable_possible(conn)) {
osmo_fsm_inst_state_chg(fi, ST_LOCALLY_SWITCHED, 0, 0);
@@ -471,7 +471,7 @@
case LCLS_EV_UPDATE_CFG_CSC:
if (lcls_handle_cfg_update(conn, data) != 0)
return;
-   return;
+   break;
case LCLS_EV_APPLY_CFG_CSC:
if (lcls_perform_correlation(conn) != 0) {
/* no correlation result: Remain in NOT_POSSIBLE_LS */

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib3d7519421319fb0e6d65441bba123b7b01f4556
Gerrit-Change-Number: 13533
Gerrit-PatchSet: 3
Gerrit-Owner: Vadim Yanitskiy 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Vadim Yanitskiy 


Change in libosmocore[master]: fsm_dealloc_test: no need for ST_DESTROYING

2019-04-08 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13393 )

Change subject: fsm_dealloc_test: no need for ST_DESTROYING
..


Patch Set 6: Code-Review+2


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I05354e6cad9b82ba474fa50ffd41d481b3c697b4
Gerrit-Change-Number: 13393
Gerrit-PatchSet: 6
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Mon, 08 Apr 2019 07:30:22 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in libosmocore[master]: fsm: add flag to ensure osmo_fsm_inst_term() happens only once

2019-04-08 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/13545 )

Change subject: fsm: add flag to ensure osmo_fsm_inst_term() happens only once
..


Patch Set 1: Code-Review+1

(1 comment)

https://gerrit.osmocom.org/#/c/13545/1/include/osmocom/core/fsm.h
File include/osmocom/core/fsm.h:

https://gerrit.osmocom.org/#/c/13545/1/include/osmocom/core/fsm.h@118
PS1, Line 118:  bool terminating;
one could use some "uint32_t flags" member and have a single-bit enum type flag 
in case we'd expect to introduce more flags in the future.  I don't have any 
such plans, and I don't think you *must* change it.  It's just a thought that 
occurred to me.



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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I0c02d76a86f90c49e0eae2f85db64704c96a7674
Gerrit-Change-Number: 13545
Gerrit-PatchSet: 1
Gerrit-Owner: Neels Hofmeyr 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Comment-Date: Mon, 08 Apr 2019 07:09:47 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes


Change in pysim[master]: wavemobile-sim: write mnc-length field ine EF.AD

2019-04-08 Thread dexter
dexter has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13478 )

Change subject: wavemobile-sim: write mnc-length field ine EF.AD
..

wavemobile-sim: write mnc-length field ine EF.AD

The length field in wavemobile sim cards is not set, so that the field
stays at its initial value, which is 0xFF. Lets write the correct mnc
length here.

Change-Id: Ieda0ce864bf3e8c7b92f062eaa3a5482c98507e2
Related: OS#3850
---
M pySim/cards.py
1 file changed, 6 insertions(+), 0 deletions(-)

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



diff --git a/pySim/cards.py b/pySim/cards.py
index d912a7a..a341b71 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -896,6 +896,12 @@
if sw != '9000':
print("Programming OPLMNwAcT failed with code 
%s"%sw)

+# EF.AD
+if p.get('mcc') and p.get('mnc'):
+   sw = self.update_ad(p['mnc'])
+   if sw != '9000':
+   print("Programming AD failed with code %s"%sw)
+
 return None

def erase(self):

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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: Ieda0ce864bf3e8c7b92f062eaa3a5482c98507e2
Gerrit-Change-Number: 13478
Gerrit-PatchSet: 1
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: dexter 


Change in pysim[master]: cosmetic: fix sourecode formatting

2019-04-08 Thread dexter
dexter has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13476 )

Change subject: cosmetic: fix sourecode formatting
..

cosmetic: fix sourecode formatting

Change-Id: I4836826811ffb0aeb103d32eb874f5fa52af4186
---
M pySim/cards.py
1 file changed, 5 insertions(+), 5 deletions(-)

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



diff --git a/pySim/cards.py b/pySim/cards.py
index fb84a8d..d912a7a 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -338,12 +338,12 @@

# Set first entry
entry = (
-   '81' +  
#  1b  Status: Valid & Active
+   '81' +  #  1b  Status: 
Valid & Active
rpad(b2h(p['name'][0:14]), 28) +# 14b  Entry 
Name
-   enc_iccid(p['iccid']) + # 10b  
ICCID
-   enc_imsi(p['imsi']) +   #  9b  
IMSI_len + id_type(9) + IMSI
-   p['ki'] +   
# 16b  Ki
-   lpad(p['smsp'], 80) 
# 40b  SMSP (padded with ff if needed)
+   enc_iccid(p['iccid']) + # 10b  ICCID
+   enc_imsi(p['imsi']) +   #  9b  IMSI_len 
+ id_type(9) + IMSI
+   p['ki'] +   # 16b  Ki
+   lpad(p['smsp'], 80) # 40b  SMSP 
(padded with ff if needed)
)
self._scc.update_record('000c', 1, entry)


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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I4836826811ffb0aeb103d32eb874f5fa52af4186
Gerrit-Change-Number: 13476
Gerrit-PatchSet: 2
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Vadim Yanitskiy 
Gerrit-Reviewer: dexter 


Change in pysim[master]: sysmo-usim-sjs1: update EF.AD with correct MNC length

2019-04-08 Thread dexter
dexter has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/13366 )

Change subject: sysmo-usim-sjs1: update EF.AD with correct MNC length
..

sysmo-usim-sjs1: update EF.AD with correct MNC length

At the moment EF.AD, which contains the length of the MNC is not
updated. For two digit MNC (the usual case) this is fine since the
length is set to 2 by default. However, when one wants to set an MNC
with 3 digit length the file must be updated, otherwise the third digit
of the MNC is recognized as part of the MSIN.

Change-Id: I827092b2c7f7952f54b2d9f8dbda419a0dbfaf65
Related: OS#3850
---
M pySim-read.py
M pySim/cards.py
2 files changed, 26 insertions(+), 0 deletions(-)

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



diff --git a/pySim-read.py b/pySim-read.py
index 4356453..bcdbca6 100755
--- a/pySim-read.py
+++ b/pySim-read.py
@@ -176,5 +176,12 @@
except Exception as e:
print "MSISDN: Can't read file -- " + str(e)

+   # EF.AD
+   (res, sw) = scc.read_binary(['3f00', '7f20', '6fad'])
+   if sw == '9000':
+   print("AD: %s" % (res,))
+   else:
+   print("AD: Can't read, response code = %s" % (sw,))
+
# Done for this card and maybe for everything ?
print "Done !\n"
diff --git a/pySim/cards.py b/pySim/cards.py
index 1012cfd..fb84a8d 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -118,6 +118,20 @@
data, sw = self._scc.update_record(EF['SMSP'], 1, rpad(smsp, 
84))
return sw

+   def update_ad(self, mnc):
+#See also: 3GPP TS 31.102, chapter 4.2.18
+mnclen = len(str(mnc))
+if mnclen == 1:
+mnclen = 2
+if mnclen > 3:
+   raise RuntimeError('unable to calculate proper mnclen')
+
+   data = self._scc.read_binary(EF['AD'], length=None, offset=0)
+size = len(data[0])/2
+content = data[0][0:6] + "%02X" % mnclen
+   data, sw = self._scc.update_binary(EF['AD'], content)
+   return sw
+
def read_spn(self):
(spn, sw) = self._scc.read_binary(EF['SPN'])
if sw == '9000':
@@ -593,6 +607,11 @@
if sw != '9000':
print("Programming OPLMNwAcT failed with code 
%s"%sw)

+# EF.AD
+if p.get('mcc') and p.get('mnc'):
+   sw = self.update_ad(p['mnc'])
+   if sw != '9000':
+   print("Programming AD failed with code %s"%sw)

# EF.SMSP
r = self._scc.select_file(['3f00', '7f10'])

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

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-MessageType: merged
Gerrit-Change-Id: I827092b2c7f7952f54b2d9f8dbda419a0dbfaf65
Gerrit-Change-Number: 13366
Gerrit-PatchSet: 4
Gerrit-Owner: dexter 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: dexter