[M] Change in osmo-mgw[master]: invent fmtp 'gsm-hr-format', for RFC5993 vs 3GPP TS 101.318

2023-11-03 Thread neels
Attention is currently required from: dexter, laforge, pespin.

neels has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-mgw/+/31214?usp=email )

Change subject: invent fmtp 'gsm-hr-format', for RFC5993 vs 3GPP TS 101.318
..


Patch Set 15: Code-Review-1

(2 comments)

Patchset:

PS15:
my conclusion is that this patch needs more work, explained below


File src/libosmo-mgcp/mgcp_network.c:

https://gerrit.osmocom.org/c/osmo-mgw/+/31214/comment/5d099e5b_773d446b
PS13, Line 692: explicitly specified the target format will be the opposite of 
the input
  :  * format.
> this makes no sense to me. […]
I took a look and this is what i find:

Before this patch, we have a VTY option that would enable the HR conversion for 
an entire trunk. This does not indicate which format should appear on which 
side, it always converts the format that arrives to the other format.
This works when one entire side of the MGW consistently uses one HR format, 
while the other side consistently uses the other format.
This does not work when any one BTS has a different format,
or when any CN call leg happens to already send the BTS format.

A good solution is the fmtp that this patch added, because with it we can 
indicate on each side of each endpoint individually which format is used. If we 
forward a HR packet, convert only when the packet has the wrong format. The 
presence of the fmtp alone is not sufficient.

Other idea, relatively simple: in the very first HR packet arriving on a conn, 
look which format is used on that side. From then on use that format to forward 
future HR to that side.



--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/31214?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: Idde8da27fd335dc03b8fbd9e0fedc1491b77e9e4
Gerrit-Change-Number: 31214
Gerrit-PatchSet: 15
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: pespin 
Gerrit-Attention: laforge 
Gerrit-Attention: pespin 
Gerrit-Attention: dexter 
Gerrit-Comment-Date: Fri, 03 Nov 2023 22:09:01 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: neels 
Gerrit-MessageType: comment


[L] Change in libosmocore[master]: tests: Test gsmtap logging if write queue fills up

2023-11-03 Thread laforge
Attention is currently required from: daniel.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/34967?usp=email )

Change subject: tests: Test gsmtap logging if write queue fills up
..


Patch Set 2: Code-Review+1

(1 comment)

Patchset:

PS2:
i guess you don't want the wqueue code logging the pointer?



--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/34967?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Id5ae0c4c3820a9ed59eaf4003d2c57b6bdfe3468
Gerrit-Change-Number: 34967
Gerrit-PatchSet: 2
Gerrit-Owner: daniel 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Attention: daniel 
Gerrit-Comment-Date: Fri, 03 Nov 2023 20:39:34 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in libosmocore[master]: logging_gsmtap: Temporarily disable logging when sending the logs

2023-11-03 Thread laforge
Attention is currently required from: daniel.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/34966?usp=email )

Change subject: logging_gsmtap: Temporarily disable logging when sending the 
logs
..


Patch Set 1: Code-Review+1

(1 comment)

File src/core/logging_gsmtap.c:

https://gerrit.osmocom.org/c/libosmocore/+/34966/comment/1076a316_b05a2ff0
PS1, Line 117: the
language: "error [singular] ... doesn't" or "errors [plural] don't"



--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/34966?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I19203cadbad6019a3834793b8ac816d903fe088e
Gerrit-Change-Number: 34966
Gerrit-PatchSet: 1
Gerrit-Owner: daniel 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Attention: daniel 
Gerrit-Comment-Date: Fri, 03 Nov 2023 20:38:06 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[M] Change in osmocom-bb[master]: mobile: rename voice.[ch] to tch.[ch]

2023-11-03 Thread fixeria
fixeria has submitted this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/34917?usp=email )

Change subject: mobile: rename voice.[ch] to tch.[ch]
..

mobile: rename voice.[ch] to tch.[ch]

Also take a chance to change the 'tch_' prefix for all functions.

Change-Id: I05e1ae777add73672db61565c77c68d8ab2b08f0
Related: OS#4396
---
M src/host/layer23/include/osmocom/bb/mobile/Makefile.am
A src/host/layer23/include/osmocom/bb/mobile/tch.h
D src/host/layer23/include/osmocom/bb/mobile/voice.h
M src/host/layer23/src/mobile/Makefile.am
M src/host/layer23/src/mobile/app_mobile.c
M src/host/layer23/src/mobile/gapk_io.c
M src/host/layer23/src/mobile/gsm44068_gcc_bcc.c
M src/host/layer23/src/mobile/gsm48_cc.c
R src/host/layer23/src/mobile/tch.c
9 files changed, 43 insertions(+), 31 deletions(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, approved




diff --git a/src/host/layer23/include/osmocom/bb/mobile/Makefile.am 
b/src/host/layer23/include/osmocom/bb/mobile/Makefile.am
index 534b865..5d2eeaf 100644
--- a/src/host/layer23/include/osmocom/bb/mobile/Makefile.am
+++ b/src/host/layer23/include/osmocom/bb/mobile/Makefile.am
@@ -1,4 +1,4 @@
 noinst_HEADERS = gsm322.h gsm480_ss.h gsm411_sms.h gsm48_cc.h gsm48_mm.h \
 gsm48_rr.h mncc.h gsm44068_gcc_bcc.h \
-transaction.h vty.h mncc_sock.h mncc_ms.h primitives.h \
-app_mobile.h voice.h gapk_io.h
+tch.h transaction.h vty.h mncc_sock.h mncc_ms.h primitives.h \
+app_mobile.h gapk_io.h
diff --git a/src/host/layer23/include/osmocom/bb/mobile/tch.h 
b/src/host/layer23/include/osmocom/bb/mobile/tch.h
new file mode 100644
index 000..0e81769
--- /dev/null
+++ b/src/host/layer23/include/osmocom/bb/mobile/tch.h
@@ -0,0 +1,9 @@
+#pragma once
+
+struct osmocom_ms;
+struct gsm_data_frame;
+struct msgb;
+
+int tch_init(struct osmocom_ms *ms);
+int tch_send_voice_msg(struct osmocom_ms *ms, struct msgb *msg);
+int tch_send_voice_frame(struct osmocom_ms *ms, const struct gsm_data_frame 
*frame);
diff --git a/src/host/layer23/include/osmocom/bb/mobile/voice.h 
b/src/host/layer23/include/osmocom/bb/mobile/voice.h
deleted file mode 100644
index 8c4c5b6..000
--- a/src/host/layer23/include/osmocom/bb/mobile/voice.h
+++ /dev/null
@@ -1,9 +0,0 @@
-#pragma once
-
-struct osmocom_ms;
-struct gsm_data_frame;
-struct msgb;
-
-int gsm_voice_init(struct osmocom_ms *ms);
-int gsm_send_voice_msg(struct osmocom_ms *ms, struct msgb *msg);
-int gsm_send_voice_frame(struct osmocom_ms *ms, const struct gsm_data_frame 
*frame);
diff --git a/src/host/layer23/src/mobile/Makefile.am 
b/src/host/layer23/src/mobile/Makefile.am
index 7b05f65..ed2146f 100644
--- a/src/host/layer23/src/mobile/Makefile.am
+++ b/src/host/layer23/src/mobile/Makefile.am
@@ -30,9 +30,9 @@
mnccms.c \
mncc_sock.c \
primitives.c \
+   tch.c \
transaction.c \
vty_interface.c \
-   voice.c \
$(NULL)

 bin_PROGRAMS = mobile
diff --git a/src/host/layer23/src/mobile/app_mobile.c 
b/src/host/layer23/src/mobile/app_mobile.c
index b08976c..cada8fc 100644
--- a/src/host/layer23/src/mobile/app_mobile.c
+++ b/src/host/layer23/src/mobile/app_mobile.c
@@ -41,7 +41,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 

@@ -256,7 +256,7 @@
gsm480_ss_init(ms);
gsm411_sms_init(ms);
gsm44068_gcc_init(ms);
-   gsm_voice_init(ms);
+   tch_init(ms);
gsm_subscr_init(ms);
gsm48_rr_init(ms);
gsm48_mm_init(ms);
diff --git a/src/host/layer23/src/mobile/gapk_io.c 
b/src/host/layer23/src/mobile/gapk_io.c
index 997ed8a..966d0f4 100644
--- a/src/host/layer23/src/mobile/gapk_io.c
+++ b/src/host/layer23/src/mobile/gapk_io.c
@@ -36,7 +36,7 @@
 #include 
 #include 

-#include 
+#include 
 #include 
 
 /* The RAW PCM format is common for both audio source and sink */
@@ -585,7 +585,7 @@
 &gapk_io->tch_ul_fb_len);

/* Push a voice frame to the lower layers */
-   gsm_send_voice_msg(ms, tch_msg);
+   tch_send_voice_msg(ms, tch_msg);

work |= 1;
}
diff --git a/src/host/layer23/src/mobile/gsm44068_gcc_bcc.c 
b/src/host/layer23/src/mobile/gsm44068_gcc_bcc.c
index 4fe0b82..65e016d 100644
--- a/src/host/layer23/src/mobile/gsm44068_gcc_bcc.c
+++ b/src/host/layer23/src/mobile/gsm44068_gcc_bcc.c
@@ -64,7 +64,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 
 #include 

diff --git a/src/host/layer23/src/mobile/gsm48_cc.c 
b/src/host/layer23/src/mobile/gsm48_cc.c
index 9691c68..4e26713 100644
--- a/src/host/layer23/src/mobile/gsm48_cc.c
+++ b/src/host/layer23/src/mobile/gsm48_cc.c
@@ -33,7 +33,7 @@
 #include 
 #include 
 #include 
-#include 
+#include 
 #include 

 static int gsm48_cc_tx_release(struct gsm_trans *trans, void *arg);
@@ -1978,7 

[S] Change in osmocom-bb[master]: mobile: cosmetic: rename gsm48_rr_tx_{voice->traffic}()

2023-11-03 Thread fixeria
fixeria has submitted this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/34916?usp=email )

 (

2 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted 
one.
 )Change subject: mobile: cosmetic: rename gsm48_rr_tx_{voice->traffic}()
..

mobile: cosmetic: rename gsm48_rr_tx_{voice->traffic}()

Not only this function can be used to transmit a voice frame,
but also a data frame during a CSD call.

Change-Id: I920300ae477e3c3d7c413cd1a35f2bc385266960
Related: OS#4396
---
M src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h
M src/host/layer23/src/mobile/gsm48_rr.c
M src/host/layer23/src/mobile/voice.c
3 files changed, 16 insertions(+), 3 deletions(-)

Approvals:
  laforge: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved
  Jenkins Builder: Verified




diff --git a/src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h 
b/src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h
index 16f7fb3..112e85a 100644
--- a/src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h
+++ b/src/host/layer23/include/osmocom/bb/mobile/gsm48_rr.h
@@ -251,7 +251,7 @@
 int gsm48_rr_start_monitor(struct osmocom_ms *ms);
 int gsm48_rr_stop_monitor(struct osmocom_ms *ms);
 int gsm48_rr_alter_delay(struct osmocom_ms *ms);
-int gsm48_rr_tx_voice(struct osmocom_ms *ms, struct msgb *msg);
+int gsm48_rr_tx_traffic(struct osmocom_ms *ms, struct msgb *msg);
 int gsm48_rr_audio_mode(struct osmocom_ms *ms, uint8_t mode);

 #endif /* _GSM48_RR_H */
diff --git a/src/host/layer23/src/mobile/gsm48_rr.c 
b/src/host/layer23/src/mobile/gsm48_rr.c
index 00e51a8..97ba173 100644
--- a/src/host/layer23/src/mobile/gsm48_rr.c
+++ b/src/host/layer23/src/mobile/gsm48_rr.c
@@ -7117,7 +7117,7 @@

 #endif

-int gsm48_rr_tx_voice(struct osmocom_ms *ms, struct msgb *msg)
+int gsm48_rr_tx_traffic(struct osmocom_ms *ms, struct msgb *msg)
 {
struct gsm48_rrlayer *rr = &ms->rrlayer;
uint8_t ch_type, ch_subch, ch_ts;
diff --git a/src/host/layer23/src/mobile/voice.c 
b/src/host/layer23/src/mobile/voice.c
index 9b3ffdc..699bd80 100644
--- a/src/host/layer23/src/mobile/voice.c
+++ b/src/host/layer23/src/mobile/voice.c
@@ -106,7 +106,7 @@
 int gsm_send_voice_msg(struct osmocom_ms *ms, struct msgb *msg)
 {
/* Forward to RR */
-   return gsm48_rr_tx_voice(ms, msg);
+   return gsm48_rr_tx_traffic(ms, msg);
 }

 /* gsm_send_voice_msg() wrapper accepting an MNCC structure */

--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/34916?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I920300ae477e3c3d7c413cd1a35f2bc385266960
Gerrit-Change-Number: 34916
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


[M] Change in osmocom-bb[master]: mobile: add params and VTY commands for data calls

2023-11-03 Thread fixeria
fixeria has submitted this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/34915?usp=email )

Change subject: mobile: add params and VTY commands for data calls
..

mobile: add params and VTY commands for data calls

Change-Id: If52fa70cb202f0736a17fe8eb63d226186637f62
Related: OS#4396
---
M src/host/layer23/include/osmocom/bb/common/settings.h
M src/host/layer23/include/osmocom/bb/mobile/vty.h
M src/host/layer23/src/common/settings.c
M src/host/layer23/src/mobile/vty_interface.c
4 files changed, 162 insertions(+), 0 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve




diff --git a/src/host/layer23/include/osmocom/bb/common/settings.h 
b/src/host/layer23/include/osmocom/bb/common/settings.h
index 458828a..3873611 100644
--- a/src/host/layer23/include/osmocom/bb/common/settings.h
+++ b/src/host/layer23/include/osmocom/bb/common/settings.h
@@ -44,6 +44,20 @@
 static inline const char *tch_voice_io_handler_name(enum tch_voice_io_handler 
val)
 { return get_value_string(tch_voice_io_handler_names, val); }

+/* TCH I/O handler for data calls */
+enum tch_data_io_handler {
+   /* No handler, drop frames */
+   TCH_DATA_IOH_NONE = 0,
+   /* UNIX socket */
+   TCH_DATA_IOH_UNIX_SOCK,
+   /* Return to sender */
+   TCH_DATA_IOH_LOOPBACK,
+};
+
+extern const struct value_string tch_data_io_handler_names[];
+static inline const char *tch_data_io_handler_name(enum tch_data_io_handler 
val)
+{ return get_value_string(tch_data_io_handler_names, val); }
+
 /* TCH I/O format for voice calls */
 enum tch_voice_io_format {
/* RFC3551 for FR/EFR, RFC5993 for HR, RFC4867 for AMR */
@@ -56,6 +70,18 @@
 static inline const char *tch_voice_io_format_name(enum tch_voice_io_format 
val)
 { return get_value_string(tch_voice_io_format_names, val); }

+/* TCH I/O format for data calls */
+enum tch_data_io_format {
+   /* Osmocom format, used by trxcon and virtphy */
+   TCH_DATA_IOF_OSMO,
+   /* Texas Instruments format, used by Calypso based phones (e.g. 
Motorola C1xx) */
+   TCH_DATA_IOF_TI,
+};
+
+extern const struct value_string tch_data_io_format_names[];
+static inline const char *tch_data_io_format_name(enum tch_data_io_format val)
+{ return get_value_string(tch_data_io_format_names, val); }
+
 struct tch_voice_settings {
enum tch_voice_io_handler io_handler;
enum tch_voice_io_format io_format;
@@ -63,6 +89,12 @@
char alsa_input_dev[128];
 };
 
+struct tch_data_settings {
+   enum tch_data_io_handler io_handler;
+   enum tch_data_io_format io_format;
+   char unix_socket_path[128];
+};
+
 struct test_sim_settings {
charimsi[OSMO_IMSI_BUF_SIZE];
uint32_ttmsi;
@@ -123,6 +155,7 @@

/* TCH settings */
struct tch_voice_settings tch_voice;
+   struct tch_data_settings tch_data;

/* IMEI */
charimei[GSM23003_IMEI_NUM_DIGITS + 1];
diff --git a/src/host/layer23/include/osmocom/bb/mobile/vty.h 
b/src/host/layer23/include/osmocom/bb/mobile/vty.h
index b681440..f03012e 100644
--- a/src/host/layer23/include/osmocom/bb/mobile/vty.h
+++ b/src/host/layer23/include/osmocom/bb/mobile/vty.h
@@ -11,6 +11,7 @@
 enum ms_vty_node {
SUPPORT_NODE = _LAST_L23VTY_NODE + 1,
TCH_VOICE_NODE,
+   TCH_DATA_NODE,
VGCS_NODE,
VBS_NODE,
 };
diff --git a/src/host/layer23/src/common/settings.c 
b/src/host/layer23/src/common/settings.c
index f251833..3fca52d 100644
--- a/src/host/layer23/src/common/settings.c
+++ b/src/host/layer23/src/common/settings.c
@@ -34,6 +34,7 @@

 static char *sap_socket_path = "/tmp/osmocom_sap";
 static char *mncc_socket_path = "/tmp/ms_mncc";
+static char *data_socket_path = "/tmp/ms_data";
 static char *alsa_dev_default = "default";

 int gsm_settings_init(struct osmocom_ms *ms)
@@ -54,6 +55,13 @@
OSMO_STRLCPY_ARRAY(set->tch_voice.alsa_output_dev, alsa_dev_default);
OSMO_STRLCPY_ARRAY(set->tch_voice.alsa_input_dev, alsa_dev_default);

+   /* TCH data: drop frames by default */
+   set->tch_data.io_handler = TCH_DATA_IOH_NONE;
+   set->tch_data.io_format = TCH_DATA_IOF_OSMO;
+   snprintf(set->tch_data.unix_socket_path,
+sizeof(set->tch_data.unix_socket_path) - 1,
+"%s_%s", data_socket_path, ms->name);
+
/* Built-in MNCC handler */
set->mncc_handler = MNCC_HANDLER_INTERNAL;

@@ -236,12 +244,24 @@
{ 0, NULL }
 };

+const struct value_string tch_data_io_handler_names[] = {
+   { TCH_DATA_IOH_NONE,"none" },
+   { TCH_DATA_IOH_UNIX_SOCK,   "unix-sock" },
+   { TCH_DATA_IOH_LOOPBACK,"loopback" },
+   { 0, NULL }
+};
+
 const struct value_string tch_voice_io_format_names[] = {
{ TCH_VOICE_IOF_RTP,"rtp" }

[S] Change in osmocom-bb[master]: mobile: gsm_settings_init(): set TCH frame format explicitly

2023-11-03 Thread fixeria
fixeria has submitted this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/34914?usp=email )

Change subject: mobile: gsm_settings_init(): set TCH frame format explicitly
..

mobile: gsm_settings_init(): set TCH frame format explicitly

Change-Id: I4660b07977b6701ad5dc4bf25f12cba374101f8b
Related: OS#4396
---
M src/host/layer23/src/common/settings.c
1 file changed, 11 insertions(+), 0 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve




diff --git a/src/host/layer23/src/common/settings.c 
b/src/host/layer23/src/common/settings.c
index 8768349..f251833 100644
--- a/src/host/layer23/src/common/settings.c
+++ b/src/host/layer23/src/common/settings.c
@@ -50,6 +50,7 @@

/* TCH voice: drop frames by default */
set->tch_voice.io_handler = TCH_VOICE_IOH_NONE;
+   set->tch_voice.io_format = TCH_VOICE_IOF_RTP;
OSMO_STRLCPY_ARRAY(set->tch_voice.alsa_output_dev, alsa_dev_default);
OSMO_STRLCPY_ARRAY(set->tch_voice.alsa_input_dev, alsa_dev_default);


--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/34914?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I4660b07977b6701ad5dc4bf25f12cba374101f8b
Gerrit-Change-Number: 34914
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


[L] Change in osmocom-bb[master]: mobile: add support for Circuit Switched Data calls

2023-11-03 Thread fixeria
fixeria has submitted this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/34762?usp=email )

