Change in libosmocore[master]: LCLS, TS 29.205: add GCR routines

2018-12-14 Thread Max
Max has submitted this change and it was merged. ( 
https://gerrit.osmocom.org/11827 )

Change subject: LCLS, TS 29.205: add GCR routines
..

LCLS, TS 29.205: add GCR routines

Add functions to encode and decode Global Call Reference as per
3GPP TS 29.205 Table B 2.1.9.1 add corresponding tests.

Change-Id: Iee95aa4e5c056645b6cb5667e4a067097d52dfbf
Related: OS#2487
---
M include/Makefile.am
M include/osmocom/gsm/gsm0808_utils.h
A include/osmocom/gsm/gsm29205.h
M src/gsm/Makefile.am
A src/gsm/gsm29205.c
M src/gsm/libosmogsm.map
M tests/Makefile.am
A tests/gsm29205/gsm29205_test.c
A tests/gsm29205/gsm29205_test.ok
M tests/testsuite.at
10 files changed, 263 insertions(+), 4 deletions(-)

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



diff --git a/include/Makefile.am b/include/Makefile.am
index 366fd70..ccf9e10 100644
--- a/include/Makefile.am
+++ b/include/Makefile.am
@@ -86,6 +86,7 @@
osmocom/coding/gsm0503_interleaving.h \
osmocom/coding/gsm0503_coding.h \
osmocom/gsm/gsm0808.h \
+   osmocom/gsm/gsm29205.h \
osmocom/gsm/gsm0808_utils.h \
osmocom/gsm/gsm23003.h \
osmocom/gsm/gsm29118.h \
diff --git a/include/osmocom/gsm/gsm0808_utils.h 
b/include/osmocom/gsm/gsm0808_utils.h
index 90ff677..5d5803b 100644
--- a/include/osmocom/gsm/gsm0808_utils.h
+++ b/include/osmocom/gsm/gsm0808_utils.h
@@ -62,7 +62,7 @@
 struct osmo_lcls {
enum gsm0808_lcls_config config;   /**< §3.2.2.116 Configuration */
enum gsm0808_lcls_control control; /**< §3.2.2.117 Connection Status 
Control */
-   struct gsm29205_gcr *gcr;  /**< §3.2.2.115 Global Call 
Reference */
+   struct osmo_gcr_parsed *gcr;   /**< §3.2.2.115 Global Call 
Reference */
bool corr_needed;  /**< §3.2.2.118 
Correlation-Not-Needed */
 };

diff --git a/include/osmocom/gsm/gsm29205.h b/include/osmocom/gsm/gsm29205.h
new file mode 100644
index 000..0c3c153
--- /dev/null
+++ b/include/osmocom/gsm/gsm29205.h
@@ -0,0 +1,41 @@
+/*! \defgroup gsm29205 3GPP TS 29.205
+ *  @{
+ *  \file gsm29205.h */
+/*
+ * (C) 2018 by sysmocom - s.f.m.c. GmbH
+ * All Rights Reserved
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 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 General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
+ *
+ */
+
+#pragma once
+
+#include 
+
+#include 
+
+#define OSMO_GCR_MIN_LEN 13
+
+/*! Parsed representation of Global Call Reference, 3GPP TS 29.205 Table B 
2.1.9.1. */
+struct osmo_gcr_parsed {
+   uint8_t net[5];  /** Network ID, ITU-T Q.1902.3 */
+   uint8_t net_len; /** length (3-5 octets) of gsm29205_gcr#net */
+   uint16_t node;   /** Node ID */
+   uint8_t cr[5];   /** Call Reference ID */
+};
+
+uint8_t osmo_enc_gcr(struct msgb *msg, const struct osmo_gcr_parsed *g);
+int osmo_dec_gcr(struct osmo_gcr_parsed *gcr, const uint8_t *elem, uint8_t 
len);
diff --git a/src/gsm/Makefile.am b/src/gsm/Makefile.am
index e28ea33..ccb38ad 100644
--- a/src/gsm/Makefile.am
+++ b/src/gsm/Makefile.am
@@ -24,7 +24,7 @@
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 \
-   lapd_core.c lapdm.c kasumi.c gsm_04_08_gprs.c \
+   lapd_core.c lapdm.c kasumi.c gsm29205.c 
gsm_04_08_gprs.c \
auth_core.c auth_comp128v1.c auth_comp128v23.c \
auth_milenage.c milenage/aes-encblock.c gea.c \
milenage/aes-internal.c milenage/aes-internal-enc.c \
diff --git a/src/gsm/gsm29205.c b/src/gsm/gsm29205.c
new file mode 100644
index 000..0ef29b7
--- /dev/null
+++ b/src/gsm/gsm29205.c
@@ -0,0 +1,93 @@
+/*
+ * (C) 2018 by sysmocom - s.f.m.c. GmbH
+ * All Rights Reserved
+ *
+ * SPDX-License-Identifier: GPL-2.0+
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either 

Change in libosmocore[master]: LCLS, TS 29.205: add GCR routines

2018-12-14 Thread Max
Max has removed a vote on this change.

Change subject: LCLS, TS 29.205: add GCR routines
..


Removed Code-Review+2 by Max 
--
To view, visit https://gerrit.osmocom.org/11827
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-MessageType: deleteVote
Gerrit-Change-Id: Iee95aa4e5c056645b6cb5667e4a067097d52dfbf
Gerrit-Change-Number: 11827
Gerrit-PatchSet: 24
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Stefan Sperling 


Change in libosmocore[master]: LCLS, TS 29.205: add GCR routines

2018-12-14 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/11827 )

Change subject: LCLS, TS 29.205: add GCR routines
..


Patch Set 24: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11827
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: Iee95aa4e5c056645b6cb5667e4a067097d52dfbf
Gerrit-Change-Number: 11827
Gerrit-PatchSet: 24
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-Comment-Date: Fri, 14 Dec 2018 12:40:09 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in libosmocore[master]: LCLS, TS 29.205: add GCR routines

2018-12-14 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/11827 )

Change subject: LCLS, TS 29.205: add GCR routines
..


Patch Set 24: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/11827
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: Iee95aa4e5c056645b6cb5667e4a067097d52dfbf
Gerrit-Change-Number: 11827
Gerrit-PatchSet: 24
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-Comment-Date: Fri, 14 Dec 2018 12:32:54 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in libosmocore[master]: LCLS, TS 29.205: add GCR routines

2018-12-13 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/11827 )

Change subject: LCLS, TS 29.205: add GCR routines
..


Patch Set 24:

(1 comment)

https://gerrit.osmocom.org/#/c/11827/23/tests/gsm29205/gsm29205_test.c
File tests/gsm29205/gsm29205_test.c:

https://gerrit.osmocom.org/#/c/11827/23/tests/gsm29205/gsm29205_test.c@69
PS23, Line 69:  abort();
> Same problem as pointed out by Pau in 
> https://gerrit.osmocom.org/c/libosmocore/+/12020 […]
Done



--
To view, visit https://gerrit.osmocom.org/11827
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: Iee95aa4e5c056645b6cb5667e4a067097d52dfbf
Gerrit-Change-Number: 11827
Gerrit-PatchSet: 24
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-Comment-Date: Thu, 13 Dec 2018 16:22:06 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in libosmocore[master]: LCLS, TS 29.205: add GCR routines

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

Change subject: LCLS, TS 29.205: add GCR routines
..


Patch Set 24: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/11827
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: Iee95aa4e5c056645b6cb5667e4a067097d52dfbf
Gerrit-Change-Number: 11827
Gerrit-PatchSet: 24
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-Comment-Date: Wed, 12 Dec 2018 20:58:44 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in libosmocore[master]: LCLS, TS 29.205: add GCR routines

2018-12-12 Thread Max
Hello Stefan Sperling, Pau Espin Pedrol, Neels Hofmeyr, Harald Welte, Jenkins 
Builder,

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

https://gerrit.osmocom.org/11827

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

Change subject: LCLS, TS 29.205: add GCR routines
..

LCLS, TS 29.205: add GCR routines

Add functions to encode and decode Global Call Reference as per
3GPP TS 29.205 Table B 2.1.9.1 add corresponding tests.

Change-Id: Iee95aa4e5c056645b6cb5667e4a067097d52dfbf
Related: OS#2487
---
M include/Makefile.am
M include/osmocom/gsm/gsm0808_utils.h
A include/osmocom/gsm/gsm29205.h
M src/gsm/Makefile.am
A src/gsm/gsm29205.c
M src/gsm/libosmogsm.map
M tests/Makefile.am
A tests/gsm29205/gsm29205_test.c
A tests/gsm29205/gsm29205_test.ok
M tests/testsuite.at
10 files changed, 263 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/27/11827/24
--
To view, visit https://gerrit.osmocom.org/11827
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: Iee95aa4e5c056645b6cb5667e4a067097d52dfbf
Gerrit-Change-Number: 11827
Gerrit-PatchSet: 24
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Stefan Sperling 


Change in libosmocore[master]: LCLS, TS 29.205: add GCR routines

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

Change subject: LCLS, TS 29.205: add GCR routines
..


Patch Set 23: Code-Review-1

(1 comment)

https://gerrit.osmocom.org/#/c/11827/23/tests/gsm29205/gsm29205_test.c
File tests/gsm29205/gsm29205_test.c:

https://gerrit.osmocom.org/#/c/11827/23/tests/gsm29205/gsm29205_test.c@69
PS23, Line 69:
Same problem as pointed out by Pau in 
https://gerrit.osmocom.org/c/libosmocore/+/12020
The decoder failed, so we should treat the contents of p as undefined and just 
skip the code below.
The osmo_dec_gcr() API does not allow for any other reasonable course of action 
because the caller can't tell how the decoder failed exactly.



--
To view, visit https://gerrit.osmocom.org/11827
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: Iee95aa4e5c056645b6cb5667e4a067097d52dfbf
Gerrit-Change-Number: 11827
Gerrit-PatchSet: 23
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-Comment-Date: Mon, 10 Dec 2018 18:34:59 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes


Change in libosmocore[master]: LCLS, TS 29.205: add GCR routines

2018-12-10 Thread Max
Hello Stefan Sperling, Pau Espin Pedrol, Neels Hofmeyr, Harald Welte, Jenkins 
Builder,

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

https://gerrit.osmocom.org/11827

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

Change subject: LCLS, TS 29.205: add GCR routines
..

LCLS, TS 29.205: add GCR routines

Add functions to encode and decode Global Call Reference as per
3GPP TS 29.205 Table B 2.1.9.1 add corresponding tests.

Change-Id: Iee95aa4e5c056645b6cb5667e4a067097d52dfbf
Related: OS#2487
---
M include/Makefile.am
M include/osmocom/gsm/gsm0808_utils.h
A include/osmocom/gsm/gsm29205.h
M src/gsm/Makefile.am
A src/gsm/gsm29205.c
M src/gsm/libosmogsm.map
M tests/Makefile.am
A tests/gsm29205/gsm29205_test.c
A tests/gsm29205/gsm29205_test.ok
M tests/testsuite.at
10 files changed, 253 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/27/11827/23
--
To view, visit https://gerrit.osmocom.org/11827
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: Iee95aa4e5c056645b6cb5667e4a067097d52dfbf
Gerrit-Change-Number: 11827
Gerrit-PatchSet: 23
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Stefan Sperling 


Change in libosmocore[master]: LCLS, TS 29.205: add GCR routines

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

Change subject: LCLS, TS 29.205: add GCR routines
..


Patch Set 21: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/11827
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: Iee95aa4e5c056645b6cb5667e4a067097d52dfbf
Gerrit-Change-Number: 11827
Gerrit-PatchSet: 21
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Reviewer: Stefan Sperling 
Gerrit-Comment-Date: Thu, 06 Dec 2018 12:51:29 +
Gerrit-HasComments: No
Gerrit-HasLabels: Yes


Change in libosmocore[master]: LCLS, TS 29.205: add GCR routines

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

Change subject: LCLS, TS 29.205: add GCR routines
..


Set Ready For Review


--
To view, visit https://gerrit.osmocom.org/11827
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: Iee95aa4e5c056645b6cb5667e4a067097d52dfbf
Gerrit-Change-Number: 11827
Gerrit-PatchSet: 21
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Thu, 06 Dec 2018 11:18:34 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in libosmocore[master]: LCLS, TS 29.205: add GCR routines

2018-12-06 Thread Max
Hello Pau Espin Pedrol, Neels Hofmeyr, Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/11827

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

Change subject: LCLS, TS 29.205: add GCR routines
..

LCLS, TS 29.205: add GCR routines

Add functions to encode and decode Global Call Reference as per
3GPP TS 29.205 Table B 2.1.9.1 add corresponding tests.

Change-Id: Iee95aa4e5c056645b6cb5667e4a067097d52dfbf
Related: OS#2487
---
M include/Makefile.am
A include/osmocom/gsm/gsm29205.h
M src/gsm/Makefile.am
A src/gsm/gsm29205.c
M src/gsm/libosmogsm.map
M tests/Makefile.am
A tests/gsm29205/gsm29205_test.c
A tests/gsm29205/gsm29205_test.ok
M tests/testsuite.at
9 files changed, 252 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/27/11827/20
--
To view, visit https://gerrit.osmocom.org/11827
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: Iee95aa4e5c056645b6cb5667e4a067097d52dfbf
Gerrit-Change-Number: 11827
Gerrit-PatchSet: 20
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 


Change in libosmocore[master]: LCLS, TS 29.205: add GCR routines

2018-12-04 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/11827 )

Change subject: LCLS, TS 29.205: add GCR routines
..


Set Ready For Review


--
To view, visit https://gerrit.osmocom.org/11827
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: Iee95aa4e5c056645b6cb5667e4a067097d52dfbf
Gerrit-Change-Number: 11827
Gerrit-PatchSet: 19
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Tue, 04 Dec 2018 13:37:19 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in libosmocore[master]: LCLS, TS 29.205: add GCR routines

2018-12-04 Thread Max
Hello Pau Espin Pedrol, Neels Hofmeyr, Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/11827

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

Change subject: LCLS, TS 29.205: add GCR routines
..

LCLS, TS 29.205: add GCR routines

Add functions to encode and decode Global Call Reference as per
3GPP TS 29.205 Table B 2.1.9.1 add corresponding tests.

Change-Id: Iee95aa4e5c056645b6cb5667e4a067097d52dfbf
Related: OS#2487
---
M include/Makefile.am
A include/osmocom/gsm/gsm29205.h
M src/gsm/Makefile.am
A src/gsm/gsm29205.c
M src/gsm/libosmogsm.map
M tests/Makefile.am
A tests/gsm29205/gsm29205_test.c
A tests/gsm29205/gsm29205_test.ok
M tests/testsuite.at
9 files changed, 250 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/27/11827/17
--
To view, visit https://gerrit.osmocom.org/11827
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: Iee95aa4e5c056645b6cb5667e4a067097d52dfbf
Gerrit-Change-Number: 11827
Gerrit-PatchSet: 17
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 


Change in libosmocore[master]: LCLS, TS 29.205: add GCR routines

2018-12-04 Thread Max
Hello Pau Espin Pedrol, Neels Hofmeyr, Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/11827

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

Change subject: LCLS, TS 29.205: add GCR routines
..

LCLS, TS 29.205: add GCR routines

Add functions to encode and decode Global Call Reference as per
3GPP TS 29.205 Table B 2.1.9.1 add corresponding tests.

Change-Id: Iee95aa4e5c056645b6cb5667e4a067097d52dfbf
Related: OS#2487
---
M include/Makefile.am
A include/osmocom/gsm/gsm29205.h
M src/gsm/Makefile.am
A src/gsm/gsm29205.c
M src/gsm/libosmogsm.map
M tests/Makefile.am
A tests/gsm29205/gsm29205_test.c
A tests/gsm29205/gsm29205_test.ok
M tests/testsuite.at
9 files changed, 248 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/27/11827/16
--
To view, visit https://gerrit.osmocom.org/11827
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: Iee95aa4e5c056645b6cb5667e4a067097d52dfbf
Gerrit-Change-Number: 11827
Gerrit-PatchSet: 16
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 


Change in libosmocore[master]: LCLS, TS 29.205: add GCR routines

2018-12-03 Thread Harald Welte
Harald Welte has posted comments on this change. ( 
https://gerrit.osmocom.org/11827 )

Change subject: LCLS, TS 29.205: add GCR routines
..


Patch Set 14:

(3 comments)

https://gerrit.osmocom.org/#/c/11827/14/include/osmocom/gsm/gsm29205.h
File include/osmocom/gsm/gsm29205.h:

https://gerrit.osmocom.org/#/c/11827/14/include/osmocom/gsm/gsm29205.h@33
PS14, Line 33: struct gsm29205_gcr {
the name doesn't really indicate whether it's a structure as used in the spec 
(encoded data) or some parsed representation.  using _parsed as suffix would 
make it clear.  Also, if things are osmo_ prefixed and not gsm prefixed, 
there's less likelihood somebody thinks this represents encoded "on the wire" 
data.


https://gerrit.osmocom.org/#/c/11827/14/include/osmocom/gsm/gsm29205.h@40
PS14, Line 40: uint8_t gsm29205_enc_gcr(struct msgb *msg, const struct 
gsm29205_gcr *g);
use osmo_ prefix for all new symbols introduced in osmocom libraries.  the 
struct above should also be prefixed.


https://gerrit.osmocom.org/#/c/11827/14/tests/gsm29205/gsm29205_test.c
File tests/gsm29205/gsm29205_test.c:

https://gerrit.osmocom.org/#/c/11827/14/tests/gsm29205/gsm29205_test.c@2
PS14, Line 2: S
sysmocom, not Sysmocom



--
To view, visit https://gerrit.osmocom.org/11827
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: Iee95aa4e5c056645b6cb5667e4a067097d52dfbf
Gerrit-Change-Number: 11827
Gerrit-PatchSet: 14
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Mon, 03 Dec 2018 16:16:41 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in libosmocore[master]: LCLS, TS 29.205: add GCR routines

2018-12-03 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/11827 )

Change subject: LCLS, TS 29.205: add GCR routines
..


Set Ready For Review


--
To view, visit https://gerrit.osmocom.org/11827
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: Iee95aa4e5c056645b6cb5667e4a067097d52dfbf
Gerrit-Change-Number: 11827
Gerrit-PatchSet: 14
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Mon, 03 Dec 2018 14:21:02 +
Gerrit-HasComments: No
Gerrit-HasLabels: No


Change in libosmocore[master]: LCLS, TS 29.205: add GCR routines

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

Change subject: LCLS, TS 29.205: add GCR routines
..


Patch Set 12: Code-Review-1

(15 comments)

https://gerrit.osmocom.org/#/c/11827/12/include/osmocom/gsm/gsm29_205.h
File include/osmocom/gsm/gsm29_205.h:

https://gerrit.osmocom.org/#/c/11827/12/include/osmocom/gsm/gsm29_205.h@1
PS12, Line 1: /*! \defgroup gsm29205 3GPP TS 29.205
(if everything is calld 29205, then maybe also call the file 29205 without _ 
... personally I get annoyed by typing gsm_08_08.c and gsm_04_08.c, gsm0808 is 
so much quicker, that's why my pref would be no underscores... if you agree.)


https://gerrit.osmocom.org/#/c/11827/12/include/osmocom/gsm/gsm29_205.h@32
PS12, Line 32: /*! Parsed representation of Global Call Reference, 3GPP TS 
29.205 Table B 2.1.9.1 */
.


https://gerrit.osmocom.org/#/c/11827/12/include/osmocom/gsm/gsm29_205.h@34
PS12, Line 34:  uint8_t net[5];  /*< doc Network ID, ITU-T Q.1902.3 */
doc


https://gerrit.osmocom.org/#/c/11827/12/src/gsm/gsm29_205.c
File src/gsm/gsm29_205.c:

https://gerrit.osmocom.org/#/c/11827/12/src/gsm/gsm29_205.c@37
PS12, Line 37: /*! Create Global Call Reference
.


https://gerrit.osmocom.org/#/c/11827/12/src/gsm/gsm29_205.c@56
PS12, Line 56:  msgb_lv_put(msg, 5, g->cr);
(but to reduce magic numbers, maybe sizeof(g->cr)?)


https://gerrit.osmocom.org/#/c/11827/12/src/gsm/gsm29_205.c@62
PS12, Line 62: /*! Decode Global Call Reference, 3GPP TS 29.205 Table B 2.1.9.1
.


https://gerrit.osmocom.org/#/c/11827/12/src/gsm/gsm29_205.c@72
PS12, Line 72:  return -EBADMSG;
(I guess would also be -EINVAL?)


https://gerrit.osmocom.org/#/c/11827/12/src/gsm/gsm29_205.c@79
PS12, Line 79:  parsed += (gcr->net_len + 1);
net_len is what you just parsed, and the +1?

If +1 is the following len, then parse and check that instead of ignoring


https://gerrit.osmocom.org/#/c/11827/12/src/gsm/gsm29_205.c@84
PS12, Line 84:  if (elem[parsed - 1] != 5) /* see Table B 2.1.9.2 */
it's weird to first add +1 and then do -1 again. Rather drop the +1 above, then 
parse the len at elem[parsed], and then +1 after that.

(nice to use sizeof instead of magic)


https://gerrit.osmocom.org/#/c/11827/12/src/gsm/gsm29_205.c@85
PS12, Line 85:  return -ENOENT;
I guess would also be -EINVAL?


https://gerrit.osmocom.org/#/c/11827/12/tests/gsm29205/gsm29205_test.c
File tests/gsm29205/gsm29205_test.c:

https://gerrit.osmocom.org/#/c/11827/12/tests/gsm29205/gsm29205_test.c@41
PS12, Line 41:  0x46, 0x46, 0x46, 0x46, 0x46 /* .cr - Call. Ref. */
vary byte values


https://gerrit.osmocom.org/#/c/11827/12/tests/gsm29205/gsm29205_test.c@45
PS12, Line 45:  struct gsm29205_gcr g = { .net_len = 3, .node = 0xDEAD }, p = { 
0 };
= {}


https://gerrit.osmocom.org/#/c/11827/12/tests/gsm29205/gsm29205_test.c@53
PS12, Line 53:  memset(g.net, 'U', g.net_len);
vary bytes


https://gerrit.osmocom.org/#/c/11827/12/tests/gsm29205/gsm29205_test.c@59
PS12, Line 59:  if (!msgb_cmp_data_print(msg, res, ARRAY_SIZE(res)))
cmp() == 0 means match


https://gerrit.osmocom.org/#/c/11827/12/tests/gsm29205/gsm29205_test.c@64
PS12, Line 64:  printf("decoding failed: %s [%s]\n", strerror(-rc), 
msgb_hexdump(msg));
abort(): it does not make sense to parse network id length and so on if not 
even the p got populated



--
To view, visit https://gerrit.osmocom.org/11827
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: Iee95aa4e5c056645b6cb5667e4a067097d52dfbf
Gerrit-Change-Number: 11827
Gerrit-PatchSet: 12
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Fri, 30 Nov 2018 16:15:25 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes


Change in libosmocore[master]: LCLS, TS 29.205: add GCR routines

2018-11-30 Thread Max
Hello Pau Espin Pedrol, Neels Hofmeyr, Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/11827

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

Change subject: LCLS, TS 29.205: add GCR routines
..

LCLS, TS 29.205: add GCR routines

Add functions to encode and decode Global Call Reference as per
3GPP TS 29.205 Table B 2.1.9.1 add corresponding tests.

Change-Id: Iee95aa4e5c056645b6cb5667e4a067097d52dfbf
Related: OS#2487
---
M include/Makefile.am
A include/osmocom/gsm/gsm29_205.h
M src/gsm/Makefile.am
A src/gsm/gsm29_205.c
M src/gsm/libosmogsm.map
M tests/Makefile.am
A tests/gsm29205/gsm29205_test.c
A tests/gsm29205/gsm29205_test.ok
M tests/testsuite.at
9 files changed, 243 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/27/11827/12
--
To view, visit https://gerrit.osmocom.org/11827
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: Iee95aa4e5c056645b6cb5667e4a067097d52dfbf
Gerrit-Change-Number: 11827
Gerrit-PatchSet: 12
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 


Change in libosmocore[master]: LCLS, TS 29.205: add GCR routines

2018-11-30 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/11827 )

