Change in libosmocore[master]: port arfcn range encode support from osmo-bsc

2019-01-12 Thread Harald Welte
Harald Welte has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/10185 )

Change subject: port arfcn range encode support from osmo-bsc
..

port arfcn range encode support from osmo-bsc

As part of fixing issue OS#3075, we want to migrate support
for encoding system information from osmo-bsc to libosmocore.

This change ports one of the prerequisites for doing so:
osmo-bsc code for range-encoding ARFCNs, including tests.

An osmo_gsm48_ prefix has been prepended to public symbols in
order to avoid clashes with existing symbols in osmo-bsc code.

Change-Id: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c
Related: OS#3075
---
M include/Makefile.am
A include/osmocom/gsm/gsm48_arfcn_range_encode.h
M src/gsm/Makefile.am
A src/gsm/gsm48_arfcn_range_encode.c
M src/gsm/libosmogsm.map
M tests/gsm0408/gsm0408_test.c
M tests/gsm0408/gsm0408_test.ok
7 files changed, 760 insertions(+), 1 deletion(-)

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



diff --git a/include/Makefile.am b/include/Makefile.am
index 86d8d15..6da5ab6 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -91,6 +91,7 @@
osmocom/gsm/gsm23003.h \
osmocom/gsm/gsm29118.h \
osmocom/gsm/gsm48.h \
+   osmocom/gsm/gsm48_arfcn_range_encode.h \
osmocom/gsm/gsm48_ie.h \
osmocom/gsm/gsm_utils.h \
osmocom/gsm/gsup.h \
diff --git a/include/osmocom/gsm/gsm48_arfcn_range_encode.h 
b/include/osmocom/gsm/gsm48_arfcn_range_encode.h
new file mode 100644
index 000..146c853
--- /dev/null
+++ b/include/osmocom/gsm/gsm48_arfcn_range_encode.h
@@ -0,0 +1,25 @@
+/*! \file gsm48_arfcn_range_encode.h */
+
+#pragma once
+
+#include 
+
+enum osmo_gsm48_range {
+   OSMO_GSM48_ARFCN_RANGE_INVALID  = -1,
+   OSMO_GSM48_ARFCN_RANGE_128  = 127,
+   OSMO_GSM48_ARFCN_RANGE_256  = 255,
+   OSMO_GSM48_ARFCN_RANGE_512  = 511,
+   OSMO_GSM48_ARFCN_RANGE_1024 = 1023,
+};
+
+#define OSMO_GSM48_RANGE_ENC_MAX_ARFCNS29
+
+int osmo_gsm48_range_enc_determine_range(const int *arfcns, int size, int 
*f0_out);
+int osmo_gsm48_range_enc_arfcns(enum osmo_gsm48_range rng, const int *arfcns, 
int sze, int *out, int idx);
+int osmo_gsm48_range_enc_find_index(enum osmo_gsm48_range rng, const int 
*arfcns, int size);
+int osmo_gsm48_range_enc_filter_arfcns(int *arfcns, const int sze, const int 
f0, int *f0_included);
+
+int osmo_gsm48_range_enc_128(uint8_t *chan_list, int f0, int *w);
+int osmo_gsm48_range_enc_256(uint8_t *chan_list, int f0, int *w);
+int osmo_gsm48_range_enc_512(uint8_t *chan_list, int f0, int *w);
+int osmo_gsm48_range_enc_1024(uint8_t *chan_list, int f0, int f0_incl, int *w);
diff --git a/src/gsm/Makefile.am b/src/gsm/Makefile.am
index 3d2c560..c4b5fce 100644
--- a/src/gsm/Makefile.am
+++ b/src/gsm/Makefile.am
@@ -21,7 +21,8 @@
 BUILT_SOURCES = gsm0503_conv.c

 libgsmint_la_SOURCES =  a5.c rxlev_stat.c tlv_parser.c comp128.c comp128v23.c \
-   gsm_utils.c rsl.c gsm48.c gsm48_ie.c gsm0808.c 
sysinfo.c \
+   gsm_utils.c rsl.c gsm48.c gsm48_arfcn_range_encode.c \
+   gsm48_ie.c gsm0808.c sysinfo.c \
gprs_cipher_core.c gprs_rlc.c gsm0480.c abis_nm.c 
gsm0502.c \
gsm0411_utils.c gsm0411_smc.c gsm0411_smr.c gsm0414.c \
lapd_core.c lapdm.c kasumi.c gsm29205.c 
gsm_04_08_gprs.c \
diff --git a/src/gsm/gsm48_arfcn_range_encode.c 
b/src/gsm/gsm48_arfcn_range_encode.c
new file mode 100644
index 000..6423a9a
--- /dev/null
+++ b/src/gsm/gsm48_arfcn_range_encode.c
@@ -0,0 +1,321 @@
+/* gsm 04.08 system information (si) encoding and decoding
+ * 3gpp ts 04.08 version 7.21.0 release 1998 / etsi ts 100 940 v7.21.0 */
+
+/*
+ * (C) 2012 Holger Hans Peter Freyther
+ * (C) 2012 by On-Waves
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see .
+ */
+
+#include 
+#include 
+
+#include 
+
+#include 
+
+static inline int greatest_power_of_2_lesser_or_equal_to(int index)
+{
+   int power_of_2 = 1;
+
+   do {
+   power_of_2 *= 2;
+   } while 

Change in libosmocore[master]: port arfcn range encode support from osmo-bsc

2019-01-07 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/10185 )

Change subject: port arfcn range encode support from osmo-bsc
..