Change subject: mobile: add support for Circuit Switched Data calls
..

mobile: add support for Circuit Switched Data calls

This patch implements the signalling part for mobile originating
and mobile terminating CSD calls.  The user plane interface is
to be implemented in follow-up patches.

Change-Id: I1995fa0a7a68d9b980852b664d472d4633777ac6
Related: OS#4396
---
M src/host/layer23/include/osmocom/bb/common/settings.h
M src/host/layer23/include/osmocom/bb/common/support.h
M src/host/layer23/include/osmocom/bb/mobile/mncc_ms.h
M src/host/layer23/src/common/settings.c
M src/host/layer23/src/common/support.c
M src/host/layer23/src/mobile/gsm48_rr.c
M src/host/layer23/src/mobile/mnccms.c
M src/host/layer23/src/mobile/vty_interface.c
8 files changed, 530 insertions(+), 14 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve




diff --git a/src/host/layer23/include/osmocom/bb/common/settings.h 
b/src/host/layer23/include/osmocom/bb/common/settings.h
index 3b9473f..468e8cd 100644
--- a/src/host/layer23/include/osmocom/bb/common/settings.h
+++ b/src/host/layer23/include/osmocom/bb/common/settings.h
@@ -1,6 +1,8 @@
 #ifndef _settings_h
 #define _settings_h

+#include 
+
 #include 
 #include 
 #include 
@@ -82,6 +84,35 @@
} locigprs;
 };

+enum data_call_type {
+   DATA_CALL_TYPE_ISDN,
+   DATA_CALL_TYPE_ANALOG,
+};
+
+enum data_call_rate {
+   DATA_CALL_RATE_V110_300,
+   DATA_CALL_RATE_V110_1200,
+   DATA_CALL_RATE_V110_2400,
+   DATA_CALL_RATE_V110_4800,
+   DATA_CALL_RATE_V110_9600,
+   DATA_CALL_RATE_V110_14400,
+};
+
+/* Connection Element (transparency) */
+enum data_call_ce {
+   DATA_CALL_CE_TRANSP,
+   DATA_CALL_CE_TRANSP_PREF,
+   DATA_CALL_CE_NON_TRANSP,
+   DATA_CALL_CE_NON_TRANSP_PREF,
+};
+
+/* Data (CSD) call parameters */
+struct data_call_params {
+   enum data_call_type type;
+   enum data_call_rate rate;
+   enum data_call_ce   ce;
+};
+
 struct gsm_settings {
charlayer2_socket_path[128];
charsap_socket_path[128];
@@ -161,6 +192,14 @@
uint8_t ch_cap; /* channel capability */
int8_t  min_rxlev_dbm; /* min dBm to access */

+   /* CSD modes */
+   boolcsd_tch_f144;
+   boolcsd_tch_f96;
+   boolcsd_tch_f48;
+   boolcsd_tch_h48;
+   boolcsd_tch_f24;
+   boolcsd_tch_h24;
+
/* support for ASCI */
boolvgcs; /* support of VGCS */
boolvbs; /* support of VBS */
@@ -192,6 +231,11 @@
/* ASCI settings */
booluplink_release_local;
boolasci_allow_any;
+
+   /* call parameters */
+   struct {
+   struct data_call_params data;
+   } call_params;
 };

 struct gsm_settings_abbrev {
diff --git a/src/host/layer23/include/osmocom/bb/common/support.h 
b/src/host/layer23/include/osmocom/bb/common/support.h
index 2fae57e..b0c71f5 100644
--- a/src/host/layer23/include/osmocom/bb/common/support.h
+++ b/src/host/layer23/include/osmocom/bb/common/support.h
@@ -91,6 +91,14 @@
uint8_t half_v1;
uint8_t half_v3;

+   /* CSD modes */
+   uint8_t csd_tch_f144;
+   uint8_t csd_tch_f96;
+   uint8_t csd_tch_f48;
+   uint8_t csd_tch_h48;
+   uint8_t csd_tch_f24;
+   uint8_t csd_tch_h24;
+
/* EDGE / UMTS / CDMA */
uint8_t edge_ms_sup;
uint8_t edge_psk_sup;
diff --git a/src/host/layer23/include/osmocom/bb/mobile/mncc_ms.h 
b/src/host/layer23/include/osmocom/bb/mobile/mncc_ms.h
index 4006688..05c539b 100644
--- a/src/host/layer23/include/osmocom/bb/mobile/mncc_ms.h
+++ b/src/host/layer23/include/osmocom/bb/mobile/mncc_ms.h
@@ -7,12 +7,20 @@

 struct osmocom_ms;

+enum gsm_call_type {
+   GSM_CALL_T_UNKNOWN = 0,
+   GSM_CALL_T_VOICE,
+   GSM_CALL_T_DATA, /* UDI or 3.1 kHz audio */
+   GSM_CALL_T_DATA_FAX,
+};
+
 struct gsm_call {
struct llist_head   entry;

struct osmocom_ms   *ms;

uint32_tcallref;
+   enum gsm_call_type  type;

boolinit; /* call initiated, no response yet */
boolhold; /* call on hold */
@@ -24,7 +32,8 @@
chardtmf[32]; /* dtmf sequence */
 };

-int mncc_call(struct osmocom_ms *ms, const char *number);
+int mncc_call(struct osmocom_ms *ms, const char *number,
+ enum gsm_call_type call_type);
 int mncc_hangup(struct osmocom_ms *ms);
 int mncc_answer(struct

[M] Change in osmocom-bb[master]: mobile: clarify TCH I/O {handler,format} naming

2023-11-03 Thread fixeria
fixeria has submitted this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/34912?usp=email )

Change subject: mobile: clarify TCH I/O {handler,format} naming
..

mobile: clarify TCH I/O {handler,format} naming

Before we add handling of TCH I/O for data calls, let's rename the
existing voice related symbols and struct fields to have 'voice'
in their names.

Change-Id: If6c799d11e225ad00ca5da5ae63dca20568a0ce0
Related: OS#4396
---
M src/host/layer23/include/osmocom/bb/common/settings.h
M src/host/layer23/src/common/settings.c
M src/host/layer23/src/mobile/gapk_io.c
M src/host/layer23/src/mobile/gsm48_rr.c
M src/host/layer23/src/mobile/voice.c
M src/host/layer23/src/mobile/vty_interface.c
6 files changed, 92 insertions(+), 78 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve




diff --git a/src/host/layer23/include/osmocom/bb/common/settings.h 
b/src/host/layer23/include/osmocom/bb/common/settings.h
index 468e8cd..458828a 100644
--- a/src/host/layer23/include/osmocom/bb/common/settings.h
+++ b/src/host/layer23/include/osmocom/bb/common/settings.h
@@ -26,39 +26,39 @@
MNCC_HANDLER_DUMMY,
 };