Change subject: LCLS, TS 29.205: add GCR routines
..


Patch Set 9:

(3 comments)

The rest should be addressed in next revision.

https://gerrit.osmocom.org/#/c/11827/9/src/gsm/gsm29_205.c
File src/gsm/gsm29_205.c:

https://gerrit.osmocom.org/#/c/11827/9/src/gsm/gsm29_205.c@82
PS9, Line 82:   parsed += (2 + 1);
> parenthesis can be dropped here.
I think it would reduce readability so I'd rather keep them.


https://gerrit.osmocom.org/#/c/11827/9/src/gsm/libosmogsm.map
File src/gsm/libosmogsm.map:

https://gerrit.osmocom.org/#/c/11827/9/src/gsm/libosmogsm.map@147
PS9, Line 147: gsm29205_enc_gcr;
> I know not everything is perfectly sorted, but let's try to keep it as sorted 
> as possible, so move t […]
Curious, why it should be sorted at all? I thought this file is loaded 
completely by linker and entries order does not matter.


https://gerrit.osmocom.org/#/c/11827/9/tests/gsm29205/gsm29205_test.c
File tests/gsm29205/gsm29205_test.c:

https://gerrit.osmocom.org/#/c/11827/9/tests/gsm29205/gsm29205_test.c@64
PS9, Line 64:   printf("decoding failed: %s [%s]\n", strerror(-rc), 
msgb_hexdump(msg));
> All these should exit, or at least return.
Why? Printing unexpected text on the screen will cause test failure just like 
unexpected exit. At the same time running till the end of the test allows us to 
see multiple errors at once.