Patch Set 9: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/10185
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: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c
Gerrit-Change-Number: 10185
Gerrit-PatchSet: 9
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Holger Freyther 
Gerrit-Comment-Date: Mon, 07 Jan 2019 15:09:12 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in libosmocore[master]: port arfcn range encode support from osmo-bsc

2019-01-07 Thread Stefan Sperling
Hello Max, Neels Hofmeyr, Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/10185

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

Change subject: port arfcn range encode support from osmo-bsc
..

port arfcn range encode support from osmo-bsc

As part of fixing issue OS#3075, we want to migrate support
for encoding system information from osmo-bsc to libosmocore.

This change ports one of the prerequisites for doing so:
osmo-bsc code for range-encoding ARFCNs, including tests.

An osmo_gsm48_ prefix has been prepended to public symbols in
order to avoid clashes with existing symbols in osmo-bsc code.

Change-Id: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c
Related: OS#3075
---
M include/Makefile.am
A include/osmocom/gsm/gsm48_arfcn_range_encode.h
M src/gsm/Makefile.am
A src/gsm/gsm48_arfcn_range_encode.c
M src/gsm/libosmogsm.map
M tests/gsm0408/gsm0408_test.c
M tests/gsm0408/gsm0408_test.ok
7 files changed, 760 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/85/10185/9
--
To view, visit https://gerrit.osmocom.org/10185
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: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c
Gerrit-Change-Number: 10185
Gerrit-PatchSet: 9
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Holger Freyther 


Change in libosmocore[master]: port arfcn range encode support from osmo-bsc

2019-01-07 Thread Stefan Sperling
Stefan Sperling has posted comments on this change. ( 
https://gerrit.osmocom.org/10185 )

Change subject: port arfcn range encode support from osmo-bsc
..


Patch Set 8:

(3 comments)

https://gerrit.osmocom.org/#/c/10185/8/include/osmocom/gsm/gsm48_arfcn_range_encode.h
File include/osmocom/gsm/gsm48_arfcn_range_encode.h:

https://gerrit.osmocom.org/#/c/10185/8/include/osmocom/gsm/gsm48_arfcn_range_encode.h@22
PS8, Line 22: int osmo_gsm48_range_enc_range128(uint8_t *chan_list, int f0, int 
*w);
> I think single "range" in function name is enough - it's already pretty long.
Fixed in next patch set.


https://gerrit.osmocom.org/#/c/10185/8/src/gsm/gsm48_arfcn_range_encode.c
File src/gsm/gsm48_arfcn_range_encode.c:

https://gerrit.osmocom.org/#/c/10185/8/src/gsm/gsm48_arfcn_range_encode.c@54
PS8, Line 54:  */
> Can we use this as static function? In OsmoBSC it's called only once from 
> _range_enc_arfcns()
No this function cannot be static because it is also being called from 
gsm0408_test.c, which can only link to exported symbols.


https://gerrit.osmocom.org/#/c/10185/8/src/gsm/gsm48_arfcn_range_encode.c@302
PS8, Line 302: {
> This helper is used only in range_encode() in OsmoBSC which is static in this 
> patch. […]
This is being called by test code as well.



--
To view, visit https://gerrit.osmocom.org/10185
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: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c
Gerrit-Change-Number: 10185
Gerrit-PatchSet: 8
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Holger Freyther 
Gerrit-Comment-Date: Mon, 07 Jan 2019 12:01:20 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in libosmocore[master]: port arfcn range encode support from osmo-bsc

2019-01-02 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/10185 )

Change subject: port arfcn range encode support from osmo-bsc
..


Patch Set 8: Code-Review-1

(1 comment)

https://gerrit.osmocom.org/#/c/10185/8/src/gsm/gsm48_arfcn_range_encode.c
File src/gsm/gsm48_arfcn_range_encode.c:

https://gerrit.osmocom.org/#/c/10185/8/src/gsm/gsm48_arfcn_range_encode.c@302
PS8, Line 302: {
This helper is used only in range_encode() in OsmoBSC which is static in this 
patch. Why do we expose it in public API?



--
To view, visit https://gerrit.osmocom.org/10185
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: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c
Gerrit-Change-Number: 10185
Gerrit-PatchSet: 8
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Holger Freyther 
Gerrit-Comment-Date: Wed, 02 Jan 2019 10:15:19 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes


Change in libosmocore[master]: port arfcn range encode support from osmo-bsc

2019-01-02 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/10185 )

Change subject: port arfcn range encode support from osmo-bsc
..


Patch Set 8:

(1 comment)

https://gerrit.osmocom.org/#/c/10185/8/src/gsm/gsm48_arfcn_range_encode.c
File src/gsm/gsm48_arfcn_range_encode.c:

https://gerrit.osmocom.org/#/c/10185/8/src/gsm/gsm48_arfcn_range_encode.c@54
PS8, Line 54:  */
Can we use this as static function? In OsmoBSC it's called only once from 
_range_enc_arfcns()



--
To view, visit https://gerrit.osmocom.org/10185
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: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c
Gerrit-Change-Number: 10185
Gerrit-PatchSet: 8
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Holger Freyther 
Gerrit-Comment-Date: Wed, 02 Jan 2019 10:00:21 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in libosmocore[master]: port arfcn range encode support from osmo-bsc

2019-01-02 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/10185 )

Change subject: port arfcn range encode support from osmo-bsc
..


Patch Set 8:

(1 comment)

https://gerrit.osmocom.org/#/c/10185/8/include/osmocom/gsm/gsm48_arfcn_range_encode.h
File include/osmocom/gsm/gsm48_arfcn_range_encode.h:

https://gerrit.osmocom.org/#/c/10185/8/include/osmocom/gsm/gsm48_arfcn_range_encode.h@22
PS8, Line 22: int osmo_gsm48_range_enc_range128(uint8_t *chan_list, int f0, int 
*w);
I think single "range" in function name is enough - it's already pretty long.



--
To view, visit https://gerrit.osmocom.org/10185
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: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c
Gerrit-Change-Number: 10185
Gerrit-PatchSet: 8
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Holger Freyther 
Gerrit-Comment-Date: Wed, 02 Jan 2019 09:49:49 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in libosmocore[master]: port arfcn range encode support from osmo-bsc

2018-12-30 Thread Stefan Sperling
Hello Max, Neels Hofmeyr, Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/10185

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

Change subject: port arfcn range encode support from osmo-bsc
..

port arfcn range encode support from osmo-bsc

As part of fixing issue OS#3075, we want to migrate support
for encoding system information from osmo-bsc to libosmocore.

This change ports one of the prerequisites for doing so:
osmo-bsc code for range-encoding ARFCNs, including tests.

An osmo_gsm48_ prefix has been prepended to public symbols in
order to avoid clashes with existing symbols in osmo-bsc code.

Change-Id: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c
Related: OS#3075
---
M include/Makefile.am
A include/osmocom/gsm/gsm48_arfcn_range_encode.h
M src/gsm/Makefile.am
A src/gsm/gsm48_arfcn_range_encode.c
M src/gsm/libosmogsm.map
M tests/gsm0408/gsm0408_test.c
M tests/gsm0408/gsm0408_test.ok
7 files changed, 760 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/85/10185/8
--
To view, visit https://gerrit.osmocom.org/10185
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: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c
Gerrit-Change-Number: 10185
Gerrit-PatchSet: 8
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Holger Freyther 


Change in libosmocore[master]: port arfcn range encode support from osmo-bsc