-/* TCH frame I/O handler */
-enum audio_io_handler {
+/* TCH I/O handler for voice calls */
+enum tch_voice_io_handler {
/* No handler, drop frames */
-   AUDIO_IOH_NONE = 0,
+   TCH_VOICE_IOH_NONE = 0,
/* libosmo-gapk based handler */
-   AUDIO_IOH_GAPK,
+   TCH_VOICE_IOH_GAPK,
/* L1 PHY (e.g. Calypso DSP) */
-   AUDIO_IOH_L1PHY,
+   TCH_VOICE_IOH_L1PHY,
/* External MNCC app (via MNCC socket) */
-   AUDIO_IOH_MNCC_SOCK,
+   TCH_VOICE_IOH_MNCC_SOCK,
/* Return to sender */
-   AUDIO_IOH_LOOPBACK,
+   TCH_VOICE_IOH_LOOPBACK,
 };

-extern const struct value_string audio_io_handler_names[];
-static inline const char *audio_io_handler_name(enum audio_io_handler val)
-{ return get_value_string(audio_io_handler_names, val); }
+extern const struct value_string tch_voice_io_handler_names[];
+static inline const char *tch_voice_io_handler_name(enum tch_voice_io_handler 
val)
+{ return get_value_string(tch_voice_io_handler_names, val); }

-/* TCH frame I/O format */
-enum audio_io_format {
-   /* RTP format (RFC3551 for FR/EFR, RFC5993 for HR, RFC4867 for AMR) */
-   AUDIO_IOF_RTP,
+/* TCH I/O format for voice calls */
+enum tch_voice_io_format {
+   /* RFC3551 for FR/EFR, RFC5993 for HR, RFC4867 for AMR */
+   TCH_VOICE_IOF_RTP,
/* Texas Instruments format, used by Calypso based phones (e.g. 
Motorola C1xx) */
-   AUDIO_IOF_TI,
+   TCH_VOICE_IOF_TI,
 };

-extern const struct value_string audio_io_format_names[];
-static inline const char *audio_io_format_name(enum audio_io_format val)
-{ return get_value_string(audio_io_format_names, val); }
+extern const struct value_string tch_voice_io_format_names[];
+static inline const char *tch_voice_io_format_name(enum tch_voice_io_format 
val)
+{ return get_value_string(tch_voice_io_format_names, val); }

-struct audio_settings {
-   enum audio_io_handler   io_handler;
-   enum audio_io_formatio_format;
+struct tch_voice_settings {
+   enum tch_voice_io_handler io_handler;
+   enum tch_voice_io_format io_format;
char alsa_output_dev[128];
char alsa_input_dev[128];
 };
@@ -121,8 +121,8 @@
/* MNCC handler */
enum mncc_handler_t mncc_handler;

-   /* Audio settings */
-   struct audio_settings   audio;
+   /* TCH settings */
+   struct tch_voice_settings tch_voice;

/* IMEI */
charimei[GSM23003_IMEI_NUM_DIGITS + 1];
diff --git a/src/host/layer23/src/common/settings.c 
b/src/host/layer23/src/common/settings.c
index 5bae325..8768349 100644
--- a/src/host/layer23/src/common/settings.c
+++ b/src/host/layer23/src/common/settings.c
@@ -48,10 +48,10 @@
snprintf(set->mncc_socket_path, sizeof(set->mncc_socket_path) - 1,
 "%s_%s", mncc_socket_path, ms->name);

-   /* Audio settings: drop TCH frames by default */
-   set->audio.io_handler = AUDIO_IOH_NONE;
-   OSMO_STRLCPY_ARRAY(set->audio.alsa_output_dev, alsa_dev_default);
-   OSMO_STRLCPY_ARRAY(set->audio.alsa_input_dev, alsa_dev_default);
+   /* TCH voice: drop frames by default */
+   set->tch_voice.io_handler = TCH_VOICE_IOH_NONE;
+   OSMO_STRLCPY_ARRAY(set->tch_voice.alsa_output_dev, alsa_dev_default);
+   OSMO_STRLCPY_ARRAY(set->tch_voice.alsa_input_dev, alsa_dev_default);

/* Built-in MNCC handler */
set->mncc_handler = MNCC_HANDLER_INTERNAL;
@@ -226,18 +226,18 @@
return 0;
 }

-const struct value_string audio_io_handler_names[] = {
-   { AUDIO_IOH_NONE,   "none" },
-   { AUDIO_IOH_GAPK,   "gapk" },
-   { AUDIO_IOH_L1PHY,  "l1phy" },
-   { AUDIO

[M] Change in osmocom-bb[master]: mobile: rename 'audio' node to 'tch-voice' node

2023-11-03 Thread fixeria
fixeria has submitted this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/34911?usp=email )

Change subject: mobile: rename 'audio' node to 'tch-voice' node
..

mobile: rename 'audio' node to 'tch-voice' node

Change-Id: I2cab597c5de92ecb343cad748035ca5f8365
Related: OS#4396
---
M src/host/layer23/include/osmocom/bb/mobile/vty.h
M src/host/layer23/src/mobile/vty_interface.c
2 files changed, 37 insertions(+), 20 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  pespin: Looks good to me, but someone else must approve
  Jenkins Builder: Verified




diff --git a/src/host/layer23/include/osmocom/bb/mobile/vty.h 
b/src/host/layer23/include/osmocom/bb/mobile/vty.h
index 511348b..b681440 100644
--- a/src/host/layer23/include/osmocom/bb/mobile/vty.h
+++ b/src/host/layer23/include/osmocom/bb/mobile/vty.h
@@ -10,7 +10,7 @@

 enum ms_vty_node {
SUPPORT_NODE = _LAST_L23VTY_NODE + 1,
-   AUDIO_NODE,
+   TCH_VOICE_NODE,
VGCS_NODE,
VBS_NODE,
 };
diff --git a/src/host/layer23/src/mobile/vty_interface.c 
b/src/host/layer23/src/mobile/vty_interface.c
index e79a5a1..a91ab77 100644
--- a/src/host/layer23/src/mobile/vty_interface.c
+++ b/src/host/layer23/src/mobile/vty_interface.c
@@ -49,9 +49,9 @@
1
 };

-struct cmd_node audio_node = {
-   AUDIO_NODE,
-   "%s(audio)# ",
+struct cmd_node tch_voice_node = {
+   TCH_VOICE_NODE,
+   "%s(tch-voice)# ",
1
 };

@@ -1475,7 +1475,7 @@
vty_out(vty, " %sasci-allow-any%s",
(set->asci_allow_any) ? "" : "no ", VTY_NEWLINE);

-   vty_out(vty, " audio%s", VTY_NEWLINE);
+   vty_out(vty, " tch-voice%s", VTY_NEWLINE);
vty_out(vty, "  io-handler %s%s",
audio_io_handler_name(set->audio.io_handler), VTY_NEWLINE);
if (set->audio.io_handler == AUDIO_IOH_GAPK) {
@@ -2477,14 +2477,20 @@
 SUP_EN_DI(vgcs, "vgcs", "Voice Group Call Service (VGCS)", 0);
 SUP_EN_DI(vbs, "vbs", "Voice Broadcast Service (VBS)", 0);

-/* per audio config */
-DEFUN(cfg_ms_audio, cfg_ms_audio_cmd, "audio",
-   "Configure audio settings")
+/* TCH config */
+DEFUN(cfg_ms_tch_voice,
+  cfg_ms_tch_voice_cmd,
+  "tch-voice", "Configure TCH (Traffic CHannel) params for voice calls\n")
 {
-   vty->node = AUDIO_NODE;
+   vty->node = TCH_VOICE_NODE;
return CMD_SUCCESS;
 }

+ALIAS_DEPRECATED(cfg_ms_tch_voice, /* alias to 'tch-voice' */
+cfg_ms_audio_cmd,
+"audio", "(deprecated alias for 'tch-voice')\n");
+
+
 static int set_audio_io_handler(struct vty *vty, enum audio_io_handler val)
 {
struct osmocom_ms *ms = (struct osmocom_ms *) vty->index;
@@ -2501,7 +2507,7 @@
return CMD_SUCCESS;
 }

-DEFUN(cfg_ms_audio_io_handler, cfg_ms_audio_io_handler_cmd,
+DEFUN(cfg_ms_tch_voice_io_handler, cfg_ms_tch_voice_io_handler_cmd,
"io-handler (none|gapk|l1phy|mncc-sock|loopback)",
"Set TCH frame I/O handler\n"
"No handler, drop TCH frames (default)\n"
@@ -2531,13 +2537,13 @@
return set_audio_io_handler(vty, val);
 }

-DEFUN(cfg_ms_audio_no_io_handler, cfg_ms_audio_no_io_handler_cmd,
+DEFUN(cfg_ms_tch_voice_no_io_handler, cfg_ms_tch_voice_no_io_handler_cmd,
"no io-handler", NO_STR "Disable TCH frame processing")
 {
return set_audio_io_handler(vty, AUDIO_IOH_NONE);
 }

-DEFUN(cfg_ms_audio_io_tch_format, cfg_ms_audio_io_tch_format_cmd,
+DEFUN(cfg_ms_tch_voice_io_tch_format, cfg_ms_tch_voice_io_tch_format_cmd,
"io-tch-format (rtp|ti)",
"Set TCH I/O frame format used by the L1 PHY (for GAPK only)\n"
"RTP format (RFC3551 for FR/EFR, RFC5993 for HR, RFC4867 for AMR)\n"
@@ -2558,7 +2564,7 @@
return CMD_SUCCESS;
 }

-DEFUN(cfg_ms_audio_alsa_out_dev, cfg_ms_audio_alsa_out_dev_cmd,
+DEFUN(cfg_ms_tch_voice_alsa_out_dev, cfg_ms_tch_voice_alsa_out_dev_cmd,
"alsa-output-dev (default|NAME)",
"Set ALSA output (playback) device name (for GAPK only)\n"
"Default system playback device (default)\n"
@@ -2572,7 +2578,7 @@
return CMD_SUCCESS;
 }

-DEFUN(cfg_ms_audio_alsa_in_dev, cfg_ms_audio_alsa_in_dev_cmd,
+DEFUN(cfg_ms_tch_voice_alsa_in_dev, cfg_ms_tch_voice_alsa_in_dev_cmd,
"alsa-input-dev (default|NAME)",
"Set ALSA input (capture) device name (for GAPK only)\n"
"Default system recording device (default)\n"
@@ -2757,6 +2763,7 @@
install_element(MS_NODE, &cfg_ms_no_codec_half_cmd);
install_element(MS_NODE, &cfg_ms_abbrev_cmd);
install_element(MS_NODE, &cfg_ms_no_abbrev_cmd);
+   install_element(MS_NODE, &cfg_ms_tch_voice_cmd);
install_element(MS_NODE, &cfg_ms_audio_cmd);
install_element(MS_NODE, &cfg_ms_neighbour_cmd);
install_element(MS_NODE, &cfg_ms_no_neighbour_cmd);
@@ -2842,12 +2849,12 @@
install_element(MS_NODE, &cfg_ms_script_load_run_cmd);
install_element(MS

[M] Change in libosmocore[master]: gsmtap_util: Use Osmo IO instead of Osmo write queues

2023-11-03 Thread daniel
Attention is currently required from: arehbein, laforge, pespin.

daniel has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/34743?usp=email )

Change subject: gsmtap_util: Use Osmo IO instead of Osmo write queues
..


Patch Set 8:

(1 comment)

File src/core/gsmtap_util.c:

https://gerrit.osmocom.org/c/libosmocore/+/34743/comment/b190b3cc_c6fef766
PS5, Line 478:  osmo_iofd_setup(gti, gti->sink_fd, "gsmtap_inst.out", 
OSMO_IO_FD_MODE_READ_WRITE, &gsmtap_sink_ops, NULL);
> This would have also happened if the old code used write_queues, maybe that's 
> the reason they didn't […]
Test to reproduce your issue (even with the old wqueue code) and proposed fix 
here:

https://gerrit.osmocom.org/c/libosmocore/+/34967
https://gerrit.osmocom.org/c/libosmocore/+/34966



--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/34743?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Iadbbef74e3add7001d84dd6b68f51eac293e44d0
Gerrit-Change-Number: 34743
Gerrit-PatchSet: 8
Gerrit-Owner: arehbein 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: arehbein 
Gerrit-Attention: laforge 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Fri, 03 Nov 2023 20:27:17 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: arehbein 
Comment-In-Reply-To: laforge 
Comment-In-Reply-To: pespin 
Comment-In-Reply-To: daniel 
Gerrit-MessageType: comment


[L] Change in libosmocore[master]: tests: Test gsmtap logging if write queue fills up

2023-11-03 Thread daniel
Attention is currently required from: daniel.

Hello Jenkins Builder,

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

https://gerrit.osmocom.org/c/libosmocore/+/34967?usp=email

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

The following approvals got outdated and were removed:
Verified-1 by Jenkins Builder


Change subject: tests: Test gsmtap logging if write queue fills up
..

tests: Test gsmtap logging if write queue fills up

Change-Id: Id5ae0c4c3820a9ed59eaf4003d2c57b6bdfe3468
---
M tests/Makefile.am
A tests/logging/logging_test_gsmtap.c
A tests/logging/logging_test_gsmtap.err
M tests/testsuite.at
4 files changed, 417 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/67/34967/2
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/34967?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Id5ae0c4c3820a9ed59eaf4003d2c57b6bdfe3468
Gerrit-Change-Number: 34967
Gerrit-PatchSet: 2
Gerrit-Owner: daniel 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Attention: daniel 
Gerrit-MessageType: newpatchset


[L] Change in libosmocore[master]: tests: Test gsmtap logging if write queue fills up

2023-11-03 Thread Jenkins Builder
Jenkins Builder has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/34967?usp=email )

Change subject: tests: Test gsmtap logging if write queue fills up
..


Patch Set 1:

(3 comments)

File tests/logging/logging_test_gsmtap.c:

Robot Comment from checkpatch (run ID jenkins-gerrit-lint-12292):
https://gerrit.osmocom.org/c/libosmocore/+/34967/comment/e654eaaf_92b1cc35
PS1, Line 57:   for (int i = 0; i < 200; i++) {
braces {} are not necessary for single statement blocks


Robot Comment from checkpatch (run ID jenkins-gerrit-lint-12292):
https://gerrit.osmocom.org/c/libosmocore/+/34967/comment/7f9350c7_afc521ec
PS1, Line 58:   DEBUGP(DLGLOBAL, "Repeating message (i = %i)\n", i);
Use %d instead of %i


Robot Comment from checkpatch (run ID jenkins-gerrit-lint-12292):
https://gerrit.osmocom.org/c/libosmocore/+/34967/comment/f3c2cda0_9a241246
PS1, Line 61:   for (int i = 0; i < 200; i++) {
braces {} are not necessary for single statement blocks



--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/34967?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Id5ae0c4c3820a9ed59eaf4003d2c57b6bdfe3468
Gerrit-Change-Number: 34967
Gerrit-PatchSet: 1
Gerrit-Owner: daniel 
Gerrit-CC: Jenkins Builder
Gerrit-Comment-Date: Fri, 03 Nov 2023 20:23:34 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


[L] Change in libosmocore[master]: tests: Test gsmtap logging if write queue fills up

2023-11-03 Thread daniel
daniel has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmocore/+/34967?usp=email )


Change subject: tests: Test gsmtap logging if write queue fills up
..

tests: Test gsmtap logging if write queue fills up

Change-Id: Id5ae0c4c3820a9ed59eaf4003d2c57b6bdfe3468
---
M tests/Makefile.am
A tests/logging/logging_test_gsmtap.c
A tests/logging/logging_test_gsmtap.err
M tests/testsuite.at
4 files changed, 419 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/67/34967/1

diff --git a/tests/Makefile.am b/tests/Makefile.am
index 5f4914e..8c8e370 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -15,6 +15,7 @@
  gsm0808/gsm0808_test gsm0408/gsm0408_test \
 gprs/gprs_test kasumi/kasumi_test gea/gea_test \
 logging/logging_test codec/codec_test  \
+logging/logging_test_gsmtap\
 loggingrb/loggingrb_test strrb/strrb_test  \
 comp128/comp128_test   \
 bitvec/bitvec_test msgb/msgb_test bits/bitcomp_test\
diff --git a/tests/logging/logging_test_gsmtap.c 
b/tests/logging/logging_test_gsmtap.c
new file mode 100644
index 000..f84cdce
--- /dev/null
+++ b/tests/logging/logging_test_gsmtap.c
@@ -0,0 +1,66 @@
+/* simple test for the debug interface */
+/*
+ * (C) 2008, 2009 by Holger Hans Peter Freyther 
+ * 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.
+ *
+ */
+
+#include 
+#include 
+#include 
+
+#include 
+
+static const struct log_info_cat default_categories[] = {};
+
+const struct log_info log_info = {
+   .cat = default_categories,
+   .num_cat = ARRAY_SIZE(default_categories),
+};
+
+extern struct log_info *osmo_log_info;
+
+int main(int argc, char **argv)
+{
+   struct log_target *stderr_target;
+   struct log_target *gsmtap_target;
+
+   log_init(&log_info, NULL);
+   stderr_target = log_target_create_stderr();
+   log_add_target(stderr_target);
+   log_set_all_filter(stderr_target, 1);
+   log_set_print_filename2(stderr_target, LOG_FILENAME_NONE);
+   log_set_print_category_hex(stderr_target, 0);
+   log_set_print_category(stderr_target, 1);
+   log_set_use_color(stderr_target, 0);
+   log_parse_category_mask(stderr_target, "DLGLOBAL,1");
+
+   gsmtap_target = log_target_create_gsmtap("127.0.0.2", 4729, "gsmtap", 
1, 1);
+   log_add_target(gsmtap_target);
+   log_set_all_filter(gsmtap_target, 1);
+   log_parse_category_mask(gsmtap_target, "DLGLOBAL,1");
+
+   log_target_file_switch_to_stream(stderr_target);
+
+   log_set_category_filter(stderr_target, DLGLOBAL, 1, LOGL_DEBUG);
+
+   for (int i = 0; i < 200; i++) {
+   DEBUGP(DLGLOBAL, "Repeating message (i = %i)\n", i);
+   }
+
+   for (int i = 0; i < 200; i++) {
+   osmo_select_main(1);
+   }
+
+   return 0;
+}
diff --git a/tests/logging/logging_test_gsmtap.err 
b/tests/logging/logging_test_gsmtap.err
new file mode 100644
index 000..dcba5cf
--- /dev/null
+++ b/tests/logging/logging_test_gsmtap.err
@@ -0,0 +1,336 @@
+DLGLOBAL Repeating message (i = 0)
+DLGLOBAL Repeating message (i = 1)
+DLGLOBAL Repeating message (i = 2)
+DLGLOBAL Repeating message (i = 3)
+DLGLOBAL Repeating message (i = 4)
+DLGLOBAL Repeating message (i = 5)
+DLGLOBAL Repeating message (i = 6)
+DLGLOBAL Repeating message (i = 7)
+DLGLOBAL Repeating message (i = 8)
+DLGLOBAL Repeating message (i = 9)
+DLGLOBAL Repeating message (i = 10)
+DLGLOBAL Repeating message (i = 11)
+DLGLOBAL Repeating message (i = 12)
+DLGLOBAL Repeating message (i = 13)
+DLGLOBAL Repeating message (i = 14)
+DLGLOBAL Repeating message (i = 15)
+DLGLOBAL Repeating message (i = 16)
+DLGLOBAL Repeating message (i = 17)
+DLGLOBAL Repeating message (i = 18)
+DLGLOBAL Repeating message (i = 19)
+DLGLOBAL Repeating message (i = 20)
+DLGLOBAL Repeating message (i = 21)
+DLGLOBAL Repeating message (i = 22)
+DLGLOBAL Repeating message (i = 23)
+DLGLOBAL Repeating message (i = 24)
+DLGLOBAL Repeating message (i = 25)
+DLGLOBAL Repeating message (i = 26)
+DLGLOBAL Repeating message (i = 27)
+DLGLOBAL Repeating message (i = 28)
+DLGLOBAL Repeating message (i = 29)
+DLGLOBAL Repeating message (i = 30)
+DLGLOBAL Repeating message (i = 31)
+DLGLOBAL Repeating message (i =

[S] Change in libosmocore[master]: logging_gsmtap: Temporarily disable logging when sending the logs

2023-11-03 Thread daniel
daniel has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmocore/+/34966?usp=email )


Change subject: logging_gsmtap: Temporarily disable logging when sending the 
logs
..

logging_gsmtap: Temporarily disable logging when sending the logs

This avoids an infinite recursion when sending a gsmtap log message
causes a log message.
Temporarily set target->loglevel higher than LOGL_FATAL, which
effectively disables logging for that target. Other targets like stderr
will still log this message so there is still an indication that
something went wrong.

Change-Id: I19203cadbad6019a3834793b8ac816d903fe088e
Related: OS#6213
---
M src/core/logging_gsmtap.c
1 file changed, 21 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/66/34966/1

diff --git a/src/core/logging_gsmtap.c b/src/core/logging_gsmtap.c
index dfd059b..1b979ec 100644
--- a/src/core/logging_gsmtap.c
+++ b/src/core/logging_gsmtap.c
@@ -114,7 +114,11 @@
}
msgb_put(msg, rc);

+   /* Ensure that any error when sending the log message don't cause 
infinite recursion */
+   level = target->loglevel;
+   target->loglevel = LOGL_FATAL + 1;
rc = gsmtap_sendmsg(target->tgt_gsmtap.gsmtap_inst, msg);
+   target->loglevel = level;
if (rc)
msgb_free(msg);
 }

--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/34966?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I19203cadbad6019a3834793b8ac816d903fe088e
Gerrit-Change-Number: 34966
Gerrit-PatchSet: 1
Gerrit-Owner: daniel 
Gerrit-MessageType: newchange


[S] Change in osmo-trx[master]: ms: init blade with fpga control

2023-11-03 Thread Hoernchen
Hoernchen has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-trx/+/34965?usp=email )


Change subject: ms: init blade with fpga control
..

ms: init blade with fpga control

Blade 1 defaults to fpga tuning, but the blade 2 code defaults to host,
which does 8000 register reads and writes. The only way to speed this up
is to set the env var, which reduces opening the blade device from 10 to
1 seconds.

Change-Id: I32fe31f1e11f4ceb3c864ec8739d177e780d0a7e
---
M Transceiver52M/ms/bladerf_specific.h
1 file changed, 16 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-trx refs/changes/65/34965/1

diff --git a/Transceiver52M/ms/bladerf_specific.h 
b/Transceiver52M/ms/bladerf_specific.h
index e32d77c..e9245d4 100644
--- a/Transceiver52M/ms/bladerf_specific.h
+++ b/Transceiver52M/ms/bladerf_specific.h
@@ -254,6 +254,8 @@

bladerf_log_set_verbosity(BLADERF_LOG_LEVEL_DEBUG);
bladerf_set_usb_reset_on_open(true);
+
+   setenv("BLADERF_DEFAULT_TUNING_MODE","fpga",1); // ensure blade 
2 does not spend 10 seconds initializing host control
blade_check(bladerf_open, &dev, "");
if (!dev) {
std::cerr << "open failed, device missing?" << 
std::endl;

--
To view, visit https://gerrit.osmocom.org/c/osmo-trx/+/34965?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-trx
Gerrit-Branch: master
Gerrit-Change-Id: I32fe31f1e11f4ceb3c864ec8739d177e780d0a7e
Gerrit-Change-Number: 34965
Gerrit-PatchSet: 1
Gerrit-Owner: Hoernchen 
Gerrit-MessageType: newchange


[S] Change in osmo-ttcn3-hacks[master]: PCUIF: upgrade to PCUIF v12

2023-11-03 Thread laforge
Attention is currently required from: dexter.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34934?usp=email )

Change subject: PCUIF: upgrade to PCUIF v12
..


Patch Set 4:

(1 comment)

Patchset:

PS4:
how will we still tst the older version for running the ttcn3 test suite 
against osmo-pcu latest?



--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34934?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Ib1516e66c70f021adee49f41bd707803fc06f9cf
Gerrit-Change-Number: 34934
Gerrit-PatchSet: 4
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-CC: laforge 
Gerrit-Attention: dexter 
Gerrit-Comment-Date: Fri, 03 Nov 2023 19:44:33 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


[S] Change in osmo-ttcn3-hacks[master]: hnbgw: Introduce mp_hnbgw_timer_x31

2023-11-03 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34951?usp=email )

Change subject: hnbgw: Introduce mp_hnbgw_timer_x31
..

hnbgw: Introduce mp_hnbgw_timer_x31

The default value of the timer changed recently, and made some tests
which were using some timer hardcoded values fail.
Add this configurable option to adapt the test behavior to the
osmo-hnbgw configuration. This way we can also set it to lower values in
order to avoid waiting too much time.

Change-Id: I176ef96e193f2ca39077bcee3a2187768ddb45ce
---
M hnbgw/HNBGW_Tests.ttcn
M hnbgw/osmo-hnbgw.cfg
2 files changed, 21 insertions(+), 1 deletion(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified
  osmith: Looks good to me, but someone else must approve




diff --git a/hnbgw/HNBGW_Tests.ttcn b/hnbgw/HNBGW_Tests.ttcn
index 4afb8dd..505beab 100644
--- a/hnbgw/HNBGW_Tests.ttcn
+++ b/hnbgw/HNBGW_Tests.ttcn
@@ -194,6 +194,10 @@
charstring mp_pfcp_ip_remote := "127.0.0.2";

boolean mp_validate_talloc_asn1 := true;
+
+   /* The X31 timer configured at osmo-hnbgw (seconds). This provided an 
idea on
+* minimum time the test must wait to consider this timer triggered */
+   integer mp_hnbgw_timer_x31 := 5;
 }

 function MSC_UnitdataCallback(RANAP_PDU ranap) runs on RAN_Emulation_CT return 
template RANAP_PDU {
@@ -763,7 +767,7 @@
 template RANAP_PDU exp_rx := omit)
 runs on ConnHdlr return RANAP_PDU {
var RANAP_PDU rx
-   timer T := 10.0;
+   timer T := int2float(mp_hnbgw_timer_x31) + 1.0;

if (istemplatekind(exp_rx, "omit")) {
exp_rx := tx;
diff --git a/hnbgw/osmo-hnbgw.cfg b/hnbgw/osmo-hnbgw.cfg
index 3ccc28d..edd8c21 100644
--- a/hnbgw/osmo-hnbgw.cfg
+++ b/hnbgw/osmo-hnbgw.cfg
@@ -49,6 +49,7 @@
   local-ip 127.0.0.1
   local-port 29169
   hnbap-allow-tmsi 1
+ timer hnbgw x31 5
  # don't spam RANAP RESET messages for up to eight CN links across all tests
  timer hnbgw T4 60


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34951?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I176ef96e193f2ca39077bcee3a2187768ddb45ce
Gerrit-Change-Number: 34951
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: osmith 
Gerrit-MessageType: merged


[S] Change in osmo-ttcn3-hacks[master]: hnbgw: Introduce mp_hnbgw_timer_x31

2023-11-03 Thread laforge
Attention is currently required from: neels, pespin.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34951?usp=email )

Change subject: hnbgw: Introduce mp_hnbgw_timer_x31
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34951?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I176ef96e193f2ca39077bcee3a2187768ddb45ce
Gerrit-Change-Number: 34951
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: osmith 
Gerrit-Attention: neels 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Fri, 03 Nov 2023 19:43:07 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in osmo-hnbgw[master]: X31: fix vty doc

2023-11-03 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-hnbgw/+/34933?usp=email )

Change subject: X31: fix vty doc
..

X31: fix vty doc

The actual scope is larger than just a stale release. Every RUA and SCCP
context map FSM state that has a timeout uses X31. (Seems I intended to
add more timers but forgot to follow up when I wrote it.)

Related: SYS#6602
Change-Id: I75a25f9065bc651e7ba8feda6db03c49a3b75c5e
---
M src/osmo-hnbgw/tdefs.c
1 file changed, 15 insertions(+), 1 deletion(-)

Approvals:
  neels: Looks good to me, but someone else must approve
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  laforge: Looks good to me, approved




diff --git a/src/osmo-hnbgw/tdefs.c b/src/osmo-hnbgw/tdefs.c
index cae9405..b2ee65f 100644
--- a/src/osmo-hnbgw/tdefs.c
+++ b/src/osmo-hnbgw/tdefs.c
@@ -34,7 +34,7 @@
 struct osmo_tdef hnbgw_T_defs[] = {
{.T = 3113, .default_val = 15, .desc = "Time to keep Paging record, for 
CN pools with more than one link" },
{.T = 4, .default_val = 5, .desc = "Timeout to receive RANAP RESET 
ACKNOWLEDGE from an MSC/SGSN" },
-   {.T = -31, .default_val = 15, .desc = "Timeout for discarding a 
partially released context map (RUA <-> SCCP)" },
+   {.T = -31, .default_val = 15, .desc = "Timeout for establishing and 
releasing context maps (RUA <-> SCCP)" },
{.T = -1002, .default_val = 10, .desc = "Timeout for the HNB to respond 
to PS RAB Assignment Request" },
{ }
 };

--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/34933?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I75a25f9065bc651e7ba8feda6db03c49a3b75c5e
Gerrit-Change-Number: 34933
Gerrit-PatchSet: 3
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


[S] Change in osmo-hnbgw[master]: X31: fix vty doc

2023-11-03 Thread laforge
Attention is currently required from: neels.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-hnbgw/+/34933?usp=email )

Change subject: X31: fix vty doc
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/34933?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I75a25f9065bc651e7ba8feda6db03c49a3b75c5e
Gerrit-Change-Number: 34933
Gerrit-PatchSet: 2
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: pespin 
Gerrit-Attention: neels 
Gerrit-Comment-Date: Fri, 03 Nov 2023 19:42:37 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in osmo-bsc[master]: pcuif_proto: signal BTS model via PCUIF

2023-11-03 Thread laforge
Attention is currently required from: dexter, pespin.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/34649?usp=email )

Change subject: pcuif_proto: signal BTS model via PCUIF
..


Patch Set 6: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/34649?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I4b58912ad7be3070829614853901aa19108ba2c0
Gerrit-Change-Number: 34649
Gerrit-PatchSet: 6
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: pespin 
Gerrit-Attention: dexter 
Gerrit-Comment-Date: Fri, 03 Nov 2023 19:42:12 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in osmo-pcu[master]: pcu_l1_if: signal BTS model via PCUIF

2023-11-03 Thread laforge
Attention is currently required from: dexter, fixeria.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-pcu/+/34647?usp=email )

Change subject: pcu_l1_if: signal BTS model via PCUIF
..


Patch Set 6: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/34647?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-pcu
Gerrit-Branch: master
Gerrit-Change-Id: I48eb75f65ab54fdec41ef913e24c1f18cd4a4047
Gerrit-Change-Number: 34647
Gerrit-PatchSet: 6
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: fixeria 
Gerrit-Attention: dexter 
Gerrit-Comment-Date: Fri, 03 Nov 2023 19:41:40 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[M] Change in osmocom-bb[master]: mobile: add params and VTY commands for data calls

2023-11-03 Thread laforge
Attention is currently required from: fixeria, jolly.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/34915?usp=email )

Change subject: mobile: add params and VTY commands for data calls
..


Patch Set 3: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/34915?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: If52fa70cb202f0736a17fe8eb63d226186637f62
Gerrit-Change-Number: 34915
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: jolly 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Fri, 03 Nov 2023 19:39:51 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in osmocom-bb[master]: mobile: gsm_settings_init(): set TCH frame format explicitly

2023-11-03 Thread laforge
Attention is currently required from: fixeria, jolly.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/34914?usp=email )

Change subject: mobile: gsm_settings_init(): set TCH frame format explicitly
..


Patch Set 3: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/34914?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I4660b07977b6701ad5dc4bf25f12cba374101f8b
Gerrit-Change-Number: 34914
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: jolly 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Fri, 03 Nov 2023 19:39:31 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[M] Change in osmocom-bb[master]: mobile: clarify TCH I/O {handler,format} naming

2023-11-03 Thread laforge
Attention is currently required from: fixeria, jolly.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/34912?usp=email )

Change subject: mobile: clarify TCH I/O {handler,format} naming
..


Patch Set 3: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/34912?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: If6c799d11e225ad00ca5da5ae63dca20568a0ce0
Gerrit-Change-Number: 34912
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: jolly 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Fri, 03 Nov 2023 19:39:20 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[M] Change in osmocom-bb[master]: mobile: rename 'audio' node to 'tch-voice' node

2023-11-03 Thread laforge
Attention is currently required from: fixeria, jolly.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/34911?usp=email )

Change subject: mobile: rename 'audio' node to 'tch-voice' node
..


Patch Set 3: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/34911?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I2cab597c5de92ecb343cad748035ca5f8365
Gerrit-Change-Number: 34911
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: jolly 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Fri, 03 Nov 2023 19:38:49 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[L] Change in osmocom-bb[master]: mobile: add support for Circuit Switched Data calls

2023-11-03 Thread laforge
Attention is currently required from: fixeria, jolly.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/34762?usp=email )

Change subject: mobile: add support for Circuit Switched Data calls
..


Patch Set 7: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/34762?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I1995fa0a7a68d9b980852b664d472d4633777ac6
Gerrit-Change-Number: 34762
Gerrit-PatchSet: 7
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: jolly 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Fri, 03 Nov 2023 19:38:18 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[M] Change in osmo-ttcn3-hacks[master]: sccp: Introduce test TC_cr_timeout_cc_too_late

2023-11-03 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34923?usp=email )

Change subject: sccp: Introduce test TC_cr_timeout_cc_too_late
..

sccp: Introduce test TC_cr_timeout_cc_too_late

Related: SYS#6602
Change-Id: If4b53565f1fa19894ca24fa71e02ae7b1941411e
---
M library/SCCP_Templates.ttcn
M sccp/SCCP_Tests_RAW.ttcn
2 files changed, 106 insertions(+), 0 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  osmith: Looks good to me, but someone else must approve
  Jenkins Builder: Verified
  fixeria: Looks good to me, approved




diff --git a/library/SCCP_Templates.ttcn b/library/SCCP_Templates.ttcn
index a87ef5c..6c977ac 100644
--- a/library/SCCP_Templates.ttcn
+++ b/library/SCCP_Templates.ttcn
@@ -113,6 +113,39 @@
return ret;
 }

+template (present) PDU_SCCP tr_SCCP_CR(template (present) OCT3 source_lref := 
?,
+  template (present) SCCP_PAR_Address 
called := ?,
+  template (present) SCCP_PAR_Address 
calling := ?) := {
+   connrequest := {
+   messageType := cr,
+   sourceLocRef := source_lref,
+   protClass := c_class2,
+   pointer1 := ?,
+   pointer2 := ?,
+   calledPAddress := tr_Addr(called),
+   optionalPart := {
+   credit := omit,
+   callingPAddress := tr_Addr_opt(calling),
+   data := omit,
+   hopCounter := *,
+   importance := *
+   },
+   eop := *
+   }
+}
+
+template (value) PDU_SCCP ts_SCCP_CC(OCT3 source_lref, OCT3 dest_lref) := {
+   connconfirm := {
+   messageType := cc,
+   destLocRef := dest_lref,
+   sourceLocRef := source_lref,
+   protClass := c_class2,
+   pointer1 := 0, /* overwritten */
+   optionalPart := omit,
+   eop := { paramName:= con_SCCP_eop }
+   }
+}
+
 template (present) PDU_SCCP tr_SCCP_CC(template (present) OCT3 source_lref,
   template (present) OCT3 dest_lref) := {
connconfirm := {
@@ -135,6 +168,25 @@
}
 }

+private function tr_Addr_opt(template SCCP_PAR_Address addr := *)
+return template SCCP_param_CPartyAddressEnc_opt {
+   if (istemplatekind(addr, "omit")) {
+   return omit;
+   } else if (istemplatekind(addr, "*")) {
+   return *;
+   } else if (istemplatekind(addr, "?")) {
+   return ?;
+   } else {
+   var SCCP_param_CPartyAddressEnc enc := 
ConvertASPAddressToEncodedAddress_itu(valueof(addr));
+   var SCCP_param_CPartyAddressEnc_opt enc_opt := {
+   paramName := con_SCCP_cgPA,
+   paramLength := enc.paramLength, /* overwritten */
+   addr := enc.addr
+   };
+   return enc_opt;
+   }
+}
+
 template (value) PDU_SCCP ts_SCCP_UDT(SCCP_PAR_Address calling, 
SCCP_PAR_Address called,
  template (value) octetstring data,
  template (value) BIT4 msg_hdl := ''B) 
:= {
diff --git a/sccp/SCCP_Tests_RAW.ttcn b/sccp/SCCP_Tests_RAW.ttcn
index 1c81d98..5849dad 100644
--- a/sccp/SCCP_Tests_RAW.ttcn
+++ b/sccp/SCCP_Tests_RAW.ttcn
@@ -69,6 +69,18 @@
  "sccp-timer iar " & int2str(g_demo_sccp_timer_iar)});
 }