--
To view, visit https://gerrit.osmocom.org/11827
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: Iee95aa4e5c056645b6cb5667e4a067097d52dfbf
Gerrit-Change-Number: 11827
Gerrit-PatchSet: 9
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Fri, 30 Nov 2018 14:57:39 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: No


Change in libosmocore[master]: LCLS, TS 29.205: add GCR routines

2018-11-30 Thread Max
Hello Pau Espin Pedrol, Neels Hofmeyr, Harald Welte, Jenkins Builder,

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

https://gerrit.osmocom.org/11827

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

Change subject: LCLS, TS 29.205: add GCR routines
..

LCLS, TS 29.205: add GCR routines

Add functions to encode and decode Global Call Reference as per
3GPP TS 29.205 Table B 2.1.9.1 add corresponding tests.

Change-Id: Iee95aa4e5c056645b6cb5667e4a067097d52dfbf
Related: OS#2487
---
M include/Makefile.am
A include/osmocom/gsm/gsm29_205.h
M src/gsm/Makefile.am
A src/gsm/gsm29_205.c
M src/gsm/libosmogsm.map
M tests/Makefile.am
A tests/gsm29205/gsm29205_test.c
A tests/gsm29205/gsm29205_test.ok
M tests/testsuite.at
9 files changed, 243 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/27/11827/10
--
To view, visit https://gerrit.osmocom.org/11827
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: Iee95aa4e5c056645b6cb5667e4a067097d52dfbf
Gerrit-Change-Number: 11827
Gerrit-PatchSet: 10
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 