2018-12-30 Thread Stefan Sperling
Stefan Sperling has posted comments on this change. ( 
https://gerrit.osmocom.org/10185 )

Change subject: port arfcn range encode support from osmo-bsc
..


Patch Set 7:

Licence change has been cleared.


--
To view, visit https://gerrit.osmocom.org/10185
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: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c
Gerrit-Change-Number: 10185
Gerrit-PatchSet: 7
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Holger Freyther 
Gerrit-Comment-Date: Sun, 30 Dec 2018 12:29:34 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in libosmocore[master]: port arfcn range encode support from osmo-bsc

2018-12-11 Thread Stefan Sperling
Stefan Sperling has posted comments on this change. ( 
https://gerrit.osmocom.org/10185 )

Change subject: port arfcn range encode support from osmo-bsc
..


Patch Set 7:

Marked as WIP until we get a written statement by Jolly about the licence 
change.


--
To view, visit https://gerrit.osmocom.org/10185
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: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c
Gerrit-Change-Number: 10185
Gerrit-PatchSet: 7
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Holger Freyther 
Gerrit-Comment-Date: Tue, 11 Dec 2018 13:35:59 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in libosmocore[master]: port arfcn range encode support from osmo-bsc

2018-12-11 Thread Neels Hofmeyr
Neels Hofmeyr has removed dexter from this change.  ( 
https://gerrit.osmocom.org/10185 )

Change subject: port arfcn range encode support from osmo-bsc
..


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: deleteReviewer
Gerrit-Change-Id: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c
Gerrit-Change-Number: 10185
Gerrit-PatchSet: 7
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Holger Freyther 


Change in libosmocore[master]: port arfcn range encode support from osmo-bsc

2018-12-11 Thread Stefan Sperling
Stefan Sperling has posted comments on this change. ( 
https://gerrit.osmocom.org/10185 )

Change subject: port arfcn range encode support from osmo-bsc
..


Patch Set 7:

Please don't merge this yet. There has been no written statement by Jolly 
regarding the licence change yet.


--
To view, visit https://gerrit.osmocom.org/10185
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: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c
Gerrit-Change-Number: 10185
Gerrit-PatchSet: 7
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Holger Freyther 
Gerrit-Comment-Date: Tue, 11 Dec 2018 13:27:22 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in libosmocore[master]: port arfcn range encode support from osmo-bsc

2018-12-11 Thread Neels Hofmeyr
Neels Hofmeyr has posted comments on this change. ( 
https://gerrit.osmocom.org/10185 )

Change subject: port arfcn range encode support from osmo-bsc
..


Patch Set 7: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/10185
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: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c
Gerrit-Change-Number: 10185
Gerrit-PatchSet: 7
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Holger Freyther 
Gerrit-Comment-Date: Tue, 11 Dec 2018 13:20:24 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in libosmocore[master]: port arfcn range encode support from osmo-bsc

2018-12-11 Thread Stefan Sperling
Hello Max, Neels Hofmeyr, Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/10185

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

Change subject: port arfcn range encode support from osmo-bsc
..

port arfcn range encode support from osmo-bsc

As part of fixing issue OS#3075, we want to migrate support
for encoding system information from osmo-bsc to libosmocore.

This change ports one of the prerequisites for doing so:
osmo-bsc code for range-encoding ARFCNs, including tests.

An osmo_gsm48_ prefix has been prepended to public symbols in
order to avoid clashes with existing symbols in osmo-bsc code.

Change-Id: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c
Related: OS#3075
---
M include/Makefile.am
A include/osmocom/gsm/gsm48_arfcn_range_encode.h
M src/gsm/Makefile.am
A src/gsm/gsm48_arfcn_range_encode.c
M src/gsm/libosmogsm.map
M tests/gsm0408/gsm0408_test.c
M tests/gsm0408/gsm0408_test.ok
7 files changed, 761 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/85/10185/7
--
To view, visit https://gerrit.osmocom.org/10185
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: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c
Gerrit-Change-Number: 10185
Gerrit-PatchSet: 7
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Holger Freyther 


Change in libosmocore[master]: port arfcn range encode support from osmo-bsc

2018-12-11 Thread Stefan Sperling
Stefan Sperling has posted comments on this change. ( 
https://gerrit.osmocom.org/10185 )

Change subject: port arfcn range encode support from osmo-bsc
..


Patch Set 6:

(3 comments)

https://gerrit.osmocom.org/#/c/10185/6/tests/gsm0408/gsm0408_test.c
File tests/gsm0408/gsm0408_test.c:

https://gerrit.osmocom.org/#/c/10185/6/tests/gsm0408/gsm0408_test.c@33
PS6, Line 33: #include 
> not needed
Right, dropped.


https://gerrit.osmocom.org/#/c/10185/6/tests/gsm0408/gsm0408_test.c@116
PS6, Line 116:  printf(" is: %s\n", osmo_hexdump(msg->data, 
msg->len));
> maybe a bit eager find-replace? I think this stderr output should also go to 
> stdout, yes, but techni […]
Oh, I understood that you wanted all fprintf() in this file to be printf() for 
some reason. Reverted in next patch set.


https://gerrit.osmocom.org/#/c/10185/6/tests/gsm0408/gsm0408_test.c@914
PS6, Line 914: };
> drop this too
Done.



--
To view, visit https://gerrit.osmocom.org/10185
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: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c
Gerrit-Change-Number: 10185
Gerrit-PatchSet: 6
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Holger Freyther 
Gerrit-Comment-Date: Tue, 11 Dec 2018 13:17:21 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in libosmocore[master]: port arfcn range encode support from osmo-bsc

2018-12-11 Thread Neels Hofmeyr
Neels Hofmeyr has posted comments on this change. ( 
https://gerrit.osmocom.org/10185 )

Change subject: port arfcn range encode support from osmo-bsc
..


Patch Set 6: Code-Review-1

(3 comments)

sorry, missed before: either not add the .err file, or if you want to add it 
(which would again be a separate patch though), then you also need to adjust 
libosmocore/tests/Makefile.am EXTRA_DIST to add it, and also adjust 
tests/testsuite.at so that the .err file gets validated.

https://gerrit.osmocom.org/#/c/10185/6/tests/gsm0408/gsm0408_test.c
File tests/gsm0408/gsm0408_test.c:

https://gerrit.osmocom.org/#/c/10185/6/tests/gsm0408/gsm0408_test.c@33
PS6, Line 33: #include 
not needed


https://gerrit.osmocom.org/#/c/10185/6/tests/gsm0408/gsm0408_test.c@116
PS6, Line 116:  printf(" is: %s\n", osmo_hexdump(msg->data, 
msg->len));
maybe a bit eager find-replace? I think this stderr output should also go to 
stdout, yes, but technically that's a separate patch. (This should never fire 
anyway as long as the test succeeds, that's why we never saw it.)


https://gerrit.osmocom.org/#/c/10185/6/tests/gsm0408/gsm0408_test.c@914
PS6, Line 914: };
drop this too



--
To view, visit https://gerrit.osmocom.org/10185
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: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c
Gerrit-Change-Number: 10185
Gerrit-PatchSet: 6
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Holger Freyther 
Gerrit-Comment-Date: Tue, 11 Dec 2018 12:58:14 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes


Change in libosmocore[master]: port arfcn range encode support from osmo-bsc

2018-12-11 Thread Stefan Sperling
Hello Max, Neels Hofmeyr, Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/10185

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

Change subject: port arfcn range encode support from osmo-bsc
..

port arfcn range encode support from osmo-bsc

As part of fixing issue OS#3075, we want to migrate support
for encoding system information from osmo-bsc to libosmocore.

This change ports one of the prerequisites for doing so:
osmo-bsc code for range-encoding ARFCNs, including tests.

An osmo_gsm48_ prefix has been prepended to public symbols in
order to avoid clashes with existing symbols in osmo-bsc code.

Change-Id: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c
Related: OS#3075
---
M include/Makefile.am
A include/osmocom/gsm/gsm48_arfcn_range_encode.h
M src/gsm/Makefile.am
A src/gsm/gsm48_arfcn_range_encode.c
M src/gsm/libosmogsm.map
M tests/gsm0408/gsm0408_test.c
A tests/gsm0408/gsm0408_test.err
M tests/gsm0408/gsm0408_test.ok
8 files changed, 774 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/85/10185/6
--
To view, visit https://gerrit.osmocom.org/10185
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: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c
Gerrit-Change-Number: 10185
Gerrit-PatchSet: 6
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Holger Freyther 


Change in libosmocore[master]: port arfcn range encode support from osmo-bsc

2018-12-11 Thread Stefan Sperling
Stefan Sperling has posted comments on this change. ( 
https://gerrit.osmocom.org/10185 )

Change subject: port arfcn range encode support from osmo-bsc
..


Patch Set 5:

(3 comments)

https://gerrit.osmocom.org/#/c/10185/5/src/gsm/gsm48_arfcn_range_encode.c
File src/gsm/gsm48_arfcn_range_encode.c:

https://gerrit.osmocom.org/#/c/10185/5/src/gsm/gsm48_arfcn_range_encode.c@213
PS5, Line 213: k, wk_len, octet_offs, bit_offs, level, 
lvl_left);
> ah damn. I think in a libosmocore utility function like this we shouldn't log 
> though? not sure...
Since these looks like ad-hoc debug printfs, I'll just remove them.


https://gerrit.osmocom.org/#/c/10185/5/tests/gsm0408/gsm0408_test.c
File tests/gsm0408/gsm0408_test.c:

https://gerrit.osmocom.org/#/c/10185/5/tests/gsm0408/gsm0408_test.c@618
PS5, Line 618: int arfcns_num, int silent)
> (weird indent .. […]
Yes, copied along. I'll fix it.


https://gerrit.osmocom.org/#/c/10185/5/tests/gsm0408/gsm0408_test.c@941
PS5, Line 941:  log_init(_info, NULL);
> Usually in regression tests, to get reproducable output I have to call: […]
Looks like no logging is needed. I'll remove this stuff.



--
To view, visit https://gerrit.osmocom.org/10185
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: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c
Gerrit-Change-Number: 10185
Gerrit-PatchSet: 5
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Holger Freyther 
Gerrit-Comment-Date: Tue, 11 Dec 2018 12:51:13 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in libosmocore[master]: port arfcn range encode support from osmo-bsc

2018-12-11 Thread Neels Hofmeyr
Neels Hofmeyr has posted comments on this change. ( 
https://gerrit.osmocom.org/10185 )

Change subject: port arfcn range encode support from osmo-bsc
..


Patch Set 5: Code-Review-1

(7 comments)

found some hither nor thither with logging ... either set

  log_set_category_filter(osmo_stderr_target, DLGLOBAL, 1, LOGL_DEBUG);

and also see the debug logging from the implementation, or remove logging from 
the regression test entirely. (no DMAIN needed)

Also rather printf to stdout only.

I know it is just copying from osmo-bsc, but still...

here the stuff I wrote before...

https://gerrit.osmocom.org/#/c/10185/5/src/gsm/gsm48_arfcn_range_encode.c
File src/gsm/gsm48_arfcn_range_encode.c:

https://gerrit.osmocom.org/#/c/10185/5/src/gsm/gsm48_arfcn_range_encode.c@26
PS5, Line 26: #include 
looks like this file has no logging.
That's a good thing. We don't need this header?


https://gerrit.osmocom.org/#/c/10185/5/src/gsm/gsm48_arfcn_range_encode.c@213
PS5, Line 213: k, wk_len, octet_offs, bit_offs, level, 
lvl_left);
ah damn. I think in a libosmocore utility function like this we shouldn't log 
though? not sure...


https://gerrit.osmocom.org/#/c/10185/5/tests/gsm0408/gsm0408_test.c
File tests/gsm0408/gsm0408_test.c:

https://gerrit.osmocom.org/#/c/10185/5/tests/gsm0408/gsm0408_test.c@618
PS5, Line 618: int arfcns_num, int silent)
(weird indent .. but this is just copying, right?)


https://gerrit.osmocom.org/#/c/10185/5/tests/gsm0408/gsm0408_test.c@646
PS5, Line 646:  range, arfcns_used, f0, f0_included);
rather printf()?


https://gerrit.osmocom.org/#/c/10185/5/tests/gsm0408/gsm0408_test.c@702
PS5, Line 702:  fprintf(stderr, " w = ");
printf


https://gerrit.osmocom.org/#/c/10185/5/tests/gsm0408/gsm0408_test.c@705
PS5, Line 705:  fprintf(stderr, "\n");
...


https://gerrit.osmocom.org/#/c/10185/5/tests/gsm0408/gsm0408_test.c@941
PS5, Line 941:  log_init(_info, NULL);
Usually in regression tests, to get reproducable output I have to call:

log_set_use_color(osmo_stderr_target, 0);
log_set_print_timestamp(osmo_stderr_target, 0);
log_set_print_filename(osmo_stderr_target, 0);

so how does it work that you get reproducable output on stderr? Is that even 
DMAIN logging there?

If there is no logging happening, we could either not init logging at all, or 
have empty categories[].

You could also decide to ignore stderr; if this is from fprintf(stderr,..) then 
maybe rather printf() to stdout



--
To view, visit https://gerrit.osmocom.org/10185
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: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c
Gerrit-Change-Number: 10185
Gerrit-PatchSet: 5
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Holger Freyther 
Gerrit-Comment-Date: Tue, 11 Dec 2018 11:35:01 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes


Change in libosmocore[master]: port arfcn range encode support from osmo-bsc

2018-12-11 Thread Stefan Sperling
Hello Max, Neels Hofmeyr, Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/10185

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

Change subject: port arfcn range encode support from osmo-bsc
..

port arfcn range encode support from osmo-bsc

As part of fixing issue OS#3075, we want to migrate support
for encoding system information from osmo-bsc to libosmocore.

This change ports one of the prerequisites for doing so:
osmo-bsc code for range-encoding ARFCNs, including tests.

An osmo_gsm48_ prefix has been prepended to public symbols in
order to avoid clashes with existing symbols in osmo-bsc code.

Change-Id: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c
Related: OS#3075
---
M include/Makefile.am
A include/osmocom/gsm/gsm48_arfcn_range_encode.h
M src/gsm/Makefile.am
A src/gsm/gsm48_arfcn_range_encode.c
M src/gsm/libosmogsm.map
M tests/gsm0408/gsm0408_test.c
A tests/gsm0408/gsm0408_test.err
M tests/gsm0408/gsm0408_test.ok
8 files changed, 796 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/85/10185/5
--
To view, visit https://gerrit.osmocom.org/10185
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: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c
Gerrit-Change-Number: 10185
Gerrit-PatchSet: 5
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Holger Freyther 


Change in libosmocore[master]: port arfcn range encode support from osmo-bsc

2018-12-06 Thread Neels Hofmeyr
Neels Hofmeyr has posted comments on this change. ( 
https://gerrit.osmocom.org/10185 )

Change subject: port arfcn range encode support from osmo-bsc
..


Patch Set 4:

(2 comments)

https://gerrit.osmocom.org/#/c/10185/4/include/osmocom/gsm/gsm48_arfcn_range_encode.h
File include/osmocom/gsm/gsm48_arfcn_range_encode.h:

https://gerrit.osmocom.org/#/c/10185/4/include/osmocom/gsm/gsm48_arfcn_range_encode.h@8
PS4, Line 8:OSMO_GSM48_ARFCN_RANGE_INVALID  = -1,
(gerrit shows an indenting mismatch... personally I'd just drop the tabs but ok 
if they line up)


https://gerrit.osmocom.org/#/c/10185/4/src/gsm/gsm48_arfcn_range_encode.c
File src/gsm/gsm48_arfcn_range_encode.c:

https://gerrit.osmocom.org/#/c/10185/4/src/gsm/gsm48_arfcn_range_encode.c@6
PS4, Line 6:  * (C) 2012 by On-Waves
add (C) 2018 sysmocom - s.f.m.c. GmbH?



--
To view, visit https://gerrit.osmocom.org/10185
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: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c
Gerrit-Change-Number: 10185
Gerrit-PatchSet: 4
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Holger Freyther 
Gerrit-Comment-Date: Thu, 06 Dec 2018 15:57:53 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in libosmocore[master]: port arfcn range encode support from osmo-bsc

2018-11-20 Thread Stefan Sperling
Stefan Sperling has posted comments on this change. ( 
https://gerrit.osmocom.org/10185 )

Change subject: port arfcn range encode support from osmo-bsc
..


Patch Set 3:

> Patch Set 3: Code-Review+1
>
> this issue looks like it is growing a beard? Still waiting for relicensing 
> approval?

Indeed. Still waiting for a written statement by Jolly.


--
To view, visit https://gerrit.osmocom.org/10185
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: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c
Gerrit-Change-Number: 10185
Gerrit-PatchSet: 3
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Holger Freyther 
Gerrit-Comment-Date: Tue, 20 Nov 2018 09:10:03 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in libosmocore[master]: port arfcn range encode support from osmo-bsc

2018-11-19 Thread Neels Hofmeyr
Neels Hofmeyr has posted comments on this change. ( 
https://gerrit.osmocom.org/10185 )

Change subject: port arfcn range encode support from osmo-bsc
..


Patch Set 3: Code-Review+1

this issue looks like it is growing a beard? Still waiting for relicensing 
approval?


--
To view, visit https://gerrit.osmocom.org/10185
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: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c
Gerrit-Change-Number: 10185
Gerrit-PatchSet: 3
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Holger Freyther 
Gerrit-Comment-Date: Tue, 20 Nov 2018 01:39:17 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in libosmocore[master]: port arfcn range encode support from osmo-bsc

2018-08-08 Thread Holger Freyther
Holger Freyther has posted comments on this change. ( 
https://gerrit.osmocom.org/10185 )

Change subject: port arfcn range encode support from osmo-bsc
..


Patch Set 3:

(1 comment)

https://gerrit.osmocom.org/#/c/10185/3/tests/gsm0408/gsm0408_test.c
File tests/gsm0408/gsm0408_test.c:

https://gerrit.osmocom.org/#/c/10185/3/tests/gsm0408/gsm0408_test.c@2
PS3, Line 2: * (C) 2012 by Harald Welte 
You might need to update this as well.



--
To view, visit https://gerrit.osmocom.org/10185
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: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c
Gerrit-Change-Number: 10185
Gerrit-PatchSet: 3
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Holger Freyther 
Gerrit-Comment-Date: Wed, 08 Aug 2018 21:05:14 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in libosmocore[master]: port arfcn range encode support from osmo-bsc

2018-08-08 Thread Holger Freyther
Holger Freyther has posted comments on this change. ( 
https://gerrit.osmocom.org/10185 )

Change subject: port arfcn range encode support from osmo-bsc
..


Patch Set 3:

(1 comment)

https://gerrit.osmocom.org/#/c/10185/3/src/gsm/gsm48_arfcn_range_encode.c
File src/gsm/gsm48_arfcn_range_encode.c:

https://gerrit.osmocom.org/#/c/10185/3/src/gsm/gsm48_arfcn_range_encode.c@10
PS3, Line 10:  * it under the terms of the GNU Affero General Public License as 
published by
> GNU GPLv2-or-later. […]
I don't object a relicensing to GPLv2 or later.



--
To view, visit https://gerrit.osmocom.org/10185
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: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c
Gerrit-Change-Number: 10185
Gerrit-PatchSet: 3
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Holger Freyther 
Gerrit-Comment-Date: Wed, 08 Aug 2018 20:54:38 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in libosmocore[master]: port arfcn range encode support from osmo-bsc

2018-07-27 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/10185 )

Change subject: port arfcn range encode support from osmo-bsc
..


Patch Set 3:

(1 comment)

https://gerrit.osmocom.org/#/c/10185/3/src/gsm/gsm48_arfcn_range_encode.c
File src/gsm/gsm48_arfcn_range_encode.c:

https://gerrit.osmocom.org/#/c/10185/3/src/gsm/gsm48_arfcn_range_encode.c@10
PS3, Line 10:  * it under the terms of the GNU Affero General Public License as 
published by
GNU GPLv2-or-later.  Please check any non-sysmocom / non-ONW authors that have 
contributed [significantly] tp the code that you imported here.  If there are 
any (Holger included) we must contact them to get their approval for 
re-licensingu under GPLv2-or-later



--
To view, visit https://gerrit.osmocom.org/10185
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: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c
Gerrit-Change-Number: 10185
Gerrit-PatchSet: 3
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Harald Welte 
Gerrit-Comment-Date: Fri, 27 Jul 2018 15:42:57 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in libosmocore[master]: port arfcn range encode support from osmo-bsc

2018-07-27 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/10185 )

Change subject: port arfcn range encode support from osmo-bsc
..


Patch Set 3: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/10185
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: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c
Gerrit-Change-Number: 10185
Gerrit-PatchSet: 3
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Stefan Sperling 
Gerrit-Comment-Date: Fri, 27 Jul 2018 15:43:01 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in libosmocore[master]: port arfcn range encode support from osmo-bsc

2018-07-27 Thread Stefan Sperling
Stefan Sperling has posted comments on this change. ( 
https://gerrit.osmocom.org/10185 )

Change subject: port arfcn range encode support from osmo-bsc
..


Patch Set 3:

> Patch Set 2:
>
> (1 comment)

Fixed in next patchset. New symbols now use an osmo_gsm48_ prefix.


--
To view, visit https://gerrit.osmocom.org/10185
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: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c
Gerrit-Change-Number: 10185
Gerrit-PatchSet: 3
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Stefan Sperling 
Gerrit-CC: Harald Welte 
Gerrit-Comment-Date: Fri, 27 Jul 2018 14:09:29 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in libosmocore[master]: port arfcn range encode support from osmo-bsc

2018-07-27 Thread Stefan Sperling
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/10185

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

Change subject: port arfcn range encode support from osmo-bsc
..

port arfcn range encode support from osmo-bsc

As part of fixing issue OS#3075, we want to migrate support
for encoding system information from osmo-bsc to libosmocore.

This change ports one of the prerequisites for doing so:
osmo-bsc code for range-encoding ARFCNs, including tests.

An osmo_gsm48_ prefix has been prepended to public symbols in
order to avoid clashes with existing symbols in osmo-bsc code.

Change-Id: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c
Related: OS#3075
---
M include/Makefile.am
A include/osmocom/gsm/gsm48_arfcn_range_encode.h
M src/gsm/Makefile.am
A src/gsm/gsm48_arfcn_range_encode.c
M src/gsm/libosmogsm.map
M tests/gsm0408/gsm0408_test.c
A tests/gsm0408/gsm0408_test.err
M tests/gsm0408/gsm0408_test.ok
8 files changed, 796 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/85/10185/3
--
To view, visit https://gerrit.osmocom.org/10185
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: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c
Gerrit-Change-Number: 10185
Gerrit-PatchSet: 3
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: Harald Welte 


Change in libosmocore[master]: port arfcn range encode support from osmo-bsc

2018-07-27 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/10185 )

Change subject: port arfcn range encode support from osmo-bsc
..


Patch Set 2:

(1 comment)

https://gerrit.osmocom.org/#/c/10185/2/include/osmocom/gsm/gsm48_arfcn_range_encode.h
File include/osmocom/gsm/gsm48_arfcn_range_encode.h:

https://gerrit.osmocom.org/#/c/10185/2/include/osmocom/gsm/gsm48_arfcn_range_encode.h@17
PS2, Line 17: int gsm48_range_enc_determine_range(const int *arfcns, int size, 
int *f0_out);
for newly-introduced symbols we typically use an "osmo_" prefix. non "osmo_" 
prefixed symbols are all legacy.

Yes, the symbol names get a bit long with all those prefixes, but the general 
rule is that applications must not define symbols with osmo_ prefix, while the 
libraries provide symbols with osmo_ prefix.



--
To view, visit https://gerrit.osmocom.org/10185
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: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c
Gerrit-Change-Number: 10185
Gerrit-PatchSet: 2
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: Harald Welte 
Gerrit-Comment-Date: Fri, 27 Jul 2018 13:08:44 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in libosmocore[master]: port arfcn range encode support from osmo-bsc

2018-07-27 Thread Stefan Sperling
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/10185

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

Change subject: port arfcn range encode support from osmo-bsc
..

port arfcn range encode support from osmo-bsc

As part of fixing issue OS#3075, we want to migrate support
for encoding system information from osmo-bsc to libosmocore.

This change ports one of the prerequisites for doing so:
osmo-bsc code for range-encoding ARFCNs, including tests.

A gsm48_ prefix has been prepended to public symbols in order
to avoid clashes with existing symbols in osmo-bsc code.

Change-Id: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c
Related: OS#3075
---
M include/Makefile.am
A include/osmocom/gsm/gsm48_arfcn_range_encode.h
M src/gsm/Makefile.am
A src/gsm/gsm48_arfcn_range_encode.c
M src/gsm/libosmogsm.map
M tests/gsm0408/gsm0408_test.c
A tests/gsm0408/gsm0408_test.err
M tests/gsm0408/gsm0408_test.ok
8 files changed, 799 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/85/10185/2
--
To view, visit https://gerrit.osmocom.org/10185
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: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c
Gerrit-Change-Number: 10185
Gerrit-PatchSet: 2
Gerrit-Owner: Stefan Sperling 
Gerrit-Reviewer: Jenkins Builder


Change in libosmocore[master]: port arfcn range encode support from osmo-bsc

2018-07-27 Thread Stefan Sperling
Stefan Sperling has uploaded this change for review. ( 
https://gerrit.osmocom.org/10185


Change subject: port arfcn range encode support from osmo-bsc
..

port arfcn range encode support from osmo-bsc

As part of fixing issue OS#3075, we want to migrate support
for encoding system information from osmo-bsc to libosmocore.

This change ports one of the prerequisites for doing so:
osmo-bsc code for range-encoding ARFCNs, including tests.

A gsm48_ prefix has been prepended to public symbols in order
to avoid clashes with existing symbols in osmo-bsc code.

Change-Id: Ia220764fba451be5e975ae7c5eefb1a25ac2bf2c
Related: OS#3075
---
A include/osmocom/gsm/gsm48_arfcn_range_encode.h
M src/gsm/Makefile.am
A src/gsm/gsm48_arfcn_range_encode.c
M src/gsm/libosmogsm.map
M tests/gsm0408/gsm0408_test.c
A tests/gsm0408/gsm0408_test.err
M tests/gsm0408/gsm0408_test.ok
7 files changed, 798 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/85/10185/1

diff --git a/include/osmocom/gsm/gsm48_arfcn_range_encode.h 
b/include/osmocom/gsm/gsm48_arfcn_range_encode.h
new file mode 100644
index 000..d015db1
--- /dev/null
+++ b/include/osmocom/gsm/gsm48_arfcn_range_encode.h
@@ -0,0 +1,25 @@
+/*! \file gsm48_arfcn_range_encode.h */
+
+#pragma once
+
+#include 
+
+enum gsm48_range {
+   GSM48_ARFCN_RANGE_INVALID   = -1,
+   GSM48_ARFCN_RANGE_128   = 127,
+   GSM48_ARFCN_RANGE_256   = 255,
+   GSM48_ARFCN_RANGE_512   = 511,
+   GSM48_ARFCN_RANGE_1024  = 1023,
+};
+
+#define GSM48_RANGE_ENC_MAX_ARFCNS 29
+
+int gsm48_range_enc_determine_range(const int *arfcns, int size, int *f0_out);
+int gsm48_range_enc_arfcns(enum gsm48_range rng, const int *arfcns, int sze, 
int *out, int idx);
+int gsm48_range_enc_find_index(enum gsm48_range rng, const int *arfcns, int 
size);
+int gsm48_range_enc_filter_arfcns(int *arfcns, const int sze, const int f0, 
int *f0_included);
+
+int gsm48_range_enc_range128(uint8_t *chan_list, int f0, int *w);
+int gsm48_range_enc_range256(uint8_t *chan_list, int f0, int *w);
+int gsm48_range_enc_range512(uint8_t *chan_list, int f0, int *w);
+int gsm48_range_enc_range1024(uint8_t *chan_list, int f0, int f0_incl, int *w);
diff --git a/src/gsm/Makefile.am b/src/gsm/Makefile.am
index 5387e3a..2f06749 100644
--- a/src/gsm/Makefile.am
+++ b/src/gsm/Makefile.am
@@ -21,9 +21,9 @@
 BUILT_SOURCES = gsm0503_conv.c

 libgsmint_la_SOURCES =  a5.c rxlev_stat.c tlv_parser.c comp128.c comp128v23.c \
-   gsm_utils.c rsl.c gsm48.c gsm48_ie.c gsm0808.c 
sysinfo.c \
-   gprs_cipher_core.c gprs_rlc.c gsm0480.c abis_nm.c 
gsm0502.c \
-   gsm0411_utils.c gsm0411_smc.c gsm0411_smr.c gsm0414.c \
+   gsm_utils.c rsl.c gsm48.c gsm48_ie.c 
gsm48_arfcn_range_encode.c \
+   gsm0808.c sysinfo.c gprs_cipher_core.c gprs_rlc.c 
gsm0480.c abis_nm.c \
+   gsm0502.c gsm0411_utils.c gsm0411_smc.c gsm0411_smr.c 
gsm0414.c \
lapd_core.c lapdm.c kasumi.c gsm_04_08_gprs.c \
auth_core.c auth_comp128v1.c auth_comp128v23.c \
auth_milenage.c milenage/aes-encblock.c gea.c \
diff --git a/src/gsm/gsm48_arfcn_range_encode.c 
b/src/gsm/gsm48_arfcn_range_encode.c
new file mode 100644
index 000..17fcbd3
--- /dev/null
+++ b/src/gsm/gsm48_arfcn_range_encode.c
@@ -0,0 +1,334 @@
+/* gsm 04.08 system information (si) encoding and decoding
+ * 3gpp ts 04.08 version 7.21.0 release 1998 / etsi ts 100 940 v7.21.0 */
+
+/*
+ * (C) 2012 Holger Hans Peter Freyther
+ * (C) 2012 by On-Waves
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU Affero General Public License as published by
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU Affero General Public License for more details.
+ *
+ * You should have received a copy of the GNU Affero General Public License
+ * along with this program.  If not, see .
+ */
+
+#include 
+#include 
+
+#include 
+#include 
+
+#include 
+
+static inline int greatest_power_of_2_lesser_or_equal_to(int index)
+{
+   int power_of_2 = 1;
+
+   do {
+   power_of_2 *= 2;
+   } while (power_of_2 <= index);
+
+   /* now go back one step */
+   return power_of_2 / 2;
+}
+
+static inline int mod(int data, int range)
+{
+   int res = data % range;
+   while (res < 0)
+   res += range;
+   return res;
+}
+
+/**
+ * Determine at which index to split the