+function f_vty_cmd_connect_req(integer conn_id) runs on SCCP_Test_RAW_CT {
+   f_vty_transceive(SCCP_DEMO_USER_VTY, "sccp-user");
+   f_vty_transceive(SCCP_DEMO_USER_VTY, "connect-req " & int2str(conn_id));
+   f_vty_transceive(SCCP_DEMO_USER_VTY, "end");
+}
+
+function f_vty_cmd_disconnect_req(integer conn_id) runs on SCCP_Test_RAW_CT {
+   f_vty_transceive(SCCP_DEMO_USER_VTY, "sccp-user");
+   f_vty_transceive(SCCP_DEMO_USER_VTY, "disconnect-req " & 
int2str(conn_id));
+   f_vty_transceive(SCCP_DEMO_USER_VTY, "end");
+}
+
 private function f_init_raw(SCCP_Configuration cfg) runs on SCCP_Test_RAW_CT {
g_param := {
sio := {
@@ -483,6 +495,37 @@
 }


+/* Test user initiating a conn (eg RUA), which triggers SCCP CR. While waiting
+ * for CC, user decides it timed out (eg. RUA side timeout) which makes it 
move to
+ * WAIT_CONN_CONF state. In that state, wait for CC and then submit an RLSD and
+ * wait for ack. */
+testcase TC_cr_timeout_cc_too_late() runs on SCCP_Test_RAW_CT {
+   var SCCP_MTP3_TRANSFERind mtp3_rx;
+   var integer conn_id := 1234;
+   var OCT3 remote_lref;
+
+   f_init_raw(mp_sccp_cfg[0]);
+   f_sleep(1.0);
+
+   f_vty_cmd_connect_req(conn_id);
+   mtp3_rx := f_exp_s

[M] Change in osmo-ttcn3-hacks[master]: sccp: Introduce test TC_cr_timeout_cc_too_late

2023-11-03 Thread laforge
Attention is currently required from: daniel, pespin.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34923?usp=email )

Change subject: sccp: Introduce test TC_cr_timeout_cc_too_late
..


Patch Set 4: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34923?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: If4b53565f1fa19894ca24fa71e02ae7b1941411e
Gerrit-Change-Number: 34923
Gerrit-PatchSet: 4
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Attention: pespin 
Gerrit-Attention: daniel 
Gerrit-Comment-Date: Fri, 03 Nov 2023 19:37:35 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[M] Change in osmo-hnbgw[master]: tests/ranap_rab_ass: Test RAB-Ass.req with X.213 IPv4 address len=7

2023-11-03 Thread laforge
Attention is currently required from: pespin.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-hnbgw/+/34964?usp=email )

Change subject: tests/ranap_rab_ass: Test RAB-Ass.req with X.213 IPv4 address 
len=7
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/34964?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I71323018d79a4f5778dc6e49488d75ae7c2c4cdc
Gerrit-Change-Number: 34964
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Fri, 03 Nov 2023 19:37:14 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in osmo-iuh[master]: ranap_transp_layer_addr_decode2(): Fix decoding X.213 IPv4 address len=7

2023-11-03 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-iuh/+/34963?usp=email )

Change subject: ranap_transp_layer_addr_decode2(): Fix decoding X.213 IPv4 
address len=7
..

ranap_transp_layer_addr_decode2(): Fix decoding X.213 IPv4 address len=7

It was found in the field that some peers sends an X.213 IP address
consisting of 7 bytes (1byte IDP/AFI, 2byte ICP, 4 byte IPv4 address) insetad
of 20 bytes.

This is indeed possible when reading ITU Rec X.213 A.5.2.3, where it
states that Table A5 defining the 17 bytes DSP len for IANA ICP
"gives the maximum length of the DSP". So smaller values are still
possible/acceptable.

Related: SYS#6623
Change-Id: I507fb1605d976bd8573162e4fa81721245330184
---
M src/iu_helpers.c
1 file changed, 30 insertions(+), 4 deletions(-)

Approvals:
  laforge: Looks good to me, approved
  Jenkins Builder: Verified
  neels: Looks good to me, but someone else must approve




diff --git a/src/iu_helpers.c b/src/iu_helpers.c
index 718c30a..5c7ff31 100644
--- a/src/iu_helpers.c
+++ b/src/iu_helpers.c
@@ -140,14 +140,21 @@

memset(addr, 0, sizeof(*addr));

-   if (len == 20 && buf[0] == 0x35) {
-   /* For an X.213 NSAP encoded address we expect a buffer of 
exactly 20 bytes (3 bytes IDP + 17 bytes
-* DSP). we also expect AFI = 0x35, which means that two byte 
IDI and an IP address follows. (see also
-* comments in function ranap_new_transp_layer_addr below) */
+   if ((len == 7 || len == 20) && buf[0] == 0x35) {
+   /* ITU-T Rec. X.213 A.5.2.1.2.7, RFC 1888 section 6
+* For an X.213 NSAP encoded address we expect:
+* 3 bytes IDP (first byte AFI = 0x35, which means that two 
byte IDI and an IP address follows)
+* Either 4 or 17 bytes of DSP containing the IP address.
+* (see also comments in function ranap_new_transp_layer_addr 
below) */
x213_nsap = true;
icp = osmo_load16be(&buf[1]);
switch (icp) {
case 0x:
+   /* "RFC 1888 provides guidance on how to embed an IPv6 
address within the DSP of an NSAP
+* address. The IPv6  address is carried in the first 
16 octets of the DSP.
+* Octet 17 of the DSP is set to zero, but has no 
significance for IPv6." */
+   if (len != 20)
+   return -EINVAL;
addr->u.sa.sa_family = AF_INET6;
memcpy(addr->u.sin6.sin6_addr.s6_addr, buf + 3, 
sizeof(addr->u.sin6.sin6_addr.s6_addr));
break;

--
To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/34963?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: I507fb1605d976bd8573162e4fa81721245330184
Gerrit-Change-Number: 34963
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-MessageType: merged


[S] Change in osmo-iuh[master]: ranap_transp_layer_addr_decode2(): Fix decoding X.213 IPv4 address len=7

2023-11-03 Thread laforge
Attention is currently required from: neels, pespin.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-iuh/+/34963?usp=email )

Change subject: ranap_transp_layer_addr_decode2(): Fix decoding X.213 IPv4 
address len=7
..


Patch Set 3: Code-Review+2

(1 comment)

File src/iu_helpers.c:

https://gerrit.osmocom.org/c/osmo-iuh/+/34963/comment/4bbf01cf_a36b1c9b
PS3, Line 143:  if ((len == 7 || len == 20) && buf[0] == 0x35) {
> What do you think about allowing anything between 7.. […]
it gives you a feeling for how alien IP was for CCITT/ITU at the time.



--
To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/34963?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: I507fb1605d976bd8573162e4fa81721245330184
Gerrit-Change-Number: 34963
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Attention: neels 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Fri, 03 Nov 2023 19:36:52 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: neels 
Gerrit-MessageType: comment


[M] Change in pysim[master]: transport: Move printing of reader number/name to generic code

2023-11-03 Thread laforge
Attention is currently required from: laforge.

Hello Jenkins Builder,

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

https://gerrit.osmocom.org/c/pysim/+/34961?usp=email

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

The following approvals got outdated and were removed:
Verified-1 by Jenkins Builder


Change subject: transport: Move printing of reader number/name to generic code
..

transport: Move printing of reader number/name to generic code

Let's avoid copy+pasting print statements everywhere.  The instances
do already have a __str__ method for the purpose of printing their name in a
generic way.

Change-Id: I663a9ea69bf7e7aaa6502896b6a71ef692f8d844
---
M docs/suci-tutorial.rst
M pySim/transport/__init__.py
M pySim/transport/calypso.py
M pySim/transport/modem_atcmd.py
M pySim/transport/pcsc.py
M pySim/transport/serial.py
M pysim-testdata/Fairwaves-SIM.ok
M pysim-testdata/Wavemobile-SIM.ok
M pysim-testdata/fakemagicsim.ok
M pysim-testdata/sysmoISIM-SJA2.ok
M pysim-testdata/sysmoUSIM-SJS1.ok
M pysim-testdata/sysmosim-gr1.ok
12 files changed, 27 insertions(+), 26 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/61/34961/3
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/34961?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I663a9ea69bf7e7aaa6502896b6a71ef692f8d844
Gerrit-Change-Number: 34961
Gerrit-PatchSet: 3
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Attention: laforge 
Gerrit-MessageType: newpatchset


[M] Change in osmo-mgw[master]: vty and log: also show local port for RTP conns

2023-11-03 Thread neels
neels has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-mgw/+/34150?usp=email )

Change subject: vty and log: also show local port for RTP conns
..

vty and log: also show local port for RTP conns

Before:

CONN: (1226/rtp, id:0xD94316AD, ip:127.0.0.2, rtp:2344 rtcp:2345)

After:

CONN: (1226/rtp C:D94316AD r=127.0.0.2:2344<->l=127.0.0.1:4002)

While changing that string, also include these changes for consistency
and readability:

- use the same r:...<->l:... format as osmo_sock_get_name().
- Instead of 'id:0x' use the actual MGCP format 'C: 9B686BE3'.
- drop the commas
- drop RTCP port: it is always RTP+1 and always an odd number.

Rationale:
The CONN pairs associated with each endpoint show remote RTP
ports. When osmo-mgw is being used by both BSC and MSC, one
side of the pair is showing the internal loop connection inside
osmo-mgw, while my intuition suggested this connection pair
is showing me the RTP port tuple of a single RTP stream. Adding
the local port to the display makes it more clear, IMHO.
Seeing the local port can also help to correlate the MGW vty
dump with a capture of RTP.

Implementation:
I first tried directly using osmo_sock_get_name_buf() on
conn->u.rtp.end.rtp.fd, but that might hide already known information
when the fd is not actively used yet (before SDP): the local address and
port would then be shown from the fd, not from
conn->u.rtp.end.local_addr/_port == hidden before the fd is set up.

Patch-By: whytek, nhofmeyr
Change-Id: Ib89a6779e1d68c6600f00699d4303f6c0ee07132
---
M src/libosmo-mgcp/mgcp_conn.c
1 file changed, 59 insertions(+), 32 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved
  keith: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved




diff --git a/src/libosmo-mgcp/mgcp_conn.c b/src/libosmo-mgcp/mgcp_conn.c
index afc9e4e..283a213 100644
--- a/src/libosmo-mgcp/mgcp_conn.c
+++ b/src/libosmo-mgcp/mgcp_conn.c
@@ -358,53 +358,37 @@
 {
static char str[sizeof(conn->name)+sizeof(conn->id)+256];
char ipbuf[INET6_ADDRSTRLEN];
+   struct osmo_strbuf sb = { .buf = str, .len = sizeof(str) };

-   if (!conn) {
-   snprintf(str, sizeof(str), "(null connection)");
-   return str;
-   }
+   if (!conn)
+   return "NULL";

switch (conn->type) {
case MGCP_CONN_TYPE_RTP:
+   OSMO_STRBUF_PRINTF(sb, "(%s/%s C:%s r=%s:%u<->l=%s:%u",
+  conn->name,
+  mgcp_conn_rtp_type_name(conn->type),
+  conn->id,
+  
osmo_sockaddr_ntop(&conn->u.rtp.end.addr.u.sa, ipbuf) ? : "NULL",
+  
osmo_sockaddr_port(&conn->u.rtp.end.addr.u.sa),
+  conn->u.rtp.end.local_addr ? : "NULL",
+  conn->u.rtp.end.local_port);
+
switch (conn->u.rtp.type) {
-   case MGCP_RTP_DEFAULT:
-   /* Dump RTP connection */
-   snprintf(str, sizeof(str), "(%s/rtp, id:0x%s, ip:%s, "
-   "rtp:%u rtcp:%u)",
-   conn->name, conn->id,
-   osmo_sockaddr_ntop(&conn->u.rtp.end.addr.u.sa, 
ipbuf),
-   osmo_sockaddr_port(&conn->u.rtp.end.addr.u.sa),
-   ntohs(conn->u.rtp.end.rtcp_port));
-   break;
case MGCP_RTP_OSMUX:
-   snprintf(str, sizeof(str), "(%s/osmux, id:0x%s, ip:%s, "
-   "port:%u CID:%u)",
-   conn->name, conn->id,
-   osmo_sockaddr_ntop(&conn->u.rtp.end.addr.u.sa, 
ipbuf),
-   osmo_sockaddr_port(&conn->u.rtp.end.addr.u.sa),
-   conn->u.rtp.osmux.local_cid);
-   break;
-   case MGCP_RTP_IUUP:
-   snprintf(str, sizeof(str), "(%s/iuup, id:0x%s, ip:%s, "
-   "port:%u)",
-   conn->name, conn->id,
-   osmo_sockaddr_ntop(&conn->u.rtp.end.addr.u.sa, 
ipbuf),
-   osmo_sockaddr_port(&conn->u.rtp.end.addr.u.sa));
+   OSMO_STRBUF_PRINTF(sb, " CID=%u", 
conn->u.rtp.osmux.local_cid);
break;
default:
-   /* Should not happen, we should be able to dump
-* every possible connection type. */
-   snprintf(str, sizeof(str), "(unknown conn_rtp 
connection type %u)",
-conn->u.rtp.type);
break;
}
+
+   OSMO_STRBUF_PRI

[S] Change in osmo-mgw[master]: add mgcp_conn_rtp_type_names[]

2023-11-03 Thread neels
neels has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-mgw/+/34941?usp=email )

Change subject: add mgcp_conn_rtp_type_names[]
..

add mgcp_conn_rtp_type_names[]

First use in upcoming Ib89a6779e1d68c6600f00699d4303f6c0ee07132

Change-Id: If3d8bc68a3b26d3aa0ba7eedeab67b820889ed54
---
M include/osmocom/mgcp/mgcp_conn.h
M src/libosmo-mgcp/mgcp_conn.c
2 files changed, 23 insertions(+), 0 deletions(-)

Approvals:
  pespin: Looks good to me, but someone else must approve
  Jenkins Builder: Verified
  laforge: Looks good to me, approved




diff --git a/include/osmocom/mgcp/mgcp_conn.h b/include/osmocom/mgcp/mgcp_conn.h
index 7ac40ab..4f7b705 100644
--- a/include/osmocom/mgcp/mgcp_conn.h
+++ b/include/osmocom/mgcp/mgcp_conn.h
@@ -49,6 +49,11 @@
MGCP_RTP_OSMUX,
MGCP_RTP_IUUP,
 };
+extern const struct value_string mgcp_conn_rtp_type_names[];
+static inline const char *mgcp_conn_rtp_type_name(enum mgcp_conn_rtp_type val)
+{
+   return get_value_string(mgcp_conn_rtp_type_names, val);
+}

 /*! Connection type, specifies which member of the union "u" in mgcp_conn
  *  contains a useful connection description (currently only RTP) */
diff --git a/src/libosmo-mgcp/mgcp_conn.c b/src/libosmo-mgcp/mgcp_conn.c
index 0ba10e5..afc9e4e 100644
--- a/src/libosmo-mgcp/mgcp_conn.c
+++ b/src/libosmo-mgcp/mgcp_conn.c
@@ -441,3 +441,10 @@

return llist_last_entry(&endp->conns, struct mgcp_conn, entry);
 }