Change in libosmocore[master]: LCLS, TS 29.205: add GCR routines

2018-11-30 Thread Pau Espin Pedrol
Pau Espin Pedrol has posted comments on this change. ( 
https://gerrit.osmocom.org/11827 )

Change subject: LCLS, TS 29.205: add GCR routines
..


Patch Set 9: Code-Review-1

(5 comments)

https://gerrit.osmocom.org/#/c/11827/9/src/gsm/gsm29_205.c
File src/gsm/gsm29_205.c:

https://gerrit.osmocom.org/#/c/11827/9/src/gsm/gsm29_205.c@76
PS9, Line 76:   return -E2BIG;
probably another error would be better here. returning "too big" when size is 
too small is really confusing.


https://gerrit.osmocom.org/#/c/11827/9/src/gsm/gsm29_205.c@82
PS9, Line 82:   parsed += (2 + 1);
parenthesis can be dropped here.


https://gerrit.osmocom.org/#/c/11827/9/src/gsm/gsm29_205.c@85
PS9, Line 85:   return -EBADF;
Doesn't look like EBADF is a good error to return here. -EINVAL maybe?


https://gerrit.osmocom.org/#/c/11827/9/src/gsm/libosmogsm.map
File src/gsm/libosmogsm.map:

https://gerrit.osmocom.org/#/c/11827/9/src/gsm/libosmogsm.map@147
PS9, Line 147: gsm29205_enc_gcr;
I know not everything is perfectly sorted, but let's try to keep it as sorted 
as possible, so move these to line 225


https://gerrit.osmocom.org/#/c/11827/9/tests/gsm29205/gsm29205_test.c
File tests/gsm29205/gsm29205_test.c:

https://gerrit.osmocom.org/#/c/11827/9/tests/gsm29205/gsm29205_test.c@64
PS9, Line 64:   printf("decoding failed: %s [%s]\n", strerror(-rc), 
msgb_hexdump(msg));
All these should exit, or at least return.



--
To view, visit https://gerrit.osmocom.org/11827
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: Iee95aa4e5c056645b6cb5667e4a067097d52dfbf
Gerrit-Change-Number: 11827
Gerrit-PatchSet: 9
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Fri, 30 Nov 2018 11:56:52 +
Gerrit-HasComments: Yes
Gerrit-HasLabels: Yes


Change in libosmocore[master]: LCLS, TS 29.205: add GCR routines

2018-11-29 Thread Max
Max has posted comments on this change. ( https://gerrit.osmocom.org/11827 )

Change subject: LCLS, TS 29.205: add GCR routines
..


Set Ready For Review


--
To view, visit https://gerrit.osmocom.org/11827
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: Iee95aa4e5c056645b6cb5667e4a067097d52dfbf
Gerrit-Change-Number: 11827
Gerrit-PatchSet: 9
Gerrit-Owner: Max 
Gerrit-Reviewer: Harald Welte 
Gerrit-Reviewer: Jenkins Builder (102)
Gerrit-Reviewer: Max 
Gerrit-Reviewer: Neels Hofmeyr 
Gerrit-Reviewer: Pau Espin Pedrol 
Gerrit-Comment-Date: Thu, 29 Nov 2018 22:48:06 +
Gerrit-HasComments: No
Gerrit-HasLabels: No