+
+const struct value_string mgcp_conn_rtp_type_names[] = {
+   { MGCP_RTP_DEFAULT, "rtp" },
+   { MGCP_RTP_OSMUX, "osmux" },
+   { MGCP_RTP_IUUP, "iuup" },
+   {}
+};

--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/34941?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: If3d8bc68a3b26d3aa0ba7eedeab67b820889ed54
Gerrit-Change-Number: 34941
Gerrit-PatchSet: 1
Gerrit-Owner: neels 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: neels 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


[S] Change in osmo-iuh[master]: ranap_transp_layer_addr_decode2(): Fix decoding X.213 IPv4 address len=7

2023-11-03 Thread neels
Attention is currently required from: pespin.

neels has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-iuh/+/34963?usp=email )

Change subject: ranap_transp_layer_addr_decode2(): Fix decoding X.213 IPv4 
address len=7
..


Patch Set 3: Code-Review+1

(1 comment)

File src/iu_helpers.c:

https://gerrit.osmocom.org/c/osmo-iuh/+/34963/comment/8d3e4ab7_b7337e68
PS3, Line 143:  if ((len == 7 || len == 20) && buf[0] == 0x35) {
What do you think about allowing anything between 7..20? For an IPv4, there are 
just zero padding bytes, so we could allow any number of padding...
The X.213 does indicate IP version explicitly, so we don't need to derive the 
address family from the nr of bytes. We can just check that there are enough 
bytes available. Not sure if it makes sense to include the entire range, just 
asking what you think...

Just after writing this, I noticed that we use the length to detect X.213 vs 
other formats, particularly headerless IPv6 == 16 bytes. So better to just 
allow 7, right.

(This here is a contender for the weirdest convoluted spaghetti way of 
conveying an IP address on the wire, can you believe it.)



--
To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/34963?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: I507fb1605d976bd8573162e4fa81721245330184
Gerrit-Change-Number: 34963
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: neels 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Fri, 03 Nov 2023 19:25:48 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in osmo-iuh[master]: ranap_transp_layer_addr_decode2(): Fix decoding X.213 IPv4 address len=7

2023-11-03 Thread pespin
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/c/osmo-iuh/+/34963?usp=email

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

The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder


Change subject: ranap_transp_layer_addr_decode2(): Fix decoding X.213 IPv4 
address len=7
..

ranap_transp_layer_addr_decode2(): Fix decoding X.213 IPv4 address len=7

It was found in the field that some peers sends an X.213 IP address
consisting of 7 bytes (1byte IDP/AFI, 2byte ICP, 4 byte IPv4 address) insetad
of 20 bytes.

This is indeed possible when reading ITU Rec X.213 A.5.2.3, where it
states that Table A5 defining the 17 bytes DSP len for IANA ICP
"gives the maximum length of the DSP". So smaller values are still
possible/acceptable.

Related: SYS#6623
Change-Id: I507fb1605d976bd8573162e4fa81721245330184
---
M src/iu_helpers.c
1 file changed, 30 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/63/34963/3
--
To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/34963?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: I507fb1605d976bd8573162e4fa81721245330184
Gerrit-Change-Number: 34963
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset


[S] Change in osmo-iuh[master]: ranap_transp_layer_addr_decode2(): Fix decoding X.213 IPv4 address len=7

2023-11-03 Thread pespin
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/c/osmo-iuh/+/34963?usp=email

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

The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder


Change subject: ranap_transp_layer_addr_decode2(): Fix decoding X.213 IPv4 
address len=7
..

ranap_transp_layer_addr_decode2(): Fix decoding X.213 IPv4 address len=7

It was found in the field that some peers sends an X.213 IP address
consisting of 7 bytes (1byte IDP/AFI, 2byte ICP, 4 byte IPv4 address) insetad
of 20 bytes.

This is indeed possible when reading ITU Rec X.213 A.5.2.3, where it
states that Table A5 defining the 17 bytes DSP len for IANA ICP
"gives the maximum length of the DSP". So smaller values are still
possible/acceptable.

Related: SYS#6623
Change-Id: I507fb1605d976bd8573162e4fa81721245330184
---
M src/iu_helpers.c
1 file changed, 30 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/63/34963/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/34963?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: I507fb1605d976bd8573162e4fa81721245330184
Gerrit-Change-Number: 34963
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset


[M] Change in osmo-hnbgw[master]: tests/ranap_rab_ass: Test RAB-Ass.req with X.213 IPv4 address len=7

2023-11-03 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-hnbgw/+/34964?usp=email )


Change subject: tests/ranap_rab_ass: Test RAB-Ass.req with X.213 IPv4 address 
len=7
..

tests/ranap_rab_ass: Test RAB-Ass.req with X.213 IPv4 address len=7

It was found in the field that some peers sends an X.213 IP address
consisting of 7 bytes (1byte IDP/AFI, 2byte ICP, 4 byte IPv4 address) insetad
of 20 bytes. This was until recently failing in osmo-hnbgw due to
missing decoding functionalitit in osmo-iuh.git. Cover it here.

Related: SYS#6623
Depends: osmo-iuh.git I507fb1605d976bd8573162e4fa81721245330184
Change-Id: I71323018d79a4f5778dc6e49488d75ae7c2c4cdc
---
M TODO-RELEASE
M tests/ranap_rab_ass/ranap_rab_ass_test.c
M tests/ranap_rab_ass/ranap_rab_ass_test.ok
3 files changed, 60 insertions(+), 9 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/64/34964/1

diff --git a/TODO-RELEASE b/TODO-RELEASE
index d0852fc..b5a838d 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -7,3 +7,4 @@
 # If any interfaces have been added since the last public release: c:r:a + 1.
 # If any interfaces have been removed or changed since the last public 
release: c:r:0.
 #library   whatdescription / commit summary line
+osmo-iuh  >1.5.0  proper decoding of X.213 IPv4 address len=7
\ No newline at end of file
diff --git a/tests/ranap_rab_ass/ranap_rab_ass_test.c 
b/tests/ranap_rab_ass/ranap_rab_ass_test.c
index fbdfa77..76a3430 100644
--- a/tests/ranap_rab_ass/ranap_rab_ass_test.c
+++ b/tests/ranap_rab_ass/ranap_rab_ass_test.c
@@ -98,14 +98,27 @@
ranap_cn_rx_co_free(&message);
 }

-void test_ranap_rab_ass_req_ies_extract_inet_addr(void)
+static void test_ranap_rab_ass_req_ies_extract_inet_addr_one(uint8_t *testvec, 
size_t testvec_len)
 {
int rc;
struct osmo_sockaddr addr;
struct osmo_sockaddr_str addr_str;
uint8_t rab_id;
ranap_message message;
-   uint8_t testvec[] = {
+
+   rc = ranap_ran_rx_co_decode(talloc_asn1_ctx, &message, testvec, 
testvec_len);
+   OSMO_ASSERT(rc == 0);
+   rc = ranap_rab_ass_req_ies_extract_inet_addr(&addr, &rab_id, 
&message.msg.raB_AssignmentRequestIEs, 0);
+   osmo_sockaddr_str_from_sockaddr(&addr_str, &addr.u.sas);
+   printf("ranap_rab_ass_req_extract_inet_addr rc=%d\n", rc);
+   printf("RESULT: addr=%s, port=%u, rab-id=%02x\n", addr_str.ip, 
addr_str.port, rab_id);
+   ranap_ran_rx_co_free(&message);
+}
+
+void test_ranap_rab_ass_req_ies_extract_inet_addr(void)
+{
+
+   uint8_t testvec0[] = {
0x00, 0x00, 0x00, 0x59, 0x00, 0x00, 0x01, 0x00,
0x36, 0x40, 0x52, 0x00, 0x00, 0x01, 0x00, 0x35,
0x00, 0x48, 0x78, 0x22, 0xcd, 0x80, 0x10, 0x2f,
@@ -119,14 +132,33 @@
0x00, 0x00, 0x00, 0x00, 0x00, 0x40, 0x1f, 0x76,
0x00, 0x00, 0x40, 0x01, 0x00, 0x00
};
+   test_ranap_rab_ass_req_ies_extract_inet_addr_one(testvec0, 
sizeof(testvec0));

-   rc = ranap_ran_rx_co_decode(talloc_asn1_ctx, &message, testvec, 
sizeof(testvec));
-   OSMO_ASSERT(rc == 0);
-   rc = ranap_rab_ass_req_ies_extract_inet_addr(&addr, &rab_id, 
&message.msg.raB_AssignmentRequestIEs, 0);
-   osmo_sockaddr_str_from_sockaddr(&addr_str, &addr.u.sas);
-   printf("ranap_rab_ass_req_extract_inet_addr rc=%d\n", rc);
-   printf("RESULT: addr=%s, port=%u, rab-id=%02x\n", addr_str.ip, 
addr_str.port, rab_id);
-   ranap_ran_rx_co_free(&message);
+   /* "35 00 01 ac 19 0c 0d" => X.213 IPv4 address len=7:
+   * transportLayerInformation
+   * transportLayerAddress: 350001ac190c0d [bit length 56, 0011 0101   
   0001  1010 1100  0001 1001   1100   1101 decimal value 
14918180947954701]
+   *   transportLayerAddress NSAP: 350001ac190c0d
+   *   IDP: 350001
+   *   X.213 Address Format Information (AFI): IANA ICP, binary (0x35)
+   *   IANA ICP: IP Version 4 Address (0x0001)
+   *   DSP: ac190c0d00
+   *   IWFA IPv4 Address: 172.25.12.13
+   * iuTransportAssociation: bindingID (1)
+   *   bindingID: 444c (17484)
+   */
+   uint8_t testvec1[] = {
+   0x00, 0x00, 0x00, 0x80, 0x8c, 0x00, 0x00, 0x01, 0x00, 0x36, 
0x40, 0x80, 0x84, 0x00, 0x00, 0x01,
+   0x00, 0x35, 0x00, 0x7a, 0x78, 0x02, 0xcd, 0x80, 0x10, 0x2f, 
0xa7, 0x20, 0x12, 0x8e, 0x00, 0x00,
+   0xf4, 0x4c, 0x64, 0x0a, 0x10, 0x80, 0x00, 0x51, 0x40, 0x00, 
0x41, 0x40, 0x00, 0x4b, 0x40, 0x00,
+   0x3d, 0x40, 0x00, 0x3a, 0x40, 0x00, 0x37, 0x40, 0x00, 0x31, 
0x40, 0x00, 0x2a, 0x40, 0x00, 0x27,
+   0x20, 0x28, 0x84, 0x00, 0x67, 0x40, 0x00, 0x63, 0x40, 0x00, 
0x54, 0x40, 0x00, 0x57, 0x40, 0x00,
+   0x4c, 0x40, 0x00, 0x3f, 0x40, 0x00, 0x36, 0x40, 0x00, 0x35, 
0x40, 0x00, 0x00, 0x22, 0x28, 0x84,

[S] Change in osmo-iuh[master]: ranap_transp_layer_addr_decode2(): Fix decoding X.213 IPv4 address len=7

2023-11-03 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-iuh/+/34963?usp=email )


Change subject: ranap_transp_layer_addr_decode2(): Fix decoding X.213 IPv4 
address len=7
..

ranap_transp_layer_addr_decode2(): Fix decoding X.213 IPv4 address len=7

It was found in the field that some peers sends an X.213 IP address
consisting of 7 bytes (1byte IDP/AFI, 2byte ICP, 4 byte IPv4 address) insetad
of 20 bytes.

Related: SYS#6623
Change-Id: I507fb1605d976bd8573162e4fa81721245330184
---
M src/iu_helpers.c
1 file changed, 21 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-iuh refs/changes/63/34963/1

diff --git a/src/iu_helpers.c b/src/iu_helpers.c
index 718c30a..04f6904 100644
--- a/src/iu_helpers.c
+++ b/src/iu_helpers.c
@@ -140,14 +140,17 @@

memset(addr, 0, sizeof(*addr));

-   if (len == 20 && buf[0] == 0x35) {
-   /* For an X.213 NSAP encoded address we expect a buffer of 
exactly 20 bytes (3 bytes IDP + 17 bytes
-* DSP). we also expect AFI = 0x35, which means that two byte 
IDI and an IP address follows. (see also
-* comments in function ranap_new_transp_layer_addr below) */
+   if ((len == 7 || len == 20) && buf[0] == 0x35) {
+   /* For an X.213 NSAP encoded address we expect:
+* 3 bytes IDP (first byte AFI = 0x35, which means that two 
byte IDI and an IP address follows)
+* Either 4 or 17 bytes of DSP containing the IP address.
+* (see also comments in function ranap_new_transp_layer_addr 
below) */
x213_nsap = true;
icp = osmo_load16be(&buf[1]);
switch (icp) {
case 0x:
+   if (len != 20)
+   return -EINVAL;
addr->u.sa.sa_family = AF_INET6;
memcpy(addr->u.sin6.sin6_addr.s6_addr, buf + 3, 
sizeof(addr->u.sin6.sin6_addr.s6_addr));
break;

--
To view, visit https://gerrit.osmocom.org/c/osmo-iuh/+/34963?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-iuh
Gerrit-Branch: master
Gerrit-Change-Id: I507fb1605d976bd8573162e4fa81721245330184
Gerrit-Change-Number: 34963
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-MessageType: newchange


[S] Change in pysim[master]: transport: Extend the documentation for each transport driver

2023-11-03 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/pysim/+/34962?usp=email )


Change subject: transport: Extend the documentation for each transport driver
..

transport: Extend the documentation for each transport driver

This driver description we add to the code is automatically added to the
respective user manual sections.

Change-Id: I8807bfb11f43b167f1321d556e09ec5234fff629
---
M pySim/transport/calypso.py
M pySim/transport/modem_atcmd.py
M pySim/transport/pcsc.py
M pySim/transport/serial.py
4 files changed, 28 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/62/34962/1

diff --git a/pySim/transport/calypso.py b/pySim/transport/calypso.py
index 64e9d0c..d9d9033 100644
--- a/pySim/transport/calypso.py
+++ b/pySim/transport/calypso.py
@@ -165,6 +165,9 @@

 @staticmethod
 def argparse_add_reader_args(arg_parser: argparse.ArgumentParser):
-osmobb_group = arg_parser.add_argument_group('OsmocomBB Reader')
+osmobb_group = arg_parser.add_argument_group('OsmocomBB Reader', 
"""Use an OsmocomBB compatible phone
+to access the SIM inserted to the phone SIM slot.  This will require you to 
run the OsmocomBB firmware inside
+the phone (can be ram-loaded).  It also requires that you run the ``osmocon`` 
program, which provides a unix
+domain socket to which this reader driver can attach.""")
 osmobb_group.add_argument('--osmocon', dest='osmocon_sock', 
metavar='PATH', default=None,
   help='Socket path for Calypso (e.g. Motorola 
C1XX) based reader (via OsmocomBB)')
diff --git a/pySim/transport/modem_atcmd.py b/pySim/transport/modem_atcmd.py
index 28c30e3..ff4d960 100644
--- a/pySim/transport/modem_atcmd.py
+++ b/pySim/transport/modem_atcmd.py
@@ -176,7 +176,9 @@

 @staticmethod
 def argparse_add_reader_args(arg_parser: argparse.ArgumentParser):
-modem_group = arg_parser.add_argument_group('AT Command Modem Reader')
+modem_group = arg_parser.add_argument_group('AT Command Modem Reader', 
"""Talk to a SIM Card inside a
+mobile phone or cellular modem which is attached to this computer and offers 
an AT command interface including
+the AT+CSIM interface for Generic SIM access as specified in 3GPP TS 
27.007.""")
 modem_group.add_argument('--modem-device', dest='modem_dev', 
metavar='DEV', default=None,
  help='Serial port of modem for Generic SIM 
Access (3GPP TS 27.007)')
 modem_group.add_argument('--modem-baud', type=int, metavar='BAUD', 
default=115200,
diff --git a/pySim/transport/pcsc.py b/pySim/transport/pcsc.py
index 74c167e..4c7698b 100644
--- a/pySim/transport/pcsc.py
+++ b/pySim/transport/pcsc.py
@@ -122,6 +122,11 @@

 @staticmethod
 def argparse_add_reader_args(arg_parser: argparse.ArgumentParser):
-pcsc_group = arg_parser.add_argument_group('PC/SC Reader')
+pcsc_group = arg_parser.add_argument_group('PC/SC Reader',
+"""Use a PC/SC card reader to talk to the SIM card.  PC/SC is a 
standard API for how applications
+access smart card readers, and is available on a variety of operating systems, 
such as Microsoft
+Windows, MacOS X and Linux.  Most vendors of smart card readers provide 
drivers that offer a PC/SC
+interface, if not even a generic USB CCID driver is used.  You can use a tool 
like ``pcsc_scan -r``
+to obtain a list of readers available on your system. """)
 pcsc_group.add_argument('-p', '--pcsc-device', type=str, 
dest='pcsc_dev', metavar='PCSC', default=None,
 help='Number of (or regex matching) PC/SC 
reader to use for SIM access')
diff --git a/pySim/transport/serial.py b/pySim/transport/serial.py
index d5dc1db..29c0bc5 100644
--- a/pySim/transport/serial.py
+++ b/pySim/transport/serial.py
@@ -243,7 +243,9 @@

 @staticmethod
 def argparse_add_reader_args(arg_parser: argparse.ArgumentParser):
-serial_group = arg_parser.add_argument_group('Serial Reader')
+serial_group = arg_parser.add_argument_group('Serial Reader', """Use a 
simple/ultra-low-cost serial reader
+attached to a (physical or USB/virtual) RS232 port.  This doesn't work with 
all RS232-attached smart card
+readers, only with the very primitive readers following the ancient `Phoenix` 
or `Smart Mouse` design.""")
 serial_group.add_argument('-d', '--device', metavar='DEV', 
default='/dev/ttyUSB0',
   help='Serial Device for SIM access')
 serial_group.add_argument('-b', '--baud', dest='baudrate', type=int, 
metavar='BAUD', default=9600,

--
To view, visit https://gerrit.osmocom.org/c/pysim/+/34962?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I8807bfb11f43b167f1321d556e09ec5234fff629
Gerrit-Change-Numbe

[M] Change in pysim[master]: transport/pcsc: Allow opening PC/SC readers by a regex of their name

2023-11-03 Thread laforge
Attention is currently required from: laforge.

Hello Jenkins Builder,

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

https://gerrit.osmocom.org/c/pysim/+/34960?usp=email

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

The following approvals got outdated and were removed:
Verified-1 by Jenkins Builder


Change subject: transport/pcsc: Allow opening PC/SC readers by a regex of their 
name
..

transport/pcsc: Allow opening PC/SC readers by a regex of their name

Opening PC/SC readers by index/number is very error-prone as the order
is never deterministic in any system with multiple (hot-plugged, USB)
readers.  Instead, let's offer the alternative of specifying a regular
expression to match the reader name (similar to remsim-bankd).

Change-Id: I983f19c6741904c1adf27749c9801b44a03a5d78
---
M pySim/transport/pcsc.py
1 file changed, 51 insertions(+), 13 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/60/34960/2
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/34960?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I983f19c6741904c1adf27749c9801b44a03a5d78
Gerrit-Change-Number: 34960
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Attention: laforge 
Gerrit-MessageType: newpatchset


[M] Change in pysim[master]: Use construct 'Flag' instead of 'Bit' for type descriptions

2023-11-03 Thread laforge
Attention is currently required from: fixeria.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/pysim/+/34957?usp=email )

Change subject: Use construct 'Flag' instead of 'Bit' for type descriptions
..


Patch Set 3:

(1 comment)

File pySim/sysmocom_sja2.py:

https://gerrit.osmocom.org/c/pysim/+/34957/comment/9725e6c4_31d11845
PS1, Line 325: print("#")
> debugging leftover?
Done



--
To view, visit https://gerrit.osmocom.org/c/pysim/+/34957?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ib025f9c4551af7cf57090a0678ab0f66a6684fa4
Gerrit-Change-Number: 34957
Gerrit-PatchSet: 3
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Fri, 03 Nov 2023 11:14:57 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria 
Gerrit-MessageType: comment


[S] Change in pysim[master]: transport: Move printing of reader number/name to generic code

2023-11-03 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/pysim/+/34961?usp=email )


Change subject: transport: Move printing of reader number/name to generic code
..

transport: Move printing of reader number/name to generic code

Let's avoid copy+pasting print statements everywhere.  The instances
do already have a __str__ method for the purpose of printing their name in a
generic way.

Change-Id: I663a9ea69bf7e7aaa6502896b6a71ef692f8d844
---
M pySim/transport/__init__.py
M pySim/transport/calypso.py
M pySim/transport/modem_atcmd.py
M pySim/transport/pcsc.py
M pySim/transport/serial.py
M pysim-testdata/Fairwaves-SIM.ok
M pysim-testdata/Wavemobile-SIM.ok
M pysim-testdata/fakemagicsim.ok
M pysim-testdata/sysmoISIM-SJA2.ok
M pysim-testdata/sysmosim-gr1.ok
10 files changed, 25 insertions(+), 24 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/61/34961/1

diff --git a/pySim/transport/__init__.py b/pySim/transport/__init__.py
index e90ced6..f0c788f 100644
--- a/pySim/transport/__init__.py
+++ b/pySim/transport/__init__.py
@@ -3,6 +3,7 @@
 """ pySim: PCSC reader transport link base
 """

+import os
 import abc
 import argparse
 from typing import Optional, Tuple
@@ -301,4 +302,10 @@
 from pySim.transport.serial import SerialSimLink
 sl = SerialSimLink(device=opts.device,
baudrate=opts.baudrate, **kwargs)
+
+if os.environ.get('PYSIM_INTEGRATION_TEST') == "1":
+print("Using %s reader interface" % (sl.__class__.__name__))
+else:
+print("Using reader %s" % sl)
+
 return sl
diff --git a/pySim/transport/calypso.py b/pySim/transport/calypso.py
index 98330a9..64e9d0c 100644
--- a/pySim/transport/calypso.py
+++ b/pySim/transport/calypso.py
@@ -79,10 +79,6 @@

 def __init__(self, sock_path: str = "/tmp/osmocom_l2", **kwargs):
 super().__init__(**kwargs)
-if os.environ.get('PYSIM_INTEGRATION_TEST') == "1":
-print("Using Calypso-based (OsmocomBB) reader interface")
-else:
-print("Using Calypso-based (OsmocomBB) reader at socket %s" % 
sock_path)
 # Make sure that a given socket path exists
 if not os.path.exists(sock_path):
 raise ReaderError(
diff --git a/pySim/transport/modem_atcmd.py b/pySim/transport/modem_atcmd.py
index 71f76e2..28c30e3 100644
--- a/pySim/transport/modem_atcmd.py
+++ b/pySim/transport/modem_atcmd.py
@@ -21,7 +21,6 @@
 import time
 import re
 import argparse
-import os
 from typing import Optional

 from pySim.utils import Hexstr, ResTuple
@@ -37,10 +36,6 @@

 def __init__(self, device: str = '/dev/ttyUSB0', baudrate: int = 115200, 
**kwargs):
 super().__init__(**kwargs)
-if os.environ.get('PYSIM_INTEGRATION_TEST') == "1":
-print("Using modem for Generic SIM Access (3GPP TS 27.007)")
-else:
-print("Using modem for Generic SIM Access (3GPP TS 27.007) at port 
%s" % device)
 self._sl = serial.Serial(device, baudrate, timeout=5)
 self._echo = False # this will be auto-detected by 
_check_echo()
 self._device = device
diff --git a/pySim/transport/pcsc.py b/pySim/transport/pcsc.py
index 4041728..f89cf05 100644
--- a/pySim/transport/pcsc.py
+++ b/pySim/transport/pcsc.py
@@ -18,7 +18,6 @@
 #

 import argparse
-import os
 import re
 from typing import Optional

@@ -65,11 +64,6 @@

 self._con = self._reader.createConnection()

-if os.environ.get('PYSIM_INTEGRATION_TEST') == "1":
-print("Using PC/SC reader interface")
-else:
-print("Using PC/SC reader %s" % self)
-

 def __del__(self):
 try:
diff --git a/pySim/transport/serial.py b/pySim/transport/serial.py
index ad800ed..d5dc1db 100644
--- a/pySim/transport/serial.py
+++ b/pySim/transport/serial.py
@@ -33,10 +33,6 @@
 def __init__(self, device: str = '/dev/ttyUSB0', baudrate: int = 9600, 
rst: str = '-rts',
  debug: bool = False, **kwargs):
 super().__init__(**kwargs)
-if os.environ.get('PYSIM_INTEGRATION_TEST') == "1":
-print("Using serial reader interface")
-else:
-print("Using serial reader interface at port %s" % device)
 if not os.path.exists(device):
 raise ValueError("device file %s does not exist -- abort" % device)
 self._sl = serial.Serial(
diff --git a/pysim-testdata/Fairwaves-SIM.ok b/pysim-testdata/Fairwaves-SIM.ok
index 063fc6b..35af941 100644
--- a/pysim-testdata/Fairwaves-SIM.ok
+++ b/pysim-testdata/Fairwaves-SIM.ok
@@ -1,4 +1,4 @@
-Using PC/SC reader interface
+Using PcscSimLink reader interface
 Reading ...
 Autodetected card type: Fairwaves-SIM
 ICCID: 898821900117833
diff --git a/pysim-testdata/Wavemobile-SIM.ok b/pysim-testdata/Wavemobile-SIM.ok
index 980332f..adecac6 100644
--- a/pysim-testdata/Wavemobile-SIM.ok
+++ b/pysim-testdata/

[M] Change in pysim[master]: transport/pcsc: Allow opening PC/SC readers by a regex of their name

2023-11-03 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/pysim/+/34960?usp=email )


Change subject: transport/pcsc: Allow opening PC/SC readers by a regex of their 
name
..

transport/pcsc: Allow opening PC/SC readers by a regex of their name

Opening PC/SC readers by index/number is very error-prone as the order
is never deterministic in any system with multiple (hot-plugged, USB)
readers.  Instead, let's offer the alternative of specifying a regular
expression to match the reader name (similar to remsim-bankd).

Change-Id: I983f19c6741904c1adf27749c9801b44a03a5d78
---
M pySim/transport/pcsc.py
1 file changed, 49 insertions(+), 11 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/60/34960/1

diff --git a/pySim/transport/pcsc.py b/pySim/transport/pcsc.py
index 762908c..4041728 100644
--- a/pySim/transport/pcsc.py
+++ b/pySim/transport/pcsc.py
@@ -1,7 +1,7 @@
 # -*- coding: utf-8 -*-

 # Copyright (C) 2009-2010  Sylvain Munaut 
-# Copyright (C) 2010  Harald Welte 
+# Copyright (C) 2010-2023  Harald Welte 
 #
 # 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
@@ -19,6 +19,7 @@

 import argparse
 import os
+import re
 from typing import Optional

 from smartcard.CardConnection import CardConnection
@@ -31,21 +32,44 @@
 from pySim.utils import h2i, i2h, Hexstr, ResTuple


+def is_a_number(arg: str) -> bool:
+"""Determine if the passed string can be converted into an integer."""
+try:
+int(arg)
+except:
+return False
+return True
+
 class PcscSimLink(LinkBase):
 """ pySim: PCSC reader transport link."""

-def __init__(self, reader_number: int = 0, **kwargs):
+def __init__(self, reader_number: int | str = 0, **kwargs):
 super().__init__(**kwargs)
+self._reader = None
+r = readers()
+if is_a_number(reader_number):
+# actual reader index number (integer)
+reader_number = int(reader_number)
+if reader_number >= len(r):
+raise ReaderError('No reader found for number %d' % 
reader_number)
+self._reader = r[reader_number]
+else:
+# reader regex string
+cre = re.compile(reader_number)
+for reader in r:
+if cre.search(reader.name):
+self._reader = reader
+break
+if not self._reader:
+raise ReaderError('No matching reader found for regex %s' % 
reader_number)
+
+self._con = self._reader.createConnection()
+
 if os.environ.get('PYSIM_INTEGRATION_TEST') == "1":
 print("Using PC/SC reader interface")
 else:
-print("Using PC/SC reader number %u" % reader_number)
-r = readers()
-if reader_number >= len(r):
-raise ReaderError('No reader found for number %d' % reader_number)
-self._reader = r[reader_number]
-self._con = self._reader.createConnection()
-self._reader_number = reader_number
+print("Using PC/SC reader %s" % self)
+

 def __del__(self):
 try:
@@ -100,10 +124,10 @@
 return i2h(data), i2h(sw)

 def __str__(self) -> str:
-return "PCSC:%u[%s]" % (self._reader_number,  self._reader)
+return "PCSC[%s]" % (self._reader)

 @staticmethod
 def argparse_add_reader_args(arg_parser: argparse.ArgumentParser):
 pcsc_group = arg_parser.add_argument_group('PC/SC Reader')
-pcsc_group.add_argument('-p', '--pcsc-device', type=int, 
dest='pcsc_dev', metavar='PCSC', default=None,
+pcsc_group.add_argument('-p', '--pcsc-device', type=str, 
dest='pcsc_dev', metavar='PCSC', default=None,
 help='PC/SC reader number to use for SIM 
access')

--
To view, visit https://gerrit.osmocom.org/c/pysim/+/34960?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I983f19c6741904c1adf27749c9801b44a03a5d78
Gerrit-Change-Number: 34960
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-MessageType: newchange


[S] Change in pysim[master]: transport: Log it explicitly if user doesn't specify a reader

2023-11-03 Thread laforge
laforge has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/pysim/+/34959?usp=email )


Change subject: transport: Log it explicitly if user doesn't specify a reader
..

transport: Log it explicitly if user doesn't specify a reader

Change-Id: I37e9d62fabf237ece7e49d8f2253c606999d3d02
---
M pySim/transport/__init__.py
1 file changed, 10 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/59/34959/1

diff --git a/pySim/transport/__init__.py b/pySim/transport/__init__.py
index 6cccf8c..e90ced6 100644
--- a/pySim/transport/__init__.py
+++ b/pySim/transport/__init__.py
@@ -297,6 +297,7 @@
 sl = ModemATCommandLink(
  device=opts.modem_dev, baudrate=opts.modem_baud, **kwargs)
 else:  # Serial reader is default
+print("No reader/driver specified; falling back to default (Serial 
reader)")
 from pySim.transport.serial import SerialSimLink
 sl = SerialSimLink(device=opts.device,
baudrate=opts.baudrate, **kwargs)

--
To view, visit https://gerrit.osmocom.org/c/pysim/+/34959?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I37e9d62fabf237ece7e49d8f2253c606999d3d02
Gerrit-Change-Number: 34959
Gerrit-PatchSet: 1
Gerrit-Owner: laforge 
Gerrit-MessageType: newchange


[M] Change in pysim[master]: Use construct 'Flag' instead of 'Bit' for type descriptions

2023-11-03 Thread laforge
Attention is currently required from: fixeria, laforge.

Hello Jenkins Builder, fixeria,

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

https://gerrit.osmocom.org/c/pysim/+/34957?usp=email

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

The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder


Change subject: Use construct 'Flag' instead of 'Bit' for type descriptions
..

Use construct 'Flag' instead of 'Bit' for type descriptions

It's better for the human reader (and more obvious that it's a boolean
value) if we decode single Bits as True/False instead of 1/0.

Change-Id: Ib025f9c4551af7cf57090a0678ab0f66a6684fa4
---
M pySim/sysmocom_sja2.py
M pySim/ts_31_102.py
2 files changed, 31 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/57/34957/3
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/34957?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ib025f9c4551af7cf57090a0678ab0f66a6684fa4
Gerrit-Change-Number: 34957
Gerrit-PatchSet: 3
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Attention: laforge 
Gerrit-Attention: fixeria 
Gerrit-MessageType: newpatchset


[S] Change in osmo-hnodeb[master]: tests: enable commented-out 'python-tests' target

2023-11-03 Thread fixeria
fixeria has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-hnodeb/+/32146?usp=email )

Change subject: tests: enable commented-out 'python-tests' target
..

tests: enable commented-out 'python-tests' target

Keep the last line running the CTRL tests commented out as the
CTRL interface is not implemented yet.  Add a TODO.

Change-Id: I76e24184aecafa8460d1da9419a424d9990730c5
Related: OS#5989
---
M tests/Makefile.am
1 file changed, 18 insertions(+), 6 deletions(-)

Approvals:
  osmith: Looks good to me, approved
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve




diff --git a/tests/Makefile.am b/tests/Makefile.am
index d2be48e..e048faa 100644
--- a/tests/Makefile.am
+++ b/tests/Makefile.am
@@ -34,12 +34,11 @@
$(NULL)

 if ENABLE_EXT_TESTS
-python-tests:
-   echo ""
-#  TODO: Enable once we have a VTY/CTRL interface:
-#  $(MAKE) vty-test
-#  osmotestvty.py -p $(abs_top_srcdir) -w $(abs_top_builddir) -v
-#  osmotestconfig.py -p $(abs_top_srcdir) -w $(abs_top_builddir) -v
+python-tests: $(top_builddir)/src/osmo-hnodeb/osmo-hnodeb
+   $(MAKE) vty-test
+   osmotestvty.py -p $(abs_top_srcdir) -w $(abs_top_builddir) -v
+   osmotestconfig.py -p $(abs_top_srcdir) -w $(abs_top_builddir) -v
+# TODO: CTRL interface is not implemented
 #  $(srcdir)/ctrl_test_runner.py -w $(abs_top_builddir) -v
 else
 python-tests:

--
To view, visit https://gerrit.osmocom.org/c/osmo-hnodeb/+/32146?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnodeb
Gerrit-Branch: master
Gerrit-Change-Id: I76e24184aecafa8460d1da9419a424d9990730c5
Gerrit-Change-Number: 32146
Gerrit-PatchSet: 4
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


[S] Change in osmo-hnodeb[master]: tests/ctrl_test_runner.py: fix wrong CTRL port

2023-11-03 Thread fixeria
fixeria has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-hnodeb/+/34958?usp=email )

Change subject: tests/ctrl_test_runner.py: fix wrong CTRL port
..

tests/ctrl_test_runner.py: fix wrong CTRL port

Change-Id: I88432b77dae923df373055a657a77838268a32e1
Related: OS#5989
---
M tests/ctrl_test_runner.py
1 file changed, 11 insertions(+), 1 deletion(-)

Approvals:
  Jenkins Builder: Verified
  pespin: Looks good to me, but someone else must approve
  osmith: Looks good to me, approved




diff --git a/tests/ctrl_test_runner.py b/tests/ctrl_test_runner.py
index c0e6a55..e446b43 100755
--- a/tests/ctrl_test_runner.py
+++ b/tests/ctrl_test_runner.py
@@ -154,7 +154,7 @@
 "doc/examples/osmo-hnodeb/osmo-hnodeb.cfg"]

 def ctrl_app(self):
-return (4249, "./src/osmo-hnodeb/osmo-hnodeb", "OsmoHNodeB", "hnb")
+return (4274, "./src/osmo-hnodeb/osmo-hnodeb", "OsmoHNodeB", "hnb")

 def testCtrlErrs(self):
 r = self.do_get('invalid')

--
To view, visit https://gerrit.osmocom.org/c/osmo-hnodeb/+/34958?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnodeb
Gerrit-Branch: master
Gerrit-Change-Id: I88432b77dae923df373055a657a77838268a32e1
Gerrit-Change-Number: 34958
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


[S] Change in osmo-hnodeb[master]: tests: enable commented-out 'python-tests' target

2023-11-03 Thread osmith
Attention is currently required from: fixeria, laforge.

osmith has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-hnodeb/+/32146?usp=email )

Change subject: tests: enable commented-out 'python-tests' target
..


Patch Set 4: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-hnodeb/+/32146?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnodeb
Gerrit-Branch: master
Gerrit-Change-Id: I76e24184aecafa8460d1da9419a424d9990730c5
Gerrit-Change-Number: 32146
Gerrit-PatchSet: 4
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-Attention: laforge 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Fri, 03 Nov 2023 09:30:43 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in osmo-hnodeb[master]: tests/ctrl_test_runner.py: fix wrong CTRL port

2023-11-03 Thread osmith
Attention is currently required from: fixeria.

osmith has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-hnodeb/+/34958?usp=email )

Change subject: tests/ctrl_test_runner.py: fix wrong CTRL port
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-hnodeb/+/34958?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnodeb
Gerrit-Branch: master
Gerrit-Change-Id: I88432b77dae923df373055a657a77838268a32e1
Gerrit-Change-Number: 34958
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Fri, 03 Nov 2023 09:29:25 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[M] Change in osmo-ttcn3-hacks[master]: sccp: Introduce test TC_cr_timeout_cc_too_late

2023-11-03 Thread fixeria
Attention is currently required from: daniel, pespin.

fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34923?usp=email )

Change subject: sccp: Introduce test TC_cr_timeout_cc_too_late
..


Patch Set 4: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34923?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: If4b53565f1fa19894ca24fa71e02ae7b1941411e
Gerrit-Change-Number: 34923
Gerrit-PatchSet: 4
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: osmith 
Gerrit-Attention: pespin 
Gerrit-Attention: daniel 
Gerrit-Comment-Date: Fri, 03 Nov 2023 09:20:19 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[M] Change in osmo-ttcn3-hacks[master]: sccp: Introduce test TC_cr_timeout_cc_too_late

2023-11-03 Thread osmith
Attention is currently required from: daniel, fixeria, pespin.

osmith has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34923?usp=email )

Change subject: sccp: Introduce test TC_cr_timeout_cc_too_late
..


Patch Set 4: Code-Review+1

(1 comment)

File library/SCCP_Templates.ttcn:

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34923/comment/1a2ab103_8ec11be0
PS1, Line 128:  callingPAddress := ?, //FIXME: 
tr_Addr(calling),
> do you want to keep the fixme?
Done



--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34923?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: If4b53565f1fa19894ca24fa71e02ae7b1941411e
Gerrit-Change-Number: 34923
Gerrit-PatchSet: 4
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: osmith 
Gerrit-Attention: pespin 
Gerrit-Attention: fixeria 
Gerrit-Attention: daniel 
Gerrit-Comment-Date: Fri, 03 Nov 2023 09:07:34 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: osmith 
Gerrit-MessageType: comment


[M] Change in osmo-ttcn3-hacks[master]: sccp: Introduce test TC_cr_timeout_cc_too_late

2023-11-03 Thread pespin
Attention is currently required from: daniel, fixeria, osmith.

pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34923?usp=email )

Change subject: sccp: Introduce test TC_cr_timeout_cc_too_late
..


Patch Set 4:

(1 comment)

File library/SCCP_Templates.ttcn:

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34923/comment/5f628a78_f61aff9e
PS3, Line 120: calling_enc
> Now why this template becomes a function? I may be missing something, but to 
> me it looks like there  […]
Done



--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34923?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: If4b53565f1fa19894ca24fa71e02ae7b1941411e
Gerrit-Change-Number: 34923
Gerrit-PatchSet: 4
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: osmith 
Gerrit-Attention: osmith 
Gerrit-Attention: fixeria 
Gerrit-Attention: daniel 
Gerrit-Comment-Date: Fri, 03 Nov 2023 08:37:49 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria 
Gerrit-MessageType: comment


[M] Change in osmo-ttcn3-hacks[master]: sccp: Introduce test TC_cr_timeout_cc_too_late

2023-11-03 Thread pespin
Attention is currently required from: daniel, osmith, pespin.

Hello Jenkins Builder, daniel, fixeria, osmith,

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

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34923?usp=email

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

The following approvals got outdated and were removed:
Code-Review+1 by daniel, Code-Review+1 by osmith, Verified+1 by Jenkins Builder


Change subject: sccp: Introduce test TC_cr_timeout_cc_too_late
..

sccp: Introduce test TC_cr_timeout_cc_too_late

Related: SYS#6602
Change-Id: If4b53565f1fa19894ca24fa71e02ae7b1941411e
---
M library/SCCP_Templates.ttcn
M sccp/SCCP_Tests_RAW.ttcn
2 files changed, 106 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/23/34923/4
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34923?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: If4b53565f1fa19894ca24fa71e02ae7b1941411e
Gerrit-Change-Number: 34923
Gerrit-PatchSet: 4
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: osmith 
Gerrit-Attention: osmith 
Gerrit-Attention: pespin 
Gerrit-Attention: daniel 
Gerrit-MessageType: newpatchset


[S] Change in osmo-hnodeb[master]: tests: enable commented-out 'python-tests' target

2023-11-03 Thread pespin
Attention is currently required from: fixeria, laforge, osmith.

pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-hnodeb/+/32146?usp=email )

Change subject: tests: enable commented-out 'python-tests' target
..


Patch Set 4: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-hnodeb/+/32146?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnodeb
Gerrit-Branch: master
Gerrit-Change-Id: I76e24184aecafa8460d1da9419a424d9990730c5
Gerrit-Change-Number: 32146
Gerrit-PatchSet: 4
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-Attention: osmith 
Gerrit-Attention: laforge 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Fri, 03 Nov 2023 08:16:30 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in osmo-hnodeb[master]: tests/ctrl_test_runner.py: fix wrong CTRL port

2023-11-03 Thread pespin
Attention is currently required from: fixeria.

pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-hnodeb/+/34958?usp=email )

Change subject: tests/ctrl_test_runner.py: fix wrong CTRL port
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-hnodeb/+/34958?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnodeb
Gerrit-Branch: master
Gerrit-Change-Id: I88432b77dae923df373055a657a77838268a32e1
Gerrit-Change-Number: 34958
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Fri, 03 Nov 2023 08:15:29 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[M] Change in osmocom-bb[master]: mobile: rename voice.[ch] to tch.[ch]

2023-11-03 Thread pespin
Attention is currently required from: fixeria, jolly, laforge.

pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/34917?usp=email )

Change subject: mobile: rename voice.[ch] to tch.[ch]
..


Patch Set 3: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/34917?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I05e1ae777add73672db61565c77c68d8ab2b08f0
Gerrit-Change-Number: 34917
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: jolly 
Gerrit-Attention: laforge 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Fri, 03 Nov 2023 08:13:24 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[M] Change in osmocom-bb[master]: mobile: add params and VTY commands for data calls

2023-11-03 Thread pespin
Attention is currently required from: fixeria, jolly, laforge.

pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/34915?usp=email )

Change subject: mobile: add params and VTY commands for data calls
..


Patch Set 3: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/34915?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: If52fa70cb202f0736a17fe8eb63d226186637f62
Gerrit-Change-Number: 34915
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: jolly 
Gerrit-Attention: laforge 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Fri, 03 Nov 2023 08:13:01 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in osmocom-bb[master]: mobile: gsm_settings_init(): set TCH frame format explicitly

2023-11-03 Thread pespin
Attention is currently required from: fixeria, jolly, laforge.

pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/34914?usp=email )

Change subject: mobile: gsm_settings_init(): set TCH frame format explicitly
..


Patch Set 3: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/34914?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I4660b07977b6701ad5dc4bf25f12cba374101f8b
Gerrit-Change-Number: 34914
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: jolly 
Gerrit-Attention: laforge 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Fri, 03 Nov 2023 08:12:01 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[M] Change in osmocom-bb[master]: mobile: rename 'audio' node to 'tch-voice' node

2023-11-03 Thread pespin
Attention is currently required from: fixeria, jolly, laforge.

pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/34911?usp=email )

Change subject: mobile: rename 'audio' node to 'tch-voice' node
..


Patch Set 3: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/34911?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I2cab597c5de92ecb343cad748035ca5f8365
Gerrit-Change-Number: 34911
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: jolly 
Gerrit-Attention: laforge 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Fri, 03 Nov 2023 08:11:38 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[L] Change in osmocom-bb[master]: mobile: add support for Circuit Switched Data calls

2023-11-03 Thread pespin
Attention is currently required from: fixeria, jolly, laforge.

pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/34762?usp=email )

Change subject: mobile: add support for Circuit Switched Data calls
..


Patch Set 7: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/34762?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I1995fa0a7a68d9b980852b664d472d4633777ac6
Gerrit-Change-Number: 34762
Gerrit-PatchSet: 7
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: jolly 
Gerrit-Attention: laforge 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Fri, 03 Nov 2023 08:10:45 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[M] Change in osmocom-bb[master]: mobile: add params and VTY commands for data calls

2023-11-03 Thread fixeria
Attention is currently required from: jolly, laforge, pespin.

fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/34915?usp=email )

Change subject: mobile: add params and VTY commands for data calls
..


Patch Set 3:

(1 comment)

This change is ready for review.

File src/host/layer23/src/mobile/vty_interface.c:

https://gerrit.osmocom.org/c/osmocom-bb/+/34915/comment/4003413a_2eb56de2
PS2, Line 1491: if (set->tch.data_handler == TCH_DATA_IOH_UNIX_SOCK) {
> I also don't have a strong feeling either way at this point. For me it's fine 
> to merge this as-is.
After all, I decided to add a new node with TCH data params.



--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/34915?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: If52fa70cb202f0736a17fe8eb63d226186637f62
Gerrit-Change-Number: 34915
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: laforge 
Gerrit-CC: pespin 
Gerrit-Attention: jolly 
Gerrit-Attention: laforge 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Fri, 03 Nov 2023 08:10:02 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: jolly 
Comment-In-Reply-To: laforge 
Comment-In-Reply-To: pespin 
Comment-In-Reply-To: fixeria 
Gerrit-MessageType: comment


[M] Change in osmocom-bb[master]: mobile: clarify TCH I/O {handler,format} naming

2023-11-03 Thread pespin
Attention is currently required from: fixeria, jolly, laforge.

pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/34912?usp=email )

Change subject: mobile: clarify TCH I/O {handler,format} naming
..


Patch Set 3: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/34912?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: If6c799d11e225ad00ca5da5ae63dca20568a0ce0
Gerrit-Change-Number: 34912
Gerrit-PatchSet: 3
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: jolly 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: jolly 
Gerrit-Attention: laforge 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Fri, 03 Nov 2023 08:08:33 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in osmo-hnodeb[master]: tests: enable commented-out 'python-tests' target

2023-11-03 Thread fixeria
Attention is currently required from: fixeria, laforge.

Hello Jenkins Builder, laforge,

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

https://gerrit.osmocom.org/c/osmo-hnodeb/+/32146?usp=email

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

The following approvals got outdated and were removed:
Code-Review+1 by laforge, Verified-1 by Jenkins Builder


Change subject: tests: enable commented-out 'python-tests' target
..

tests: enable commented-out 'python-tests' target

Keep the last line running the CTRL tests commented out as the
CTRL interface is not implemented yet.  Add a TODO.

Change-Id: I76e24184aecafa8460d1da9419a424d9990730c5
Related: OS#5989
---
M tests/Makefile.am
1 file changed, 18 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-hnodeb refs/changes/46/32146/4
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnodeb/+/32146?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnodeb
Gerrit-Branch: master
Gerrit-Change-Id: I76e24184aecafa8460d1da9419a424d9990730c5
Gerrit-Change-Number: 32146
Gerrit-PatchSet: 4
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Attention: laforge 
Gerrit-Attention: fixeria 
Gerrit-MessageType: newpatchset


[S] Change in osmo-hnodeb[master]: tests/ctrl_test_runner.py: fix wrong CTRL port

2023-11-03 Thread fixeria
fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmo-hnodeb/+/34958?usp=email )


Change subject: tests/ctrl_test_runner.py: fix wrong CTRL port
..

tests/ctrl_test_runner.py: fix wrong CTRL port

Change-Id: I88432b77dae923df373055a657a77838268a32e1
Related: OS#5989
---
M tests/ctrl_test_runner.py
1 file changed, 11 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-hnodeb refs/changes/58/34958/1

diff --git a/tests/ctrl_test_runner.py b/tests/ctrl_test_runner.py
index c0e6a55..e446b43 100755
--- a/tests/ctrl_test_runner.py
+++ b/tests/ctrl_test_runner.py
@@ -154,7 +154,7 @@
 "doc/examples/osmo-hnodeb/osmo-hnodeb.cfg"]

 def ctrl_app(self):
-return (4249, "./src/osmo-hnodeb/osmo-hnodeb", "OsmoHNodeB", "hnb")
+return (4274, "./src/osmo-hnodeb/osmo-hnodeb", "OsmoHNodeB", "hnb")

 def testCtrlErrs(self):
 r = self.do_get('invalid')

--
To view, visit https://gerrit.osmocom.org/c/osmo-hnodeb/+/34958?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-hnodeb
Gerrit-Branch: master
Gerrit-Change-Id: I88432b77dae923df373055a657a77838268a32e1
Gerrit-Change-Number: 34958
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-MessageType: newchange


[M] Change in pysim[master]: pySim-shell: Move init_card() function to new pySim.app module

2023-11-03 Thread fixeria
Attention is currently required from: laforge.

fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/pysim/+/34956?usp=email )

Change subject: pySim-shell: Move init_card() function to new pySim.app module
..


Patch Set 2: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/pysim/+/34956?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Icf557ed3064ef613ed693ce28bd3514a97a938bd
Gerrit-Change-Number: 34956
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Attention: laforge 
Gerrit-Comment-Date: Fri, 03 Nov 2023 07:46:00 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[M] Change in pysim[master]: pySim-shell: Move init_card() function to new pySim.app module

2023-11-03 Thread laforge
Attention is currently required from: fixeria, laforge.

Hello Jenkins Builder, fixeria,

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

https://gerrit.osmocom.org/c/pysim/+/34956?usp=email

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

The following approvals got outdated and were removed:
Code-Review+1 by fixeria, Verified-1 by Jenkins Builder


Change subject: pySim-shell: Move init_card() function to new pySim.app module
..

pySim-shell: Move init_card() function to new pySim.app module

The point of this is to move generic code out of pySim-shell.py,
paving the way for more/other executables using the full power of
our class model without having to reinvent the wheel.

Change-Id: Icf557ed3064ef613ed693ce28bd3514a97a938bd
---
M pySim-shell.py
A pySim/app.py
2 files changed, 133 insertions(+), 94 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/56/34956/2
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/34956?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Icf557ed3064ef613ed693ce28bd3514a97a938bd
Gerrit-Change-Number: 34956
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Attention: laforge 
Gerrit-Attention: fixeria 
Gerrit-MessageType: newpatchset


[M] Change in pysim[master]: Use construct 'Flag' instead of 'Bit' for type descriptions

2023-11-03 Thread laforge
Attention is currently required from: fixeria, laforge.

Hello Jenkins Builder, fixeria,

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

https://gerrit.osmocom.org/c/pysim/+/34957?usp=email

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

The following approvals got outdated and were removed:
Code-Review+1 by fixeria, Verified-1 by Jenkins Builder


Change subject: Use construct 'Flag' instead of 'Bit' for type descriptions
..

Use construct 'Flag' instead of 'Bit' for type descriptions

It's better for the human reader (and more obvious that it's a boolean
value) if we decode single Bits as True/False instead of 1/0.

Change-Id: Ib025f9c4551af7cf57090a0678ab0f66a6684fa4
---
M pySim/sysmocom_sja2.py
M pySim/ts_31_102.py
2 files changed, 32 insertions(+), 19 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/57/34957/2
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/34957?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ib025f9c4551af7cf57090a0678ab0f66a6684fa4
Gerrit-Change-Number: 34957
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Attention: laforge 
Gerrit-Attention: fixeria 
Gerrit-MessageType: newpatchset


[M] Change in pysim[master]: sysmocom_sja2: Add some de/encode test vectors

2023-11-03 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/pysim/+/34949?usp=email )

Change subject: sysmocom_sja2: Add some de/encode test vectors
..

sysmocom_sja2: Add some de/encode test vectors

This increases test coverage and also shows where we so far only
have decoders but no encoders yet

Change-Id: I7932bab7c81a2314c1b9477f50b82a46f24d074e
---
M pySim/sysmocom_sja2.py
1 file changed, 56 insertions(+), 19 deletions(-)

Approvals:
  pespin: Looks good to me, but someone else must approve
  fixeria: Looks good to me, approved
  Jenkins Builder: Verified




diff --git a/pySim/sysmocom_sja2.py b/pySim/sysmocom_sja2.py
index bfd0ff5..bd9e8a8 100644
--- a/pySim/sysmocom_sja2.py
+++ b/pySim/sysmocom_sja2.py
@@ -70,18 +70,20 @@


 class EF_MILENAGE_CFG(TransparentEF):
+_test_de_encode = [
+( 
'4000204061000200040008',
+  {"r1": 64, "r2": 0, "r3": 32, "r4": 64, "r5": 96, "c1": 
"", "c2":
+   "0001", "c3": 
"0002", "c4":
+   "0004", "c5": 
"0008"} ),
+  ]
 def __init__(self, fid='6f21', name='EF.MILENAGE_CFG', desc='Milenage 
connfiguration'):
 super().__init__(fid, name=name, desc=desc)
-
-def _decode_bin(self, raw_bin_data):
-u = unpack('!B16s16s16s16s16s', raw_bin_data)
-return {'r1': u[0], 'r2': u[1], 'r3': u[2], 'r4': u[3], 'r5': u[4],
-'c1': u[5].hex(),
-'c2': u[6].hex(),
-'c3': u[7].hex(),
-'c4': u[8].hex(),
-'c5': u[9].hex(),
-}
+self._construct = Struct('r1'/Int8ub, 'r2'/Int8ub, 'r3'/Int8ub, 
'r4'/Int8ub, 'r5'/Int8ub,
+ 'c1'/HexAdapter(Bytes(16)),
+ 'c2'/HexAdapter(Bytes(16)),
+ 'c3'/HexAdapter(Bytes(16)),
+ 'c4'/HexAdapter(Bytes(16)),
+ 'c5'/HexAdapter(Bytes(16)))


 class EF_0348_KEY(LinFixedEF):
@@ -99,12 +101,14 @@


 class EF_0348_COUNT(LinFixedEF):
+_test_de_encode = [
+( 'fe0100', {"sec_domain": 254, "key_set_version": 1, 
"counter": "00"} ),
+  ]
 def __init__(self, fid='6f23', name='EF.0348_COUNT', desc='TS 03.48 OTA 
Counters'):
 super().__init__(fid, name=name, desc=desc, rec_len=(7, 7))
-
-def _decode_record_bin(self, raw_bin_data, **kwargs):
-u = unpack('!BB5s', raw_bin_data)
-return {'sec_domain': u[0], 'key_set_version': u[1], 'counter': u[2]}
+self._construct = Struct('sec_domain'/Int8ub,
+ 'key_set_version'/Int8ub,
+ 'counter'/HexAdapter(Bytes(5)))


 class EF_SIM_AUTH_COUNTER(TransparentEF):
@@ -114,13 +118,15 @@


 class EF_GP_COUNT(LinFixedEF):
+_test_de_encode = [
+( '007000', {"sec_domain": 0, "key_set_version": 112, "counter": 
0, "rfu": 0} ),
+  ]
 def __init__(self, fid='6f26', name='EF.GP_COUNT', desc='GP SCP02 
Counters'):
 super().__init__(fid, name=name, desc=desc, rec_len=(5, 5))
-
-def _decode_record_bin(self, raw_bin_data, **kwargs):
-u = unpack('!BBHB', raw_bin_data)
-return {'sec_domain': u[0], 'key_set_version': u[1], 'counter': u[2], 
'rfu': u[3]}
-
+self._construct = Struct('sec_domain'/Int8ub,
+ 'key_set_version'/Int8ub,
+ 'counter'/Int16ub,
+ 'rfu'/Int8ub)

 class EF_GP_DIV_DATA(LinFixedEF):
 def __init__(self, fid='6f27', name='EF.GP_DIV_DATA', desc='GP SCP02 key 
diversification data'):
@@ -132,6 +138,11 @@


 class EF_SIM_AUTH_KEY(TransparentEF):
+_test_de_encode = [
+( '14000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f',
+  {"cfg": {"use_sres_deriv_func_2": 0, "use_opc_instead_of_op": 1, 
"algorithm": "milenage"}, "key":
+   "000102030405060708090a0b0c0d0e0f", "op_opc": 
"101112131415161718191a1b1c1d1e1f"} ),
+  ]
 def __init__(self, fid='6f20', name='EF.SIM_AUTH_KEY'):
 super().__init__(fid, name=name, desc='USIM authentication key')
 CfgByte = BitStruct(Padding(2),
@@ -168,6 +179,14 @@


 class EF_USIM_SQN(TransparentEF):
+_test_de_encode = [
+( 
'd5030002000200

[S] Change in pysim[master]: pySim-shell: Reject any non-decimal PIN values

2023-11-03 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/pysim/+/34948?usp=email )

Change subject: pySim-shell: Reject any non-decimal PIN values
..

pySim-shell: Reject any non-decimal PIN values

Don't even send any non-decimal PIN values to the card, but reject
them when parsing the command arguments.

Change-Id: Icec1698851471af7f76f20201dcdcfcd48ddf365
---
M pySim-shell.py
M pySim/utils.py
2 files changed, 27 insertions(+), 8 deletions(-)

Approvals:
  pespin: Looks good to me, but someone else must approve
  fixeria: Looks good to me, approved
  Jenkins Builder: Verified




diff --git a/pySim-shell.py b/pySim-shell.py
index 306dd40..0c559f9 100755
--- a/pySim-shell.py
+++ b/pySim-shell.py
@@ -53,7 +53,7 @@
 from pySim.cards import card_detect, SimCardBase, UiccCardBase
 from pySim.utils import h2b, b2h, i2h, swap_nibbles, rpad, JsonEncoder, 
bertlv_parse_one, sw_match
 from pySim.utils import sanitize_pin_adm, tabulate_str_list, 
boxed_heading_str, Hexstr, dec_iccid
-from pySim.utils import is_hexstr_or_decimal, is_hexstr
+from pySim.utils import is_hexstr_or_decimal, is_hexstr, is_decimal
 from pySim.card_handler import CardHandler, CardHandlerAuto

 from pySim.filesystem import CardDF, CardADF, CardModel, CardApplication
@@ -864,7 +864,7 @@
 verify_chv_parser.add_argument(
 '--pin-nr', type=int, default=1, help='PIN Number, 1=PIN1, 2=PIN2 or 
custom value (decimal)')
 verify_chv_parser.add_argument(
-'pin_code', type=str, help='PIN code digits, \"PIN1\" or \"PIN2\" to 
get PIN code from external data source')
+'pin_code', type=is_decimal, help='PIN code digits, \"PIN1\" or 
\"PIN2\" to get PIN code from external data source')

 @cmd2.with_argparser(verify_chv_parser)
 def do_verify_chv(self, opts):
@@ -879,9 +879,9 @@
 unblock_chv_parser.add_argument(
 '--pin-nr', type=int, default=1, help='PUK Number, 1=PIN1, 2=PIN2 or 
custom value (decimal)')
 unblock_chv_parser.add_argument(
-'puk_code', type=str, help='PUK code digits \"PUK1\" or \"PUK2\" to 
get PUK code from external data source')
+'puk_code', type=is_decimal, help='PUK code digits \"PUK1\" or 
\"PUK2\" to get PUK code from external data source')
 unblock_chv_parser.add_argument(
-'new_pin_code', type=str, help='PIN code digits \"PIN1\" or \"PIN2\" 
to get PIN code from external data source')
+'new_pin_code', type=is_decimal, help='PIN code digits \"PIN1\" or 
\"PIN2\" to get PIN code from external data source')

 @cmd2.with_argparser(unblock_chv_parser)
 def do_unblock_chv(self, opts):
@@ -896,9 +896,9 @@
 change_chv_parser.add_argument(
 '--pin-nr', type=int, default=1, help='PUK Number, 1=PIN1, 2=PIN2 or 
custom value (decimal)')
 change_chv_parser.add_argument(
-'pin_code', type=str, help='PIN code digits \"PIN1\" or \"PIN2\" to 
get PIN code from external data source')
+'pin_code', type=is_decimal, help='PIN code digits \"PIN1\" or 
\"PIN2\" to get PIN code from external data source')
 change_chv_parser.add_argument(
-'new_pin_code', type=str, help='PIN code digits \"PIN1\" or \"PIN2\" 
to get PIN code from external data source')
+'new_pin_code', type=is_decimal, help='PIN code digits \"PIN1\" or 
\"PIN2\" to get PIN code from external data source')

 @cmd2.with_argparser(change_chv_parser)
 def do_change_chv(self, opts):
@@ -913,7 +913,7 @@
 disable_chv_parser.add_argument(
 '--pin-nr', type=int, default=1, help='PIN Number, 1=PIN1, 2=PIN2 or 
custom value (decimal)')
 disable_chv_parser.add_argument(
-'pin_code', type=str, help='PIN code digits, \"PIN1\" or \"PIN2\" to 
get PIN code from external data source')
+'pin_code', type=is_decimal, help='PIN code digits, \"PIN1\" or 
\"PIN2\" to get PIN code from external data source')

 @cmd2.with_argparser(disable_chv_parser)
 def do_disable_chv(self, opts):
@@ -926,7 +926,7 @@
 enable_chv_parser.add_argument(
 '--pin-nr', type=int, default=1, help='PIN Number, 1=PIN1, 2=PIN2 or 
custom value (decimal)')
 enable_chv_parser.add_argument(
-'pin_code', type=str, help='PIN code digits, \"PIN1\" or \"PIN2\" to 
get PIN code from external data source')
+'pin_code', type=is_decimal, help='PIN code digits, \"PIN1\" or 
\"PIN2\" to get PIN code from external data source')

 @cmd2.with_argparser(enable_chv_parser)
 def do_enable_chv(self, opts):
diff --git a/pySim/utils.py b/pySim/utils.py
index ea1c9e6..44800fb 100644
--- a/pySim/utils.py
+++ b/pySim/utils.py
@@ -1487,3 +1487,10 @@
 if len(instr) & 1:
 raise ValueError('Input has un-even number of hex digits')
 return instr
+
+def is_decimal(instr: str) -> str:
+"""Method that can be used as 'type' in argparse.add_argument() to 
validate the value consists of
+an even sequence of decimal digits only."""
+if n

[S] Change in pysim[master]: pySim-shell: Validate that argument to 'apdu' command is proper hexstr

2023-11-03 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/pysim/+/34946?usp=email )

Change subject: pySim-shell: Validate that argument to 'apdu' command is proper 
hexstr
..

pySim-shell: Validate that argument to 'apdu' command is proper hexstr

Let's not even send anything to the card if it's not an even number
of hexadecimal digits

Change-Id: I58465244101cc1a976e5a17af2aceea1cf9f9b54
---
M pySim-shell.py
M pySim/utils.py
2 files changed, 23 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved
  fixeria: Looks good to me, but someone else must approve




diff --git a/pySim-shell.py b/pySim-shell.py
index c2bb15c..d9c9f8c 100755
--- a/pySim-shell.py
+++ b/pySim-shell.py
@@ -53,7 +53,7 @@
 from pySim.cards import card_detect, SimCardBase, UiccCardBase
 from pySim.utils import h2b, b2h, i2h, swap_nibbles, rpad, JsonEncoder, 
bertlv_parse_one, sw_match
 from pySim.utils import sanitize_pin_adm, tabulate_str_list, 
boxed_heading_str, Hexstr, dec_iccid
-from pySim.utils import is_hexstr_or_decimal
+from pySim.utils import is_hexstr_or_decimal, is_hexstr
 from pySim.card_handler import CardHandler, CardHandlerAuto

 from pySim.filesystem import CardDF, CardADF, CardModel, CardApplication
@@ -322,7 +322,7 @@
 self.equip(card, rs)

 apdu_cmd_parser = argparse.ArgumentParser()
-apdu_cmd_parser.add_argument('APDU', type=str, help='APDU as hex string')
+apdu_cmd_parser.add_argument('APDU', type=is_hexstr, help='APDU as hex 
string')
 apdu_cmd_parser.add_argument('--expect-sw', help='expect a specified 
status word', type=str, default=None)

 @cmd2.with_argparser(apdu_cmd_parser)
diff --git a/pySim/utils.py b/pySim/utils.py
index 92bf70f..ea1c9e6 100644
--- a/pySim/utils.py
+++ b/pySim/utils.py
@@ -1478,3 +1478,12 @@
 if len(instr) & 1:
 raise ValueError('Input has un-even number of hex digits')
 return instr
+
+def is_hexstr(instr: str) -> str:
+"""Method that can be used as 'type' in argparse.add_argument() to 
validate the value consists of
+an even sequence of hexadecimal digits only."""
+if not all(c in string.hexdigits for c in instr):
+raise ValueError('Input must be hexadecimal')
+if len(instr) & 1:
+raise ValueError('Input has un-even number of hex digits')
+return instr

--
To view, visit https://gerrit.osmocom.org/c/pysim/+/34946?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I58465244101cc1a976e5a17af2aceea1cf9f9b54
Gerrit-Change-Number: 34946
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-CC: pespin 
Gerrit-MessageType: merged


[S] Change in pysim[master]: pySim-shell: Improved argument validation for verify_adm argument

2023-11-03 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/pysim/+/34945?usp=email )

Change subject: pySim-shell: Improved argument validation for verify_adm 
argument
..

pySim-shell: Improved argument validation for verify_adm argument

Let's make sure we don't even bother to ask the card to verify
anything as ADM1 pin which is not either a sequence of decimal digits
or an even number of hex digits (even number of bytes).

Change-Id: I4a193a3cf63462fad73d145ab1481070ddf767ca
---
M pySim-shell.py
M pySim/utils.py
2 files changed, 26 insertions(+), 1 deletion(-)

Approvals:
  pespin: Looks good to me, but someone else must approve
  fixeria: Looks good to me, approved
  Jenkins Builder: Verified




diff --git a/pySim-shell.py b/pySim-shell.py
index 7aaa234..c2bb15c 100755
--- a/pySim-shell.py
+++ b/pySim-shell.py
@@ -53,6 +53,7 @@
 from pySim.cards import card_detect, SimCardBase, UiccCardBase
 from pySim.utils import h2b, b2h, i2h, swap_nibbles, rpad, JsonEncoder, 
bertlv_parse_one, sw_match
 from pySim.utils import sanitize_pin_adm, tabulate_str_list, 
boxed_heading_str, Hexstr, dec_iccid
+from pySim.utils import is_hexstr_or_decimal
 from pySim.card_handler import CardHandler, CardHandlerAuto

 from pySim.filesystem import CardDF, CardADF, CardModel, CardApplication
@@ -777,7 +778,7 @@
 self._cmd.poutput("no description available")

 verify_adm_parser = argparse.ArgumentParser()
-verify_adm_parser.add_argument('ADM1', nargs='?', type=str,
+verify_adm_parser.add_argument('ADM1', nargs='?', 
type=is_hexstr_or_decimal,
help='ADM1 pin value. If none given, CSV 
file will be queried')

 @cmd2.with_argparser(verify_adm_parser)
diff --git a/pySim/utils.py b/pySim/utils.py
index 7459a3f..92bf70f 100644
--- a/pySim/utils.py
+++ b/pySim/utils.py
@@ -1467,3 +1467,14 @@
 def all_subclasses(cls) -> set:
 """Recursively get all subclasses of a specified class"""
 return set(cls.__subclasses__()).union([s for c in cls.__subclasses__() 
for s in all_subclasses(c)])
+
+def is_hexstr_or_decimal(instr: str) -> str:
+"""Method that can be used as 'type' in argparse.add_argument() to 
validate the value consists of
+[hexa]decimal digits only."""
+if instr.isdecimal():
+return instr
+if not all(c in string.hexdigits for c in instr):
+raise ValueError('Input must be [hexa]decimal')
+if len(instr) & 1:
+raise ValueError('Input has un-even number of hex digits')
+return instr

--
To view, visit https://gerrit.osmocom.org/c/pysim/+/34945?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I4a193a3cf63462fad73d145ab1481070ddf767ca
Gerrit-Change-Number: 34945
Gerrit-PatchSet: 3
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


[S] Change in pysim[master]: pySim-shell: permit string with spaces for 'echo' command

2023-11-03 Thread laforge
laforge has submitted this change. ( 
https://gerrit.osmocom.org/c/pysim/+/34947?usp=email )

Change subject: pySim-shell: permit string with spaces for 'echo' command
..

pySim-shell: permit string with spaces for 'echo' command

before this patch:

pySIM-shell (00:MF)> echo foo bar baz
usage: echo [-h] string
echo: error: unrecognized arguments: bar baz

after this patch:

pySIM-shell (00:MF)> echo foo bar baz
foo bar baz

Change-Id: I1369bc3aa975865e3a8a574c132e469813a9f6b9
---
M pySim-shell.py
1 file changed, 22 insertions(+), 2 deletions(-)

Approvals:
  pespin: Looks good to me, but someone else must approve
  Jenkins Builder: Verified
  fixeria: Looks good to me, approved




diff --git a/pySim-shell.py b/pySim-shell.py
index d9c9f8c..306dd40 100755
--- a/pySim-shell.py
+++ b/pySim-shell.py
@@ -510,13 +510,13 @@
 first = False

 echo_parser = argparse.ArgumentParser()
-echo_parser.add_argument('string', help="string to echo on the shell")
+echo_parser.add_argument('string', help="string to echo on the shell", 
nargs='+')

 @cmd2.with_argparser(echo_parser)
 @cmd2.with_category(CUSTOM_CATEGORY)
 def do_echo(self, opts):
 """Echo (print) a string on the console"""
-self.poutput(opts.string)
+self.poutput(' '.join(opts.string))

 @cmd2.with_category(CUSTOM_CATEGORY)
 def do_version(self, opts):

--
To view, visit https://gerrit.osmocom.org/c/pysim/+/34947?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I1369bc3aa975865e3a8a574c132e469813a9f6b9
Gerrit-Change-Number: 34947
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


[S] Change in pysim[master]: pySim-shell: Validate that argument to 'apdu' command is proper hexstr

2023-11-03 Thread laforge
Attention is currently required from: pespin.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/pysim/+/34946?usp=email )

Change subject: pySim-shell: Validate that argument to 'apdu' command is proper 
hexstr
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/pysim/+/34946?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I58465244101cc1a976e5a17af2aceea1cf9f9b54
Gerrit-Change-Number: 34946
Gerrit-PatchSet: 2
Gerrit-Owner: laforge 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-CC: pespin 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Fri, 03 Nov 2023 07:29:29 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment