Change in osmocom-bb[master]: layer23/sysinfo: fix copy-paste in gsm48_decode_sysinfo13()

2023-01-12 Thread pespin
Attention is currently required from: fixeria.
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/30941 )

Change subject: layer23/sysinfo: fix copy-paste in gsm48_decode_sysinfo13()
..


Patch Set 1: Code-Review+1


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Ia9309a037cc09c2a0de2f64521a57e0567fbec11
Gerrit-Change-Number: 30941
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Thu, 12 Jan 2023 09:02:47 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmocore[master]: gsm_08_58: add IEI to signal HR GSM RTP format via RSL

2023-01-12 Thread dexter
Attention is currently required from: pespin.
dexter has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/30724 )

Change subject: gsm_08_58: add IEI to signal HR GSM RTP format via RSL
..


Patch Set 2:

(1 comment)

Commit Message:

https://gerrit.osmocom.org/c/libosmocore/+/30724/comment/c444704e_b4efa7a9
PS2, Line 12: packets. (In the receiving direction the BTS automatically 
detects the
> If the BTS automatically detects the RTP format upon rx, why cannot we simply 
> detect it automaticall […]
1: The MGW does exactly that but it has no knowledge about when to convert and 
when not. It just converts one format into the other and vice versa. It works 
fine for homogenic setups but once you add a BTS that uses the other format it 
won't work.

2: in MGCP/SDP There is no specified way to signal which HR GSM format to use 
and it would also address the problem at the wrong location. The BTS should 
transit in the expected format and we shouldn't be forced to convert it at some 
second-tier point.

We can solve the problem via osmo-bts.cfg. I personally would prefer that 
solution since it is much simpler, but I thought we would prefer to have the 
BTS parameters configured by the BSC.



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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I843c8a0cbe5898311f3af3294cec7c8bc96c4eb8
Gerrit-Change-Number: 30724
Gerrit-PatchSet: 2
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: msuraev 
Gerrit-Reviewer: pespin 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Thu, 12 Jan 2023 09:17:02 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin 
Gerrit-MessageType: comment


Change in libosmocore[master]: gsm_08_58: add IEI to signal HR GSM RTP format via RSL

2023-01-12 Thread dexter
Attention is currently required from: pespin.
dexter has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/30724 )

Change subject: gsm_08_58: add IEI to signal HR GSM RTP format via RSL
..


Patch Set 2:

(1 comment)

Patchset:

PS2:
> I'd like to hear feedback from others here, since I don't think the current 
> proposal in the patch is […]
Just for info: The ultimate goal here is to be able to configure in which of 
the two HR GSM formats (RFC5993 or TS 101.318) the BTS should use for sending 
RTP packets. Some core networks prefer the one, some the other format. I don't 
think that this is a dynamic parameter. From my experience its a fixed property 
of the core network but I have the feeling that TS 101.318 is the more common 
format.

I think things would become much easier if we would be able to configure 
osmo-bts to use one or the other format. At the moment it is sort of random and 
depends on the phy/trx. even osmo-bts-trx and osmo-bts-sysmo use different 
formats which has lead to confusion in the past.



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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I843c8a0cbe5898311f3af3294cec7c8bc96c4eb8
Gerrit-Change-Number: 30724
Gerrit-PatchSet: 2
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: msuraev 
Gerrit-Reviewer: pespin 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Thu, 12 Jan 2023 09:31:29 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin 
Gerrit-MessageType: comment


Change in libosmocore[master]: uitils: add floored and euclidian modulo functions

2023-01-12 Thread dexter
dexter has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/30933 )

Change subject: uitils: add floored and euclidian modulo functions
..

uitils: add floored and euclidian modulo functions

C/C++ only implements a so called "truncated modulo" function. Lets also
add a floored and an euclidian modulo function to be more complete.

The functions will be used to generalize the following Change:
I5fb2b0ada8d409730ac22963741fb4ab0026abdd

Change-Id: If61cd54f43643325c45f64531c57fe4c5802a9cf
---
M include/osmocom/core/utils.h
M tests/utils/utils_test.c
M tests/utils/utils_test.ok
3 files changed, 102 insertions(+), 0 deletions(-)

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



diff --git a/include/osmocom/core/utils.h b/include/osmocom/core/utils.h
index d0e2e9b..ee7cfa4 100644
--- a/include/osmocom/core/utils.h
+++ b/include/osmocom/core/utils.h
@@ -182,6 +182,18 @@

 uint32_t osmo_isqrt32(uint32_t x);

+/*! Floored Modulo (See also: Daan Leijen, Division and Modulus for Computer 
Scientists).
+ * \param[in] x dividend.
+ * \param[in] y divisor.
+ * \returns remainder of x divided by y. */
+#define OSMO_MOD_FLR(x, y) (((x) > 0 && (y) < 0) || ((x) < 0 && (y) > 0) ? (x) 
% (y) + (y) : (x) % (y))
+
+/*! Euclidean Modulo (See also: Daan Leijen, Division and Modulus for Computer 
Scientists).
+ * \param[in] x dividend.
+ * \param[in] y divisor.
+ * \returns remainder of x divided by y. */
+#define OSMO_MOD_EUC(x, y) ((x) % (y) < 0 ? (y) > 0 ? (x) % (y) + (y) : (x) % 
(y) - (y) : (x) % (y))
+
 char osmo_luhn(const char* in, int in_len);

 /*! State for OSMO_STRBUF_APPEND() and OSMO_STRBUF_PRINTF(). See there for 
examples. */
diff --git a/tests/utils/utils_test.c b/tests/utils/utils_test.c
index 9ddae65..0b7bfe4 100644
--- a/tests/utils/utils_test.c
+++ b/tests/utils/utils_test.c
@@ -766,6 +766,65 @@
}
 }

+static void mod_test_mod(int x, int y, int expected_result)
+{
+   int result;
+   result = x % y;
+   printf(" %d mod %d = %d = %d\n", x, y, result, expected_result);
+   OSMO_ASSERT(result == expected_result);
+}
+
+static void mod_test_mod_flr(int x, int y, int expected_result)
+{
+   int result;
+   result = OSMO_MOD_FLR(x, y);
+   printf(" %d mod_flr %d = %d = %d\n", x, y, result, expected_result);
+   OSMO_ASSERT(result == expected_result);
+}
+
+static void mod_test_mod_euc(int x, int y, int expected_result)
+{
+   int result;
+   result = OSMO_MOD_EUC(x, y);
+   printf(" %d mod_euc %d = %d = %d\n", x, y, result, expected_result);
+   OSMO_ASSERT(result == expected_result);
+}
+
+static void mod_test(void)
+{
+   /* See also: Daan Leijen, Division and Modulus for Computer
+* Scientists, section 1.3 */
+
+   printf("\nTesting built in truncated modulo for comparison:\n");
+   mod_test_mod(8, 3, 2);
+   mod_test_mod(8, -3, 2);
+   mod_test_mod(-8, 3, -2);
+   mod_test_mod(-8, -3, -2);
+   mod_test_mod(1, 2, 1);
+   mod_test_mod(1, -2, 1);
+   mod_test_mod(-1, 2, -1);
+   mod_test_mod(-1, -2, -1);
+
+   printf("\nTesting OSMO_MOD_FLR():\n");
+   mod_test_mod_flr(8, 3, 2);
+   mod_test_mod_flr(8, -3, -1);
+   mod_test_mod_flr(-8, 3, 1);
+   mod_test_mod_flr(-8, -3, -2);
+   mod_test_mod_flr(1, 2, 1);
+   mod_test_mod_flr(1, -2, -1);
+   mod_test_mod_flr(-1, 2, 1);
+   mod_test_mod_flr(-1, -2, -1);
+
+   printf("\nTesting OSMO_MOD_EUC():\n");
+   mod_test_mod_euc(8, 3, 2);
+   mod_test_mod_euc(8, -3, 2);
+   mod_test_mod_euc(-8, 3, 1);
+   mod_test_mod_euc(-8, -3, 1);
+   mod_test_mod_euc(1, 2, 1);
+   mod_test_mod_euc(1, -2, 1);
+   mod_test_mod_euc(-1, 2, 1);
+   mod_test_mod_euc(-1, -2, 1);
+}

 struct osmo_sockaddr_to_str_and_uint_test_case {
uint16_t port;
@@ -2088,6 +2147,7 @@
str_escape3_test();
str_quote3_test();
isqrt_test();
+   mod_test();
osmo_sockaddr_to_str_and_uint_test();
osmo_str_tolowupper_test();
strbuf_test();
diff --git a/tests/utils/utils_test.ok b/tests/utils/utils_test.ok
index 1409d81..3f453e9 100644
--- a/tests/utils/utils_test.ok
+++ b/tests/utils/utils_test.ok
@@ -354,6 +354,36 @@

 Testing integer square-root

+Testing built in truncated modulo for comparison:
+ 8 mod 3 = 2 = 2
+ 8 mod -3 = 2 = 2
+ -8 mod 3 = -2 = -2
+ -8 mod -3 = -2 = -2
+ 1 mod 2 = 1 = 1
+ 1 mod -2 = 1 = 1
+ -1 mod 2 = -1 = -1
+ -1 mod -2 = -1 = -1
+
+Testing OSMO_MOD_FLR():
+ 8 mod_flr 3 = 2 = 2
+ 8 mod_flr -3 = -1 = -1
+ -8 mod_flr 3 = 1 = 1
+ -8 mod_flr -3 = -2 = -2
+ 1 mod_flr 2 = 1 = 1
+ 1 mod_flr -2 = -1 = -1
+ -1 mod_flr 2 = 1 = 1
+ -1 mod_flr -2 = -1 = -1
+
+Testing OSMO_MOD_EUC():
+ 8 mod_euc 3 = 2 = 2
+ 8 mod_euc -3 = 2 = 2
+ -8 mod_euc 3 = 1 = 1
+ -8 mod_euc -3 = 1 = 1
+ 1 mod_euc 2 = 1 = 1
+ 1 

Change in osmocom-bb[master]: layer23/sysinfo: fix copy-paste in gsm48_decode_sysinfo13()

2023-01-12 Thread fixeria
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/30941 )

Change subject: layer23/sysinfo: fix copy-paste in gsm48_decode_sysinfo13()
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Ia9309a037cc09c2a0de2f64521a57e0567fbec11
Gerrit-Change-Number: 30941
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 12 Jan 2023 09:37:53 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmocom-bb[master]: layer23/sysinfo: fix copy-paste in gsm48_decode_sysinfo13()

2023-01-12 Thread fixeria
fixeria has submitted this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/30941 )

Change subject: layer23/sysinfo: fix copy-paste in gsm48_decode_sysinfo13()
..

layer23/sysinfo: fix copy-paste in gsm48_decode_sysinfo13()

Change-Id: Ia9309a037cc09c2a0de2f64521a57e0567fbec11
Fixes: CID#307087, CID#307088
---
M src/host/layer23/src/common/sysinfo.c
1 file changed, 2 insertions(+), 2 deletions(-)

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



diff --git a/src/host/layer23/src/common/sysinfo.c 
b/src/host/layer23/src/common/sysinfo.c
index 0201c7c..392cdc3 100644
--- a/src/host/layer23/src/common/sysinfo.c
+++ b/src/host/layer23/src/common/sysinfo.c
@@ -898,8 +898,8 @@
s->gprs.pan_params_present = gco->Exist_PAN;
if (s->gprs.pan_params_present) {
s->gprs.pan_dec = gco->PAN_DEC;
-   s->gprs.pan_dec = gco->PAN_INC;
-   s->gprs.pan_dec = gco->PAN_MAX;
+   s->gprs.pan_inc = gco->PAN_INC;
+   s->gprs.pan_max = gco->PAN_MAX;
}

s->gprs.egprs_supported = 0;

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Ia9309a037cc09c2a0de2f64521a57e0567fbec11
Gerrit-Change-Number: 30941
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-sgsn[master]: gtp_{ggsn,mme}: Allocate contexts under struct sgsn_instance

2023-01-12 Thread fixeria
Attention is currently required from: pespin, daniel, lynxis lazus.
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/30890 )

Change subject: gtp_{ggsn,mme}: Allocate contexts under struct sgsn_instance
..


Patch Set 2: Code-Review+2

(1 comment)

File src/sgsn/gtp_ggsn.c:

https://gerrit.osmocom.org/c/osmo-sgsn/+/30890/comment/307d7ad8_faf4c971
PS2, Line 87: struct sgsn_instance *sgsn
I am wondering how this function worked before you added the sgsn pointer?
I guess there is the global sgsn instance defined somewhere?



--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30890
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: Ie65d59632a368c6957c33dca64e856ace792b2c6
Gerrit-Change-Number: 30890
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-CC: lynxis lazus 
Gerrit-Attention: pespin 
Gerrit-Attention: daniel 
Gerrit-Attention: lynxis lazus 
Gerrit-Comment-Date: Thu, 12 Jan 2023 09:53:39 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-sgsn[master]: gtp_{ggsn,mme}: Allocate contexts under struct sgsn_instance

2023-01-12 Thread pespin
Attention is currently required from: daniel, lynxis lazus.
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/30890 )

Change subject: gtp_{ggsn,mme}: Allocate contexts under struct sgsn_instance
..


Patch Set 2:

(1 comment)

File src/sgsn/gtp_ggsn.c:

https://gerrit.osmocom.org/c/osmo-sgsn/+/30890/comment/9cd1cf09_4d297f10
PS2, Line 87: struct sgsn_instance *sgsn
> I am wondering how this function worked before you added the sgsn pointer? […]
yes, sgsn is actually a global variable too. I plan to perhaps submit an extra 
commit at the end renaming it to g_sgsn.



--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30890
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: Ie65d59632a368c6957c33dca64e856ace792b2c6
Gerrit-Change-Number: 30890
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-CC: lynxis lazus 
Gerrit-Attention: daniel 
Gerrit-Attention: lynxis lazus 
Gerrit-Comment-Date: Thu, 12 Jan 2023 09:59:42 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria 
Gerrit-MessageType: comment


Change in osmo-sgsn[master]: gtp_{ggsn,mme}: Allocate contexts under struct sgsn_instance

2023-01-12 Thread daniel
Attention is currently required from: pespin, lynxis lazus.
daniel has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/30890 )

Change subject: gtp_{ggsn,mme}: Allocate contexts under struct sgsn_instance
..


Patch Set 2: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30890
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: Ie65d59632a368c6957c33dca64e856ace792b2c6
Gerrit-Change-Number: 30890
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-CC: lynxis lazus 
Gerrit-Attention: pespin 
Gerrit-Attention: lynxis lazus 
Gerrit-Comment-Date: Thu, 12 Jan 2023 10:03:17 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-sgsn[master]: Move extern declarations of tall_sgsn_ctx to sgsn.h

2023-01-12 Thread daniel
Attention is currently required from: pespin.
daniel has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/30930 )

Change subject: Move extern declarations of tall_sgsn_ctx to sgsn.h
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30930
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: Ifbd54b2e92db8d4a0e0cd1c569cfd83dd85165b8
Gerrit-Change-Number: 30930
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: dexter 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Thu, 12 Jan 2023 10:04:23 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-sgsn[master]: Drop extern declarations of global sgsn_instance in source files

2023-01-12 Thread daniel
Attention is currently required from: pespin.
daniel has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/30931 )

Change subject: Drop extern declarations of global sgsn_instance in source files
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30931
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I2375e13c8436a069e8fe60136c8e1759a9adc2d1
Gerrit-Change-Number: 30931
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Thu, 12 Jan 2023 10:04:48 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-sgsn[master]: Move sgsn_pdp_ctx to its own file pdpctx.{c,h}

2023-01-12 Thread daniel
Attention is currently required from: pespin, lynxis lazus.
daniel has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/30891 )

Change subject: Move sgsn_pdp_ctx to its own file pdpctx.{c,h}
..


Patch Set 3: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30891
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: Iad4da06efee7d8514ff48423bdaebc0f26413cc1
Gerrit-Change-Number: 30891
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: laforge 
Gerrit-CC: lynxis lazus 
Gerrit-Attention: pespin 
Gerrit-Attention: lynxis lazus 
Gerrit-Comment-Date: Thu, 12 Jan 2023 10:08:55 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-sgsn[master]: Move global pdp_list inside struct sgsn_instance

2023-01-12 Thread daniel
Attention is currently required from: pespin.
daniel has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/30892 )

Change subject: Move global pdp_list inside struct sgsn_instance
..


Patch Set 2: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30892
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I725218fd54adcc68dceded5eb43675f25771bb96
Gerrit-Change-Number: 30892
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Thu, 12 Jan 2023 10:10:04 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-sgsn[master]: Fix extra whitespace in pdpctx_ctr_description

2023-01-12 Thread daniel
Attention is currently required from: pespin.
daniel has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/30932 )

Change subject: Fix extra whitespace in pdpctx_ctr_description
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30932
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I4d9145c681e725b709fde38f6e9b4516d37b4d8c
Gerrit-Change-Number: 30932
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Thu, 12 Jan 2023 10:19:24 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-sgsn[master]: vty: Introduce encryption cipher-plugin-path command

2023-01-12 Thread daniel
Attention is currently required from: pespin, dexter.
daniel has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/30909 )

Change subject: vty: Introduce encryption cipher-plugin-path command
..


Patch Set 2: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30909
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I4f965c7afafa193f4d7486750dd3e43cca22bb65
Gerrit-Change-Number: 30909
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Attention: pespin 
Gerrit-Attention: dexter 
Gerrit-Comment-Date: Thu, 12 Jan 2023 10:20:01 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-sgsn[master]: Split gprs_sgsn.{c,h} -> {auth,mmctx,sgsn}.{c,h}

2023-01-12 Thread daniel
Attention is currently required from: laforge, pespin, lynxis lazus.
daniel has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/30904 )

Change subject: Split gprs_sgsn.{c,h} -> {auth,mmctx,sgsn}.{c,h}
..


Patch Set 5: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30904
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I048a082851c1275c959649942904205b02acce2a
Gerrit-Change-Number: 30904
Gerrit-PatchSet: 5
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: laforge 
Gerrit-CC: lynxis lazus 
Gerrit-Attention: laforge 
Gerrit-Attention: pespin 
Gerrit-Attention: lynxis lazus 
Gerrit-Comment-Date: Thu, 12 Jan 2023 10:20:28 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: Rename TC_tx_power_start_ramp_down_bcch

2023-01-12 Thread daniel
Attention is currently required from: fixeria.
Hello Jenkins Builder, laforge, pespin, fixeria,

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

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30690

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

Change subject: Rename TC_tx_power_start_ramp_down_bcch
..

Rename TC_tx_power_start_ramp_down_bcch

Ramping down power if the oml link is lost was removed in osmo-bts.
Instead TC_tx_power_down_bcch checks that the rx power received is not
> 0 after dropping the oml link.

Change-Id: I463679d9678b95b7d3a5ace711c6ce17b3b24689
Depends: Ida1d7bbf094958b9142af306dbf84206729a609e (osmo-bts.git)
Related: SYS#6237
---
M bts/BTS_Tests.ttcn
M bts/expected-results.xml
2 files changed, 47 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks 
refs/changes/90/30690/4
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30690
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: I463679d9678b95b7d3a5ace711c6ce17b3b24689
Gerrit-Change-Number: 30690
Gerrit-PatchSet: 4
Gerrit-Owner: daniel 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: fixeria 
Gerrit-MessageType: newpatchset


Change in osmo-ttcn3-hacks[master]: Rename TC_tx_power_start_ramp_down_bcch

2023-01-12 Thread daniel
Attention is currently required from: fixeria.
daniel has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30690 )

Change subject: Rename TC_tx_power_start_ramp_down_bcch
..


Patch Set 4:

(1 comment)

File bts/BTS_Tests.ttcn:

https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30690/comment/f2f89e63_12e1cde9
PS3, Line 8869: TC_tx_power_start_ramp_down_bcch
> When renaming testcases, don't forget to update the expected-results.xml.
Ack



--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30690
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: I463679d9678b95b7d3a5ace711c6ce17b3b24689
Gerrit-Change-Number: 30690
Gerrit-PatchSet: 4
Gerrit-Owner: daniel 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Thu, 12 Jan 2023 10:46:23 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria 
Gerrit-MessageType: comment


Change in osmocom-bb[master]: layer23: Fix gcc warning sprintf() writing on too short buf

2023-01-12 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/30942 )


Change subject: layer23: Fix gcc warning sprintf() writing on too short buf
..

layer23: Fix gcc warning sprintf() writing on too short buf

Triggered with gcc 12.2.0:
/osmocom-bb/src/host/layer23/src/common/sysinfo.c: In function 
‘gsm48_sysinfo_dump’:
/osmocom-bb/src/host/layer23/src/common/sysinfo.c:198:42: warning: ‘sprintf’ 
may write a terminating nul past the end of the destination [-Wformat-overflow=]
  198 | sprintf(buffer + 69, " %d", i + 63);
  |  ^
/osmocom-bb/src/host/layer23/src/common/sysinfo.c:198:17: note: ‘sprintf’ 
output between 3 and 13 bytes into a destination of size 12
  198 | sprintf(buffer + 69, " %d", i + 63);
  | ^~~

Change-Id: I29a64fbb7aca0d1b469b6d278d4a24ddc6f57b3a
---
M src/host/layer23/src/common/sysinfo.c
1 file changed, 3 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/42/30942/1

diff --git a/src/host/layer23/src/common/sysinfo.c 
b/src/host/layer23/src/common/sysinfo.c
index 392cdc3..be4e84b 100644
--- a/src/host/layer23/src/common/sysinfo.c
+++ b/src/host/layer23/src/common/sysinfo.c
@@ -68,7 +68,7 @@
   void (*print)(void *, const char *, ...),
   void *priv, uint8_t *freq_map)
 {
-   char buffer[81];
+   char buffer[82];
int i, j, k, index;
int refer_pcs = gsm_refer_pcs(arfcn, s);

@@ -173,7 +173,7 @@

/* frequency map */
for (i = 0; i < 1024; i += 64) {
-   sprintf(buffer, " %3d ", i);
+   snprintf(buffer, sizeof(buffer), " %3d ", i);
for (j = 0; j < 64; j++) {
index = i+j;
if (refer_pcs && index >= 512 && index <= 885)
@@ -195,7 +195,7 @@
}
for (; j < 64; j++)
buffer[j + 5] = ' ';
-   sprintf(buffer + 69, " %d", i + 63);
+   snprintf(buffer + 69, sizeof(buffer) - 69, " %d", i + 63);
print(priv, "%s\n", buffer);
}
print(priv, " 'S' = serv. cell  'n' = SI2 (neigh.)  'r' = SI5 (rep.)  "

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I29a64fbb7aca0d1b469b6d278d4a24ddc6f57b3a
Gerrit-Change-Number: 30942
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-MessageType: newchange


Change in osmocom-bb[master]: layer23: Introduce l23_app_start() API step

2023-01-12 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/30943 )


Change subject: layer23: Introduce l23_app_start() API step
..

layer23: Introduce l23_app_start() API step

This commit is a preparation towards having shared VTY infrastructure
for layer23 apps. Having 2 steps (first init(), then start()) allows
the apps easily struct allocation & initialization, and then start doing
work after VTY config has been read.

Change-Id: I1d232809764962f82fee86159bc61cdbc3eb3c48
---
M src/host/layer23/include/osmocom/bb/common/l23_app.h
M src/host/layer23/src/common/main.c
2 files changed, 23 insertions(+), 12 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/43/30943/1

diff --git a/src/host/layer23/include/osmocom/bb/common/l23_app.h 
b/src/host/layer23/include/osmocom/bb/common/l23_app.h
index 0b9994c..fb71164 100644
--- a/src/host/layer23/include/osmocom/bb/common/l23_app.h
+++ b/src/host/layer23/include/osmocom/bb/common/l23_app.h
@@ -13,9 +13,13 @@
L23_OPT_VTYIP   = 32,
 };

-/* initialization, called once when starting the app, before entering
- * select loop */
+/* initialization, called once when starting the app, before reading VTY 
config */
 extern int l23_app_init(struct osmocom_ms *ms);
+
+/* Start work after reading VTY config and starting layer23 components,
+ *immediatelly before entering main select loop */
+extern int l23_app_start(struct osmocom_ms *ms);
+
 extern int (*l23_app_work) (struct osmocom_ms *ms);
 extern int (*l23_app_exit) (struct osmocom_ms *ms);

diff --git a/src/host/layer23/src/common/main.c 
b/src/host/layer23/src/common/main.c
index f714010..48bdfec 100644
--- a/src/host/layer23/src/common/main.c
+++ b/src/host/layer23/src/common/main.c
@@ -249,15 +249,6 @@

ms->name = talloc_strdup(ms, "1");
ms->test_arfcn = 871;
-
-   handle_options(argc, argv);
-
-   rc = layer2_open(ms, layer2_socket_path);
-   if (rc < 0) {
-   fprintf(stderr, "Failed during layer2_open()\n");
-   exit(1);
-   }
-
ms->lapdm_channel.lapdm_dcch.l1_ctx = ms;
ms->lapdm_channel.lapdm_dcch.l3_ctx = ms;
ms->lapdm_channel.lapdm_acch.l1_ctx = ms;
@@ -265,9 +256,19 @@
lapdm_channel_init(&ms->lapdm_channel, LAPDM_MODE_MS);
lapdm_channel_set_l1(&ms->lapdm_channel, l1ctl_ph_prim_cb, ms);

+   handle_options(argc, argv);
+
rc = l23_app_init(ms);
-   if (rc < 0)
+   if (rc < 0) {
+   fprintf(stderr, "Failed during l23_app_init()\n");
exit(1);
+   }
+
+   rc = layer2_open(ms, layer2_socket_path);
+   if (rc < 0) {
+   fprintf(stderr, "Failed during layer2_open()\n");
+   exit(1);
+   }

if (gsmtap_ip) {
gsmtap_inst = gsmtap_source_init(gsmtap_ip, GSMTAP_UDP_PORT, 1);
@@ -278,6 +279,12 @@
gsmtap_source_add_sink(gsmtap_inst);
}

+   rc = l23_app_start(ms);
+   if (rc < 0) {
+   fprintf(stderr, "Failed during l23_app_start()\n");
+   exit(1);
+   }
+
signal(SIGINT, sighandler);
signal(SIGHUP, sighandler);
signal(SIGTERM, sighandler);

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I1d232809764962f82fee86159bc61cdbc3eb3c48
Gerrit-Change-Number: 30943
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-MessageType: newchange


Change in osmocom-bb[master]: layer23: Fix gcc warning sprintf() writing on too short buf

2023-01-12 Thread laforge
Attention is currently required from: pespin.
laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/30942 )

Change subject: layer23: Fix gcc warning sprintf() writing on too short buf
..


Patch Set 1: Code-Review+1


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I29a64fbb7aca0d1b469b6d278d4a24ddc6f57b3a
Gerrit-Change-Number: 30942
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Thu, 12 Jan 2023 11:39:05 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmocom-bb[master]: layer23: Introduce l23_app_start() API step

2023-01-12 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/30943 )

Change subject: layer23: Introduce l23_app_start() API step
..


Patch Set 2:

This change is ready for review.


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I1d232809764962f82fee86159bc61cdbc3eb3c48
Gerrit-Change-Number: 30943
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Thu, 12 Jan 2023 11:57:57 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmocom-bb[master]: cosmetic: layer23: Drop unnecessary space before function pointer arg...

2023-01-12 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/30944 )


Change subject: cosmetic: layer23: Drop unnecessary space before function 
pointer arguments
..

cosmetic: layer23: Drop unnecessary space before function pointer arguments

As requested by linter.

Change-Id: I87e1857722b9181d0187bdeabe3fa1f4e63463d0
---
M src/host/layer23/include/osmocom/bb/common/l23_app.h
M src/host/layer23/src/common/main.c
2 files changed, 4 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/44/30944/1

diff --git a/src/host/layer23/include/osmocom/bb/common/l23_app.h 
b/src/host/layer23/include/osmocom/bb/common/l23_app.h
index 0b9994c..d5f0fd3 100644
--- a/src/host/layer23/include/osmocom/bb/common/l23_app.h
+++ b/src/host/layer23/include/osmocom/bb/common/l23_app.h
@@ -16,8 +16,8 @@
 /* initialization, called once when starting the app, before entering
  * select loop */
 extern int l23_app_init(struct osmocom_ms *ms);
-extern int (*l23_app_work) (struct osmocom_ms *ms);
-extern int (*l23_app_exit) (struct osmocom_ms *ms);
+extern int (*l23_app_work)(struct osmocom_ms *ms);
+extern int (*l23_app_exit)(struct osmocom_ms *ms);

 /* configuration options */
 struct l23_app_info {
diff --git a/src/host/layer23/src/common/main.c 
b/src/host/layer23/src/common/main.c
index f714010..6841313 100644
--- a/src/host/layer23/src/common/main.c
+++ b/src/host/layer23/src/common/main.c
@@ -54,8 +54,8 @@
 static char *vty_ip = "127.0.0.1";

 unsigned short vty_port = 4247;
-int (*l23_app_work) (struct osmocom_ms *ms) = NULL;
-int (*l23_app_exit) (struct osmocom_ms *ms) = NULL;
+int (*l23_app_work)(struct osmocom_ms *ms) = NULL;
+int (*l23_app_exit)(struct osmocom_ms *ms) = NULL;
 int quit = 0;
 struct gsmtap_inst *gsmtap_inst;


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I87e1857722b9181d0187bdeabe3fa1f4e63463d0
Gerrit-Change-Number: 30944
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-MessageType: newchange


Change in osmocom-bb[master]: layer23: Introduce l23_app_start() API step

2023-01-12 Thread pespin
Attention is currently required from: pespin.
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/c/osmocom-bb/+/30943

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

Change subject: layer23: Introduce l23_app_start() API step
..

layer23: Introduce l23_app_start() API step

This commit is a preparation towards having shared VTY infrastructure
for layer23 apps. Having 2 steps (first init(), then start()) allows
the apps easily struct allocation & initialization, and then start doing
work after VTY config has been read.

Change-Id: I1d232809764962f82fee86159bc61cdbc3eb3c48
---
M src/host/layer23/include/osmocom/bb/common/l23_app.h
M src/host/layer23/src/common/main.c
M src/host/layer23/src/misc/app_bcch_scan.c
M src/host/layer23/src/misc/app_cbch_sniff.c
M src/host/layer23/src/misc/app_ccch_scan.c
M src/host/layer23/src/misc/app_cell_log.c
M src/host/layer23/src/modem/app_modem.c
7 files changed, 66 insertions(+), 24 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/43/30943/3
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/30943
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I1d232809764962f82fee86159bc61cdbc3eb3c48
Gerrit-Change-Number: 30943
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Attention: pespin 
Gerrit-MessageType: newpatchset


Change in libosmocore[master]: gsm0408_test: add unittest for gsm_gsmtime2fn()

2023-01-12 Thread dexter
dexter has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmocore/+/30945 )


Change subject: gsm0408_test: add unittest for gsm_gsmtime2fn()
..

gsm0408_test: add unittest for gsm_gsmtime2fn()

The function gsm_gsmtime2fn(), which is used to compute a frame number
value from given starting time values T1, T2 and T3 has no unit test.
Due to to the modulo that is used the computation can be a bit tricky.
Lets add a unit-test to make sure the function works as expected.

Change-Id: I8b9b71c8dcccf3b44326b5e61229f4637689d763
---
M tests/gsm0408/gsm0408_test.c
1 file changed, 22 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/45/30945/1

diff --git a/tests/gsm0408/gsm0408_test.c b/tests/gsm0408/gsm0408_test.c
index a226718..4436d51 100644
--- a/tests/gsm0408/gsm0408_test.c
+++ b/tests/gsm0408/gsm0408_test.c
@@ -1760,6 +1760,27 @@
}
 }

+static void test_gsm_gsmtime2fn(void)
+{
+   struct gsm_time gsm_time;
+   uint32_t fn;
+   uint32_t fn_recovered;
+
+   for (fn = 0; fn < 42432; fn++) {
+   gsm_time.t1 = (fn / 1326) % 32;
+   gsm_time.t2 = fn % 26;
+   gsm_time.t3 = fn % 51;
+
+   fn_recovered = gsm_gsmtime2fn(&gsm_time);
+
+   if (fn_recovered != fn) {
+   printf(" Wrong frame number computed! t1=%d, t2=%d, 
t3=%d ==> fn=%d, expected fn=%d\n",
+  gsm_time.t1, gsm_time.t2, gsm_time.t3, 
fn_recovered, fn);
+   OSMO_ASSERT(false);
+   }
+   }
+}
+
 int main(int argc, char **argv)
 {
test_bearer_cap();
@@ -1779,6 +1800,7 @@
test_range_encoding();
test_power_ctrl();
test_rach_tx_integer_raw2val();
+   test_gsm_gsmtime2fn();

return EXIT_SUCCESS;
 }

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

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


Change in libosmocore[master]: gsm_utils: improve gsm_gsmtime2fn()

2023-01-12 Thread dexter
Attention is currently required from: laforge, fixeria.
Hello Jenkins Builder, laforge, fixeria,

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

https://gerrit.osmocom.org/c/libosmocore/+/30946

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

Change subject: gsm_utils: improve gsm_gsmtime2fn()
..

gsm_utils: improve gsm_gsmtime2fn()

The function gsm_gsmtime2fn() uses a hack to account for the truncated
modulo implementation of C/C++. libosmocore offers proven modulo
functions, so lets use OSMO_MOD_FLR() instead. Also arange the formula
so that it looks more like the one in the spec.

Also add better spec references and a final modulo GSM_MAX_FN to
prevent frame number results that exceed the valid range.

Change-Id: Ibf94bca8223f1f7858a6dd67bf27de0ab6feab20
---
M src/gsm/gsm_utils.c
1 file changed, 13 insertions(+), 2 deletions(-)


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ibf94bca8223f1f7858a6dd67bf27de0ab6feab20
Gerrit-Change-Number: 30946
Gerrit-PatchSet: 2
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Attention: laforge 
Gerrit-Attention: fixeria 
Gerrit-MessageType: newpatchset


Change in libosmocore[master]: gsm0408_test: add unittest for gsm_gsmtime2fn()

2023-01-12 Thread dexter
Attention is currently required from: laforge, fixeria.
Hello Jenkins Builder, laforge, fixeria,

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

https://gerrit.osmocom.org/c/libosmocore/+/30945

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

Change subject: gsm0408_test: add unittest for gsm_gsmtime2fn()
..

gsm0408_test: add unittest for gsm_gsmtime2fn()

The function gsm_gsmtime2fn(), which is used to compute a frame number
value from given starting time values T1, T2 and T3 has no unit test.
Due to to the modulo that is used the computation can be a bit tricky.
Lets add a unit-test to make sure the function works as expected.

Change-Id: I8b9b71c8dcccf3b44326b5e61229f4637689d763
---
M tests/gsm0408/gsm0408_test.c
1 file changed, 22 insertions(+), 0 deletions(-)


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I8b9b71c8dcccf3b44326b5e61229f4637689d763
Gerrit-Change-Number: 30945
Gerrit-PatchSet: 2
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Attention: laforge 
Gerrit-Attention: fixeria 
Gerrit-MessageType: newpatchset


Change in libosmocore[master]: gsm_utils: improve gsm_gsmtime2fn()

2023-01-12 Thread pespin
Attention is currently required from: laforge, fixeria, dexter.
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/30946 )

Change subject: gsm_utils: improve gsm_gsmtime2fn()
..


Patch Set 2: Code-Review+1

(1 comment)

Commit Message:

https://gerrit.osmocom.org/c/libosmocore/+/30946/comment/90da0658_124e9d4f
PS2, Line 11: functions, so lets use OSMO_MOD_FLR() instead. Also arange the 
formula
arrange



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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ibf94bca8223f1f7858a6dd67bf27de0ab6feab20
Gerrit-Change-Number: 30946
Gerrit-PatchSet: 2
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: laforge 
Gerrit-Attention: fixeria 
Gerrit-Attention: dexter 
Gerrit-Comment-Date: Thu, 12 Jan 2023 12:18:15 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmocore[master]: gsm0408_test: add unittest for gsm_gsmtime2fn()

2023-01-12 Thread pespin
Attention is currently required from: laforge, fixeria, dexter.
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/30945 )

Change subject: gsm0408_test: add unittest for gsm_gsmtime2fn()
..


Patch Set 2: Code-Review+1


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I8b9b71c8dcccf3b44326b5e61229f4637689d763
Gerrit-Change-Number: 30945
Gerrit-PatchSet: 2
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: laforge 
Gerrit-Attention: fixeria 
Gerrit-Attention: dexter 
Gerrit-Comment-Date: Thu, 12 Jan 2023 12:18:38 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmocom-bb[master]: layer23: Fix gcc warning sprintf() writing on too short buf

2023-01-12 Thread fixeria
Attention is currently required from: pespin.
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/30942 )

Change subject: layer23: Fix gcc warning sprintf() writing on too short buf
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I29a64fbb7aca0d1b469b6d278d4a24ddc6f57b3a
Gerrit-Change-Number: 30942
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Thu, 12 Jan 2023 12:31:50 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmocom-bb[master]: cosmetic: layer23: Drop unnecessary space before function pointer arg...

2023-01-12 Thread fixeria
Attention is currently required from: pespin.
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/30944 )

Change subject: cosmetic: layer23: Drop unnecessary space before function 
pointer arguments
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I87e1857722b9181d0187bdeabe3fa1f4e63463d0
Gerrit-Change-Number: 30944
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Thu, 12 Jan 2023 12:32:05 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bsc[master]: abis_rsl: fix frame number calculation

2023-01-12 Thread dexter
Attention is currently required from: laforge, fixeria.
dexter has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/30922 )

Change subject: abis_rsl: fix frame number calculation
..


Patch Set 2:

This change is ready for review.


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I5fb2b0ada8d409730ac22963741fb4ab0026abdd
Gerrit-Change-Number: 30922
Gerrit-PatchSet: 2
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Attention: laforge 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Thu, 12 Jan 2023 12:54:34 +
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-bsc[master]: abis_rsl: fix frame number calculation

2023-01-12 Thread dexter
Attention is currently required from: laforge, fixeria.
Hello Jenkins Builder, laforge, fixeria,

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

https://gerrit.osmocom.org/c/osmo-bsc/+/30922

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

Change subject: abis_rsl: fix frame number calculation
..

abis_rsl: fix frame number calculation

The formula that is used to recover the (relative) frame number from the
T1, T2, T3 parameters matches the definition in the spec, but since the
partial term t3-t2 can be negative special precaution is required when
performing the MOD 26 operation.  This is due to the truncated modulo
implementation in C/C++, which has a very specific understanding on how
to deal with negative input parameters.

The libosmocore gsm_gsmtime2fn(() offers a correct implementation, so
lets use it.

Change-Id: I5fb2b0ada8d409730ac22963741fb4ab0026abdd
Related: OS#5198
---
M src/osmo-bsc/abis_rsl.c
1 file changed, 7 insertions(+), 7 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/22/30922/3
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/30922
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I5fb2b0ada8d409730ac22963741fb4ab0026abdd
Gerrit-Change-Number: 30922
Gerrit-PatchSet: 3
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Attention: laforge 
Gerrit-Attention: fixeria 
Gerrit-MessageType: newpatchset


Change in osmocom-bb[master]: modem: request an Uplink TBF, match Immediate Assignment

2023-01-12 Thread fixeria
fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/30948 )


Change subject: modem: request an Uplink TBF, match Immediate Assignment
..

modem: request an Uplink TBF, match Immediate Assignment

Change-Id: Iec0dcc629d29dec270649cf7428f71af0dfd2dbb
Related: SYS#5500
---
M src/host/layer23/src/modem/app_modem.c
1 file changed, 99 insertions(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/48/30948/1

diff --git a/src/host/layer23/src/modem/app_modem.c 
b/src/host/layer23/src/modem/app_modem.c
index c135ff3..4ad02a3 100644
--- a/src/host/layer23/src/modem/app_modem.c
+++ b/src/host/layer23/src/modem/app_modem.c
@@ -45,8 +45,30 @@
 static struct {
enum ccch_mode ccch_mode;
struct gsm48_sysinfo si;
+
+   /* TODO: use mobile->rrlayer API instead */
+   struct {
+   bool ref_valid;
+   struct gsm48_req_ref ref;
+   } chan_req;
 } app_data;

+/* Generate a 8-bit CHANNEL REQUEST message as per 3GPP TS 44.018, 9.1.8 */
+static uint8_t gen_chan_req(bool single_block)
+{
+   uint8_t rnd = (uint8_t)rand();
+
+   if (single_block) {
+   /* 01110xxx */
+   return 0x70 | (rnd & 0x07);
+   } else {
+   /* 00xx or 0x0x or 0xx0 */
+   if ((rnd & 0x07) == 0x07)
+   return 0x78;
+   return 0x78 | (rnd & 0x07);
+   }
+}
+
 static int handle_si1(struct osmocom_ms *ms, struct msgb *msg)
 {
int rc;
@@ -127,6 +149,7 @@

 static int handle_si13(struct osmocom_ms *ms, struct msgb *msg)
 {
+   struct gsm48_rrlayer *rr = &ms->rrlayer;
int rc;

if (msgb_l3len(msg) != GSM_MACBLOCK_LEN)
@@ -138,6 +161,22 @@
if (rc != 0)
return rc;

+#if 1
+   /* HACK: request an Uplink TBF here (one phase access) */
+   if (rr->state == GSM48_RR_ST_IDLE) {
+   if (!app_data.si.si1)
+   return 0;
+   if (!app_data.si.gprs.supported)
+   return 0;
+
+   rr->cr_ra = gen_chan_req(false);
+   LOGP(DRR, LOGL_NOTICE, "Sending CHANNEL REQUEST (0x%02x)\n", 
rr->cr_ra);
+   l1ctl_tx_rach_req(ms, RSL_CHAN_RACH, 0x00, rr->cr_ra, 0,
+ app_data.ccch_mode == CCCH_MODE_COMBINED);
+   rr->state = GSM48_RR_ST_CONN_PEND;
+   }
+#endif
+
return 0;
 }

@@ -166,6 +205,7 @@
 static int modem_rx_imm_ass(struct osmocom_ms *ms, struct msgb *msg)
 {
const struct gsm48_imm_ass *ia = msgb_l3(msg);
+   struct gsm48_rrlayer *rr = &ms->rrlayer;
uint8_t ch_type, ch_subch, ch_ts;
int rc;

@@ -173,6 +213,13 @@
if ((ia->page_mode >> 4) == 0)
return 0;

+   if (rr->state != GSM48_RR_ST_CONN_PEND)
+   return 0;
+   if (!app_data.chan_req.ref_valid)
+   return 0;
+   if (memcmp(&ia->req_ref, &app_data.chan_req.ref, sizeof(ia->req_ref)))
+   return 0;
+
if (rsl_dec_chan_nr(ia->chan_desc.chan_nr, &ch_type, &ch_subch, &ch_ts) 
!= 0) {
LOGP(DRR, LOGL_ERROR,
 "%s(): rsl_dec_chan_nr(chan_nr=0x%02x) failed\n",
@@ -190,9 +237,13 @@
 "ARFCN=%u, TS=%u, SS=%u, TSC=%u)\n", ia->req_ref.ra,
 ia->chan_desc.chan_nr, arfcn, ch_ts, ch_subch,
 ia->chan_desc.h0.tsc);
+
+   l1ctl_tx_dm_est_req_h0(ms, arfcn, RSL_CHAN_OSMO_PDCH,
+  ia->chan_desc.h0.tsc, GSM48_CMODE_SIGN, 
0);
} else {
/* Hopping */
-   uint8_t maio, hsn;
+   uint8_t maio, hsn, ma_len;
+   uint16_t ma[64];

hsn = ia->chan_desc.h1.hsn;
maio = ia->chan_desc.h1.maio_low | (ia->chan_desc.h1.maio_high 
<< 2);
@@ -201,6 +252,22 @@
 "HSN=%u, MAIO=%u, TS=%u, SS=%u, TSC=%u)\n", ia->req_ref.ra,
 ia->chan_desc.chan_nr, hsn, maio, ch_ts, ch_subch,
 ia->chan_desc.h1.tsc);
+
+   for (unsigned int i = 1, j = 0; i <= 1024; i++) {
+   unsigned int arfcn = i & 1023;
+   unsigned int k;
+
+   if (~app_data.si.freq[arfcn].mask & 0x01)
+   continue;
+
+   k = ia->mob_alloc_len - (j >> 3) - 1;
+   if (ia->mob_alloc[k] & (1 << (j & 7)))
+   ma[ma_len++] = arfcn;
+   j++;
+   }
+
+   l1ctl_tx_dm_est_req_h1(ms, maio, hsn, &ma[0], ma_len, 
RSL_CHAN_OSMO_PDCH,
+  ia->chan_desc.h1.tsc, GSM48_CMODE_SIGN, 
0);
}

const uint8_t *data = msgb_l3(msg) + sizeof(*ia) + ia->mob_alloc_len;
@@ -213,6 +280,9 @@
   

Change in osmocom-bb[master]: modem: request an Uplink TBF, match Immediate Assignment

2023-01-12 Thread Jenkins Builder
Jenkins Builder has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/30948 )

Change subject: modem: request an Uplink TBF, match Immediate Assignment
..


Patch Set 1:

(2 comments)

File src/host/layer23/src/modem/app_modem.c:

Robot Comment from checkpatch (run ID jenkins-gerrit-lint-2633):
https://gerrit.osmocom.org/c/osmocom-bb/+/30948/comment/c612aac4_cdf4fd37
PS1, Line 64:   } else {
else is not generally useful after a break or return


Robot Comment from checkpatch (run ID jenkins-gerrit-lint-2633):
https://gerrit.osmocom.org/c/osmocom-bb/+/30948/comment/08528442_c4997a23
PS1, Line 164: #if 1
Consider removing the #if 1 and its #endif



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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Iec0dcc629d29dec270649cf7428f71af0dfd2dbb
Gerrit-Change-Number: 30948
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-CC: Jenkins Builder
Gerrit-Comment-Date: Thu, 12 Jan 2023 13:00:28 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmocom-bb[master]: modem: request an Uplink TBF, match Immediate Assignment

2023-01-12 Thread fixeria
Attention is currently required from: fixeria.
Hello Jenkins Builder,

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

https://gerrit.osmocom.org/c/osmocom-bb/+/30948

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

Change subject: modem: request an Uplink TBF, match Immediate Assignment
..

modem: request an Uplink TBF, match Immediate Assignment

Change-Id: Iec0dcc629d29dec270649cf7428f71af0dfd2dbb
Related: SYS#5500
---
M src/host/layer23/src/modem/app_modem.c
1 file changed, 95 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/48/30948/2
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/30948
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Iec0dcc629d29dec270649cf7428f71af0dfd2dbb
Gerrit-Change-Number: 30948
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Attention: fixeria 
Gerrit-MessageType: newpatchset


Change in osmocom-bb[master]: layer23: Move extern declaration of l23_ctx to l23_app.h

2023-01-12 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/30949 )


Change subject: layer23: Move extern declaration of l23_ctx to l23_app.h
..

layer23: Move extern declaration of l23_ctx to l23_app.h

This way all apps can access it.

Change-Id: I570d31cc4014b54b47b11a3a52791f62c999cad8
---
M src/host/layer23/include/osmocom/bb/common/l23_app.h
M src/host/layer23/src/misc/app_cell_log.c
2 files changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/49/30949/1

diff --git a/src/host/layer23/include/osmocom/bb/common/l23_app.h 
b/src/host/layer23/include/osmocom/bb/common/l23_app.h
index a37e1e0..cb68d43 100644
--- a/src/host/layer23/include/osmocom/bb/common/l23_app.h
+++ b/src/host/layer23/include/osmocom/bb/common/l23_app.h
@@ -13,6 +13,8 @@
L23_OPT_VTYIP   = 32,
 };

+extern void *l23_ctx;
+
 /* initialization, called once when starting the app, before reading VTY 
config */
 extern int l23_app_init(struct osmocom_ms *ms);

diff --git a/src/host/layer23/src/misc/app_cell_log.c 
b/src/host/layer23/src/misc/app_cell_log.c
index f1596c3..43980e9 100644
--- a/src/host/layer23/src/misc/app_cell_log.c
+++ b/src/host/layer23/src/misc/app_cell_log.c
@@ -34,8 +34,6 @@

 #include 

-extern void *l23_ctx;
-
 extern uint16_t basic_band_range[][2];
 extern uint16_t (*band_range)[][2];


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I570d31cc4014b54b47b11a3a52791f62c999cad8
Gerrit-Change-Number: 30949
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-MessageType: newchange


Change in osmocom-bb[master]: layer23: Add VTY supports for l23_apps

2023-01-12 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/30950 )


Change subject: layer23: Add VTY supports for l23_apps
..

layer23: Add VTY supports for l23_apps

Initial VTY "boilerplate" code for modem app is already added in
this commit as a showcase what's needed by an app to have the VTY
config file read and VTY interface initialized.

Change-Id: Ife3a3373e5a9c0c8e5959ac714e140e72d6c363a
---
M src/host/layer23/include/osmocom/bb/common/l23_app.h
M src/host/layer23/src/common/main.c
M src/host/layer23/src/misc/Makefile.am
M src/host/layer23/src/modem/app_modem.c
4 files changed, 71 insertions(+), 22 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/50/30950/1

diff --git a/src/host/layer23/include/osmocom/bb/common/l23_app.h 
b/src/host/layer23/include/osmocom/bb/common/l23_app.h
index cb68d43..633c764 100644
--- a/src/host/layer23/include/osmocom/bb/common/l23_app.h
+++ b/src/host/layer23/include/osmocom/bb/common/l23_app.h
@@ -2,6 +2,7 @@
 #define _L23_APP_H

 struct option;
+struct vty_app_info;

 /* Options supported by the l23 app */
 enum {
@@ -10,7 +11,6 @@
L23_OPT_TAP = 4,
L23_OPT_VTY = 8,
L23_OPT_DBG = 16,
-   L23_OPT_VTYIP   = 32,
 };

 extern void *l23_ctx;
@@ -29,12 +29,14 @@
 struct l23_app_info {
const char *copyright;
const char *contribution;
+   struct vty_app_info *vty_info; /* L23_OPT_VTY */

char *getopt_string;
int (*cfg_supported)();
int (*cfg_print_help)();
int (*cfg_getopt_opt)(struct option **options);
int (*cfg_handle_opt)(int c,const char *optarg);
+   int (*vty_init)(void);
 };

 extern struct l23_app_info *l23_app_info();
diff --git a/src/host/layer23/src/common/main.c 
b/src/host/layer23/src/common/main.c
index dcf557f..28d2406 100644
--- a/src/host/layer23/src/common/main.c
+++ b/src/host/layer23/src/common/main.c
@@ -33,6 +33,10 @@
 #include 
 #include 
 #include 
+#include 
+#include 
+#include 
+#include 
 
 #include 

@@ -51,9 +55,8 @@
 struct llist_head ms_list;
 static struct osmocom_ms *ms = NULL;
 static char *gsmtap_ip = NULL;
-static char *vty_ip = "127.0.0.1";
+static char *config_file = NULL;

-unsigned short vty_port = 4247;
 int (*l23_app_start)(struct osmocom_ms *ms) = NULL;
 int (*l23_app_work)(struct osmocom_ms *ms) = NULL;
 int (*l23_app_exit)(struct osmocom_ms *ms) = NULL;
@@ -97,16 +100,11 @@
printf("  -i --gsmtap-ipThe destination IP used for 
GSMTAP.\n");

if (options & L23_OPT_VTY)
-   printf("  -v --vty-port The VTY port number to telnet "
-   "to. (default %u)\n", vty_port);
+   printf("  -c --config-file  The path to the VTY 
configuration file.");

if (options & L23_OPT_DBG)
printf("  -d --debugChange debug flags.\n");

-   if (options & L23_OPT_VTYIP)
-   printf("  -u --vty-ip   The VTY IP to bind telnet to. "
-   "(default %s)\n", vty_ip);
-
if (app && app->cfg_print_help)
app->cfg_print_help();
 }
@@ -123,14 +121,13 @@
{"sap", 1, 0, 'S'},
{"arfcn", 1, 0, 'a'},
{"gsmtap-ip", 1, 0, 'i'},
-   {"vty-ip", 1, 0, 'u'},
-   {"vty-port", 1, 0, 'v'},
+   {"config-file", 1, 0, 'c'},
{"debug", 1, 0, 'd'},
};


app = l23_app_info();
-   *opt = talloc_asprintf(l23_ctx, "hs:S:a:i:v:d:u:%s",
+   *opt = talloc_asprintf(l23_ctx, "hs:S:a:i:c:d:%s",
   app && app->getopt_string ? app->getopt_string : 
"");

len = ARRAY_SIZE(long_options);
@@ -143,9 +140,8 @@
memcpy(*option + len, app_opp, app_len * sizeof(struct option));
 }

-static void handle_options(int argc, char **argv)
+static void handle_options(int argc, char **argv, struct l23_app_info *app)
 {
-   struct l23_app_info *app = l23_app_info();
struct option *long_options;
char *opt;

@@ -177,11 +173,8 @@
case 'i':
gsmtap_ip = optarg;
break;
-   case 'u':
-   vty_ip = optarg;
-   break;
-   case 'v':
-   vty_port = atoi(optarg);
+   case 'c':
+   config_file = optarg;
break;
case 'd':
log_parse_category_mask(osmo_stderr_target, optarg);
@@ -221,9 +214,17 @@
   app && app->contribution ? app->contribution : "");
 }

+static struct vty_app_info l23_vty_info = {
+   .name = "OsmocomBB",
+   .version = PACKAGE_VERSION,
+   //.go_parent_cb = ms_vty_go_parent,
+};
+
 int main(int argc, char **argv)
 {
int rc;
+   struct l2

Change in osmo-bsc[master]: abis_rsl: fix frame number calculation

2023-01-12 Thread pespin
Attention is currently required from: laforge, fixeria, dexter.
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/30922 )

Change subject: abis_rsl: fix frame number calculation
..


Patch Set 3: Code-Review+1


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I5fb2b0ada8d409730ac22963741fb4ab0026abdd
Gerrit-Change-Number: 30922
Gerrit-PatchSet: 3
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: laforge 
Gerrit-Attention: fixeria 
Gerrit-Attention: dexter 
Gerrit-Comment-Date: Thu, 12 Jan 2023 13:09:15 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bsc[master]: abis_rsl: fix sourcecode formatting

2023-01-12 Thread pespin
Attention is currently required from: dexter.
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/30947 )

Change subject: abis_rsl: fix sourcecode formatting
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I6c4b6bd86c081046e34f51625c86015fc58c55c2
Gerrit-Change-Number: 30947
Gerrit-PatchSet: 1
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Attention: dexter 
Gerrit-Comment-Date: Thu, 12 Jan 2023 13:09:29 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmocom-bb[master]: modem: request an Uplink TBF, match Immediate Assignment

2023-01-12 Thread pespin
Attention is currently required from: fixeria.
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/30948 )

Change subject: modem: request an Uplink TBF, match Immediate Assignment
..


Patch Set 2: Code-Review+2


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Iec0dcc629d29dec270649cf7428f71af0dfd2dbb
Gerrit-Change-Number: 30948
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Thu, 12 Jan 2023 13:09:54 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-bsc[master]: abis_rsl: fix frame number calculation

2023-01-12 Thread fixeria
Attention is currently required from: laforge, dexter.
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/30922 )

Change subject: abis_rsl: fix frame number calculation
..


Patch Set 3: Code-Review+2


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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I5fb2b0ada8d409730ac22963741fb4ab0026abdd
Gerrit-Change-Number: 30922
Gerrit-PatchSet: 3
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: laforge 
Gerrit-Attention: dexter 
Gerrit-Comment-Date: Thu, 12 Jan 2023 13:10:50 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmocom-bb[master]: modem: request an Uplink TBF, match Immediate Assignment

2023-01-12 Thread fixeria
fixeria has submitted this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/30948 )

Change subject: modem: request an Uplink TBF, match Immediate Assignment
..

modem: request an Uplink TBF, match Immediate Assignment

Change-Id: Iec0dcc629d29dec270649cf7428f71af0dfd2dbb
Related: SYS#5500
---
M src/host/layer23/src/modem/app_modem.c
1 file changed, 95 insertions(+), 1 deletion(-)

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



diff --git a/src/host/layer23/src/modem/app_modem.c 
b/src/host/layer23/src/modem/app_modem.c
index c135ff3..ec267e5 100644
--- a/src/host/layer23/src/modem/app_modem.c
+++ b/src/host/layer23/src/modem/app_modem.c
@@ -45,8 +45,28 @@
 static struct {
enum ccch_mode ccch_mode;
struct gsm48_sysinfo si;
+
+   /* TODO: use mobile->rrlayer API instead */
+   struct {
+   bool ref_valid;
+   struct gsm48_req_ref ref;
+   } chan_req;
 } app_data;

+/* Generate a 8-bit CHANNEL REQUEST message as per 3GPP TS 44.018, 9.1.8 */
+static uint8_t gen_chan_req(bool single_block)
+{
+   uint8_t rnd = (uint8_t)rand();
+
+   if (single_block) /* 01110xxx */
+   return 0x70 | (rnd & 0x07);
+
+   /* 00xx or 0x0x or 0xx0 */
+   if ((rnd & 0x07) == 0x07)
+   return 0x78;
+   return 0x78 | (rnd & 0x07);
+}
+
 static int handle_si1(struct osmocom_ms *ms, struct msgb *msg)
 {
int rc;
@@ -127,6 +147,7 @@

 static int handle_si13(struct osmocom_ms *ms, struct msgb *msg)
 {
+   struct gsm48_rrlayer *rr = &ms->rrlayer;
int rc;

if (msgb_l3len(msg) != GSM_MACBLOCK_LEN)
@@ -138,6 +159,20 @@
if (rc != 0)
return rc;

+   /* HACK: request an Uplink TBF here (one phase access) */
+   if (rr->state == GSM48_RR_ST_IDLE) {
+   if (!app_data.si.si1)
+   return 0;
+   if (!app_data.si.gprs.supported)
+   return 0;
+
+   rr->cr_ra = gen_chan_req(false);
+   LOGP(DRR, LOGL_NOTICE, "Sending CHANNEL REQUEST (0x%02x)\n", 
rr->cr_ra);
+   l1ctl_tx_rach_req(ms, RSL_CHAN_RACH, 0x00, rr->cr_ra, 0,
+ app_data.ccch_mode == CCCH_MODE_COMBINED);
+   rr->state = GSM48_RR_ST_CONN_PEND;
+   }
+
return 0;
 }

@@ -166,6 +201,7 @@
 static int modem_rx_imm_ass(struct osmocom_ms *ms, struct msgb *msg)
 {
const struct gsm48_imm_ass *ia = msgb_l3(msg);
+   struct gsm48_rrlayer *rr = &ms->rrlayer;
uint8_t ch_type, ch_subch, ch_ts;
int rc;

@@ -173,6 +209,13 @@
if ((ia->page_mode >> 4) == 0)
return 0;

+   if (rr->state != GSM48_RR_ST_CONN_PEND)
+   return 0;
+   if (!app_data.chan_req.ref_valid)
+   return 0;
+   if (memcmp(&ia->req_ref, &app_data.chan_req.ref, sizeof(ia->req_ref)))
+   return 0;
+
if (rsl_dec_chan_nr(ia->chan_desc.chan_nr, &ch_type, &ch_subch, &ch_ts) 
!= 0) {
LOGP(DRR, LOGL_ERROR,
 "%s(): rsl_dec_chan_nr(chan_nr=0x%02x) failed\n",
@@ -190,9 +233,13 @@
 "ARFCN=%u, TS=%u, SS=%u, TSC=%u)\n", ia->req_ref.ra,
 ia->chan_desc.chan_nr, arfcn, ch_ts, ch_subch,
 ia->chan_desc.h0.tsc);
+
+   l1ctl_tx_dm_est_req_h0(ms, arfcn, RSL_CHAN_OSMO_PDCH,
+  ia->chan_desc.h0.tsc, GSM48_CMODE_SIGN, 
0);
} else {
/* Hopping */
-   uint8_t maio, hsn;
+   uint8_t maio, hsn, ma_len;
+   uint16_t ma[64];

hsn = ia->chan_desc.h1.hsn;
maio = ia->chan_desc.h1.maio_low | (ia->chan_desc.h1.maio_high 
<< 2);
@@ -201,6 +248,22 @@
 "HSN=%u, MAIO=%u, TS=%u, SS=%u, TSC=%u)\n", ia->req_ref.ra,
 ia->chan_desc.chan_nr, hsn, maio, ch_ts, ch_subch,
 ia->chan_desc.h1.tsc);
+
+   for (unsigned int i = 1, j = 0; i <= 1024; i++) {
+   unsigned int arfcn = i & 1023;
+   unsigned int k;
+
+   if (~app_data.si.freq[arfcn].mask & 0x01)
+   continue;
+
+   k = ia->mob_alloc_len - (j >> 3) - 1;
+   if (ia->mob_alloc[k] & (1 << (j & 7)))
+   ma[ma_len++] = arfcn;
+   j++;
+   }
+
+   l1ctl_tx_dm_est_req_h1(ms, maio, hsn, &ma[0], ma_len, 
RSL_CHAN_OSMO_PDCH,
+  ia->chan_desc.h1.tsc, GSM48_CMODE_SIGN, 
0);
}

const uint8_t *data = msgb_l3(msg) + sizeof(*ia) + ia->mob_alloc_len;
@@ -213,6 +276,9 @@
return rc;
}

+   /* TODO: deliver decoded params to the RLC/MAC layer */
+
+   r

Change in osmo-sgsn[master]: Drop extern declarations of global sgsn_instance in source files

2023-01-12 Thread fixeria
Attention is currently required from: pespin, lynxis lazus.
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/30931 )

Change subject: Drop extern declarations of global sgsn_instance in source files
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30931
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I2375e13c8436a069e8fe60136c8e1759a9adc2d1
Gerrit-Change-Number: 30931
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Attention: pespin 
Gerrit-Attention: lynxis lazus 
Gerrit-Comment-Date: Thu, 12 Jan 2023 13:14:52 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-sgsn[master]: Move sgsn_pdp_ctx to its own file pdpctx.{c,h}

2023-01-12 Thread pespin
Attention is currently required from: lynxis lazus.
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/30891 )

Change subject: Move sgsn_pdp_ctx to its own file pdpctx.{c,h}
..


Patch Set 3: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30891
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: Iad4da06efee7d8514ff48423bdaebc0f26413cc1
Gerrit-Change-Number: 30891
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-CC: lynxis lazus 
Gerrit-Attention: lynxis lazus 
Gerrit-Comment-Date: Thu, 12 Jan 2023 13:15:25 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-sgsn[master]: Move gtphub header to include/osmocom/gtphub/

2023-01-12 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/30899 )

Change subject: Move gtphub header to include/osmocom/gtphub/
..


Patch Set 2: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30899
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I82e1f2a3bc8e22b28747a540879bd661f1704cde
Gerrit-Change-Number: 30899
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Thu, 12 Jan 2023 13:15:31 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-sgsn[master]: Move extern declarations of tall_sgsn_ctx to sgsn.h

2023-01-12 Thread pespin
pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/30930 )

Change subject: Move extern declarations of tall_sgsn_ctx to sgsn.h
..

Move extern declarations of tall_sgsn_ctx to sgsn.h

Change-Id: Ifbd54b2e92db8d4a0e0cd1c569cfd83dd85165b8
---
M include/osmocom/sgsn/sgsn.h
M src/gprs/sgsn_ares.c
M src/sgsn/apn.c
M src/sgsn/gprs_gmm.c
M src/sgsn/gprs_sgsn.c
M src/sgsn/gprs_sm.c
M src/sgsn/gprs_subscriber.c
M src/sgsn/gtp_mme.c
M src/sgsn/sgsn_vty.c
9 files changed, 1 insertion(+), 14 deletions(-)

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



diff --git a/include/osmocom/sgsn/sgsn.h b/include/osmocom/sgsn/sgsn.h
index 0bc88a9..4326846 100644
--- a/include/osmocom/sgsn/sgsn.h
+++ b/include/osmocom/sgsn/sgsn.h
@@ -159,6 +159,7 @@
 };

 extern struct sgsn_instance *sgsn;
+extern void *tall_sgsn_ctx;

 /* sgsn_vty.c */

diff --git a/src/gprs/sgsn_ares.c b/src/gprs/sgsn_ares.c
index 87314f1..81ab835 100644
--- a/src/gprs/sgsn_ares.c
+++ b/src/gprs/sgsn_ares.c
@@ -24,8 +24,6 @@

 #include 

-extern void *tall_sgsn_ctx;
-
 struct cares_event_fd {
struct llist_head head;
struct osmo_fd fd;
diff --git a/src/sgsn/apn.c b/src/sgsn/apn.c
index 8ed523e..a89d158 100644
--- a/src/sgsn/apn.c
+++ b/src/sgsn/apn.c
@@ -27,8 +27,6 @@
 #include 
 #include 

-extern void *tall_sgsn_ctx;
-
 static struct apn_ctx *sgsn_apn_ctx_alloc(const char *ap_name, const char 
*imsi_prefix)
 {
struct apn_ctx *actx;
diff --git a/src/sgsn/gprs_gmm.c b/src/sgsn/gprs_gmm.c
index b385ff1..5505ba9 100644
--- a/src/sgsn/gprs_gmm.c
+++ b/src/sgsn/gprs_gmm.c
@@ -68,7 +68,6 @@
 #define PTMSI_ALLOC

 extern struct sgsn_instance *sgsn;
-extern void *tall_sgsn_ctx;

 static const struct tlv_definition gsm48_gmm_att_tlvdef = {
.def = {
diff --git a/src/sgsn/gprs_sgsn.c b/src/sgsn/gprs_sgsn.c
index 8c2734b..9a3e983 100644
--- a/src/sgsn/gprs_sgsn.c
+++ b/src/sgsn/gprs_sgsn.c
@@ -62,7 +62,6 @@
 #define GPRS_LLME_CHECK_TICK 30

 extern struct sgsn_instance *sgsn;
-extern void *tall_sgsn_ctx;
 extern struct osmo_tdef sgsn_T_defs[];

 LLIST_HEAD(sgsn_mm_ctxts);
diff --git a/src/sgsn/gprs_sm.c b/src/sgsn/gprs_sm.c
index 184350d..3177a70 100644
--- a/src/sgsn/gprs_sm.c
+++ b/src/sgsn/gprs_sm.c
@@ -44,8 +44,6 @@
 #include 
 #include 

-extern void *tall_sgsn_ctx;
-
 /* 3GPP TS 04.08 sec 6.1.3.4.3(.a) "Abnormal cases" */
 #define T339X_MAX_RETRANS 4

diff --git a/src/sgsn/gprs_subscriber.c b/src/sgsn/gprs_subscriber.c
index 943fbc3..416e6a4 100644
--- a/src/sgsn/gprs_subscriber.c
+++ b/src/sgsn/gprs_subscriber.c
@@ -48,8 +48,6 @@
 (gsup)->imsi, \
 ## args)

-extern void *tall_sgsn_ctx;
-
 LLIST_HEAD(_gprs_subscribers);
 struct llist_head * const gprs_subscribers = &_gprs_subscribers;

diff --git a/src/sgsn/gtp_mme.c b/src/sgsn/gtp_mme.c
index 948e8e8..b96c90d 100644
--- a/src/sgsn/gtp_mme.c
+++ b/src/sgsn/gtp_mme.c
@@ -26,8 +26,6 @@
 #include 
 #include 

-extern void *tall_sgsn_ctx;
-
 static bool _eutran_tai_equal(const struct osmo_eutran_tai *t1, const struct 
osmo_eutran_tai *t2)
 {
return  t1->mcc == t2->mcc &&
diff --git a/src/sgsn/sgsn_vty.c b/src/sgsn/sgsn_vty.c
index 3d3e8cd..2313a9a 100644
--- a/src/sgsn/sgsn_vty.c
+++ b/src/sgsn/sgsn_vty.c
@@ -63,8 +63,6 @@
 #include 
 #endif

-extern void *tall_sgsn_ctx;
-
 static struct sgsn_config *g_cfg = NULL;

 const struct value_string sgsn_auth_pol_strs[] = {

--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30930
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: Ifbd54b2e92db8d4a0e0cd1c569cfd83dd85165b8
Gerrit-Change-Number: 30930
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-sgsn[master]: Drop extern declarations of global sgsn_instance in source files

2023-01-12 Thread pespin
pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/30931 )

Change subject: Drop extern declarations of global sgsn_instance in source files
..

Drop extern declarations of global sgsn_instance in source files

There's an extern declaration already in sgsn.h.

Change-Id: I2375e13c8436a069e8fe60136c8e1759a9adc2d1
---
M src/sgsn/gprs_gmm.c
M src/sgsn/gprs_sgsn.c
M src/sgsn/sgsn_cdr.c
3 files changed, 0 insertions(+), 6 deletions(-)

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



diff --git a/src/sgsn/gprs_gmm.c b/src/sgsn/gprs_gmm.c
index 5505ba9..b12102e 100644
--- a/src/sgsn/gprs_gmm.c
+++ b/src/sgsn/gprs_gmm.c
@@ -67,8 +67,6 @@

 #define PTMSI_ALLOC

-extern struct sgsn_instance *sgsn;
-
 static const struct tlv_definition gsm48_gmm_att_tlvdef = {
.def = {
[GSM48_IE_GMM_CIPH_CKSN]= { TLV_TYPE_FIXED, 1 },
diff --git a/src/sgsn/gprs_sgsn.c b/src/sgsn/gprs_sgsn.c
index 9a3e983..c911b6a 100644
--- a/src/sgsn/gprs_sgsn.c
+++ b/src/sgsn/gprs_sgsn.c
@@ -61,7 +61,6 @@

 #define GPRS_LLME_CHECK_TICK 30

-extern struct sgsn_instance *sgsn;
 extern struct osmo_tdef sgsn_T_defs[];

 LLIST_HEAD(sgsn_mm_ctxts);
diff --git a/src/sgsn/sgsn_cdr.c b/src/sgsn/sgsn_cdr.c
index ac0a6fd..c22a6ac 100644
--- a/src/sgsn/sgsn_cdr.c
+++ b/src/sgsn/sgsn_cdr.c
@@ -39,9 +39,6 @@
 #include 
 #include 

-/* TODO...avoid going through a global */
-extern struct sgsn_instance *sgsn;
-
 /**
  * The CDR module will generate an entry like:
  *

--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30931
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I2375e13c8436a069e8fe60136c8e1759a9adc2d1
Gerrit-Change-Number: 30931
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-sgsn[master]: Move global pdp_list inside struct sgsn_instance

2023-01-12 Thread pespin
pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/30892 )

Change subject: Move global pdp_list inside struct sgsn_instance
..

Move global pdp_list inside struct sgsn_instance

This way pdp contexts are managed by the lifcycle of the main global struct
sgsn_instance automatically.

Change-Id: I725218fd54adcc68dceded5eb43675f25771bb96
---
M include/osmocom/sgsn/pdpctx.h
M include/osmocom/sgsn/sgsn.h
M src/sgsn/gprs_sgsn.c
M src/sgsn/pdpctx.c
M src/sgsn/sgsn_vty.c
5 files changed, 5 insertions(+), 7 deletions(-)

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



diff --git a/include/osmocom/sgsn/pdpctx.h b/include/osmocom/sgsn/pdpctx.h
index 1e982af..255a77d 100644
--- a/include/osmocom/sgsn/pdpctx.h
+++ b/include/osmocom/sgsn/pdpctx.h
@@ -90,7 +90,5 @@
 void sgsn_pdp_ctx_terminate(struct sgsn_pdp_ctx *pdp);
 void sgsn_pdp_ctx_free(struct sgsn_pdp_ctx *pdp);

-extern struct llist_head sgsn_pdp_ctxts;
-
 char *gprs_pdpaddr2str(uint8_t *pdpa, uint8_t len, bool return_ipv6);

diff --git a/include/osmocom/sgsn/sgsn.h b/include/osmocom/sgsn/sgsn.h
index 4326846..a2cfa9c 100644
--- a/include/osmocom/sgsn/sgsn.h
+++ b/include/osmocom/sgsn/sgsn.h
@@ -154,6 +154,7 @@
struct llist_head apn_list; /* list of struct sgsn_apn_ctx */
struct llist_head ggsn_list; /* list of struct sgsn_ggsn_ctx */
struct llist_head mme_list; /* list of struct sgsn_mme_ctx */
+   struct llist_head pdp_list; /* list of struct sgsn_pdp_ctx */

struct ctrl_handle *ctrlh;
 };
diff --git a/src/sgsn/gprs_sgsn.c b/src/sgsn/gprs_sgsn.c
index 9d2ed7d..40efd4a 100644
--- a/src/sgsn/gprs_sgsn.c
+++ b/src/sgsn/gprs_sgsn.c
@@ -704,6 +704,7 @@
INIT_LLIST_HEAD(&inst->apn_list);
INIT_LLIST_HEAD(&inst->ggsn_list);
INIT_LLIST_HEAD(&inst->mme_list);
+   INIT_LLIST_HEAD(&inst->pdp_list);

osmo_timer_setup(&inst->llme_timer, sgsn_llme_check_cb, NULL);
osmo_timer_schedule(&inst->llme_timer, GPRS_LLME_CHECK_TICK, 0);
diff --git a/src/sgsn/pdpctx.c b/src/sgsn/pdpctx.c
index 52b1c0f..77146fc 100644
--- a/src/sgsn/pdpctx.c
+++ b/src/sgsn/pdpctx.c
@@ -39,8 +39,6 @@
 #include 
 #include 

-LLIST_HEAD(sgsn_pdp_ctxts);
-
 static const struct rate_ctr_desc pdpctx_ctr_description[] = {
{ "udata:packets:in",   "User Data  Messages ( In)" },
{ "udata:packets:out",  "User Data  Messages (Out)" },
@@ -67,7 +65,7 @@
if (pdp)
return NULL;

-   pdp = talloc_zero(tall_sgsn_ctx, struct sgsn_pdp_ctx);
+   pdp = talloc_zero(sgsn, struct sgsn_pdp_ctx);
if (!pdp)
return NULL;

@@ -82,7 +80,7 @@
}
llist_add(&pdp->list, &mm->pdp_list);
sgsn_ggsn_ctx_add_pdp(pdp->ggsn, pdp);
-   llist_add(&pdp->g_list, &sgsn_pdp_ctxts);
+   llist_add(&pdp->g_list, &sgsn->pdp_list);

return pdp;
 }
diff --git a/src/sgsn/sgsn_vty.c b/src/sgsn/sgsn_vty.c
index 8e94041..d8ea420 100644
--- a/src/sgsn/sgsn_vty.c
+++ b/src/sgsn/sgsn_vty.c
@@ -723,7 +723,7 @@
 {
struct sgsn_pdp_ctx *pdp;

-   llist_for_each_entry(pdp, &sgsn_pdp_ctxts, g_list)
+   llist_for_each_entry(pdp, &sgsn->pdp_list, g_list)
vty_dump_pdp(vty, "", pdp);

return CMD_SUCCESS;



1 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted 
one.
--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30892
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I725218fd54adcc68dceded5eb43675f25771bb96
Gerrit-Change-Number: 30892
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-sgsn[master]: Move gtphub header to include/osmocom/gtphub/

2023-01-12 Thread pespin
pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/30899 )

Change subject: Move gtphub header to include/osmocom/gtphub/
..

Move gtphub header to include/osmocom/gtphub/

Change-Id: I82e1f2a3bc8e22b28747a540879bd661f1704cde
---
M configure.ac
M debian/copyright
M include/osmocom/Makefile.am
A include/osmocom/gtphub/Makefile.am
R include/osmocom/gtphub/gtphub.h
M include/osmocom/sgsn/Makefile.am
M src/gtphub/gtphub.c
M src/gtphub/gtphub_ares.c
M src/gtphub/gtphub_main.c
M src/gtphub/gtphub_sock.c
M src/gtphub/gtphub_vty.c
M tests/gtphub/gtphub_test.c
12 files changed, 12 insertions(+), 8 deletions(-)

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



diff --git a/configure.ac b/configure.ac
index 64b74e3..2c335d7 100644
--- a/configure.ac
+++ b/configure.ac
@@ -235,6 +235,7 @@
 AC_OUTPUT(
 include/Makefile
 include/osmocom/Makefile
+include/osmocom/gtphub/Makefile
 include/osmocom/sgsn/Makefile
 src/Makefile
 src/gprs/Makefile
diff --git a/debian/copyright b/debian/copyright
index d4e7451..cd8d7e8 100644
--- a/debian/copyright
+++ b/debian/copyright
@@ -74,7 +74,7 @@
include/osmocom/sgsn/gprs_sndcp_pcomp.h
include/osmocom/sgsn/gprs_sndcp_xid.h
include/osmocom/sgsn/gprs_utils.h
-   include/osmocom/sgsn/gtphub.h
+   include/osmocom/gtphub/gtphub.h
include/osmocom/sgsn/signal.h
src/gprs/gprs_llc_parse.c
src/gprs/crc24.c
diff --git a/include/osmocom/Makefile.am b/include/osmocom/Makefile.am
index 09db97a..f5bc76a 100644
--- a/include/osmocom/Makefile.am
+++ b/include/osmocom/Makefile.am
@@ -1,3 +1,4 @@
 SUBDIRS = \
+   gtphub \
sgsn \
$(NULL)
diff --git a/include/osmocom/gtphub/Makefile.am 
b/include/osmocom/gtphub/Makefile.am
new file mode 100644
index 000..c61dad9
--- /dev/null
+++ b/include/osmocom/gtphub/Makefile.am
@@ -0,0 +1,3 @@
+noinst_HEADERS = \
+   gtphub.h \
+   $(NULL)
diff --git a/include/osmocom/sgsn/gtphub.h b/include/osmocom/gtphub/gtphub.h
similarity index 100%
rename from include/osmocom/sgsn/gtphub.h
rename to include/osmocom/gtphub/gtphub.h
diff --git a/include/osmocom/sgsn/Makefile.am b/include/osmocom/sgsn/Makefile.am
index a3bc218..017954d 100644
--- a/include/osmocom/sgsn/Makefile.am
+++ b/include/osmocom/sgsn/Makefile.am
@@ -23,7 +23,6 @@
gprs_subscriber.h \
gprs_utils.h \
gtp.h \
-   gtphub.h \
gtp_ggsn.h \
gtp_mme.h \
pdpctx.h \
diff --git a/src/gtphub/gtphub.c b/src/gtphub/gtphub.c
index 89ca676..2b00f59 100644
--- a/src/gtphub/gtphub.c
+++ b/src/gtphub/gtphub.c
@@ -32,7 +32,7 @@
 #include 
 #include 

-#include 
+#include 
 #include 
 #include 

diff --git a/src/gtphub/gtphub_ares.c b/src/gtphub/gtphub_ares.c
index 87dc860..a2d8a4a 100644
--- a/src/gtphub/gtphub_ares.c
+++ b/src/gtphub/gtphub_ares.c
@@ -28,7 +28,7 @@
 #include 
 #include 

-#include 
+#include 
 #include 

 #include 
diff --git a/src/gtphub/gtphub_main.c b/src/gtphub/gtphub_main.c
index a9a7529..0f389ab 100644
--- a/src/gtphub/gtphub_main.c
+++ b/src/gtphub/gtphub_main.c
@@ -41,7 +41,7 @@
 #include 

 #include 
-#include 
+#include 
 #include 

 #include "../../bscconfig.h"
diff --git a/src/gtphub/gtphub_sock.c b/src/gtphub/gtphub_sock.c
index 1837533..59a0d42 100644
--- a/src/gtphub/gtphub_sock.c
+++ b/src/gtphub/gtphub_sock.c
@@ -25,7 +25,7 @@
  * along with this program.  If not, see .
  */

-#include 
+#include 
 #include 

 /* Convenience makro, note: only within this C file. */
diff --git a/src/gtphub/gtphub_vty.c b/src/gtphub/gtphub_vty.c
index abc08fd..b5f102a 100644
--- a/src/gtphub/gtphub_vty.c
+++ b/src/gtphub/gtphub_vty.c
@@ -31,7 +31,7 @@
 #include 

 #include 
-#include 
+#include 

 /* TODO split GRX ares from sgsn into a separate struct and allow use without
  * globals. */
diff --git a/tests/gtphub/gtphub_test.c b/tests/gtphub/gtphub_test.c
index 13d2636..4f58315 100644
--- a/tests/gtphub/gtphub_test.c
+++ b/tests/gtphub/gtphub_test.c
@@ -30,7 +30,7 @@

 #include 

-#include 
+#include 
 #include 
 #include 




1 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted 
one.
--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30899
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I82e1f2a3bc8e22b28747a540879bd661f1704cde
Gerrit-Change-Number: 30899
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-sgsn[master]: gtp_{ggsn,mme}: Allocate contexts under struct sgsn_instance

2023-01-12 Thread pespin
pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/30890 )

Change subject: gtp_{ggsn,mme}: Allocate contexts under struct sgsn_instance
..

gtp_{ggsn,mme}: Allocate contexts under struct sgsn_instance

This way apns are managed by the lifcycle of the main global struct
sgsn_instance automatically.

Change-Id: Ie65d59632a368c6957c33dca64e856ace792b2c6
---
M include/osmocom/sgsn/gtp_ggsn.h
M src/sgsn/gprs_sgsn.c
M src/sgsn/gprs_sm.c
M src/sgsn/gtp_ggsn.c
M src/sgsn/gtp_mme.c
M src/sgsn/sgsn_libgtp.c
M src/sgsn/sgsn_vty.c
M tests/sgsn/sgsn_test.c
8 files changed, 25 insertions(+), 26 deletions(-)

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



diff --git a/include/osmocom/sgsn/gtp_ggsn.h b/include/osmocom/sgsn/gtp_ggsn.h
index 224fa35..6afb866 100644
--- a/include/osmocom/sgsn/gtp_ggsn.h
+++ b/include/osmocom/sgsn/gtp_ggsn.h
@@ -10,6 +10,7 @@

 struct gsn_t;
 struct sgsn_pdp_ctx;
+struct sgsn_instance;

 struct sgsn_ggsn_ctx {
struct llist_head list;
@@ -22,11 +23,11 @@
struct osmo_timer_list echo_timer;
unsigned int echo_interval;
 };
-struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_alloc(uint32_t id);
+struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_alloc(struct sgsn_instance *sgsn, uint32_t 
id);
 void sgsn_ggsn_ctx_free(struct sgsn_ggsn_ctx *ggc);
-struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_id(uint32_t id);
-struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_addr(struct in_addr *addr);
-struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_find_alloc(uint32_t id);
+struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_id(struct sgsn_instance *sgsn, uint32_t 
id);
+struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_addr(struct sgsn_instance *sgsn, struct 
in_addr *addr);
+struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_find_alloc(struct sgsn_instance *sgsn, 
uint32_t id);
 void sgsn_ggsn_ctx_drop_pdp(struct sgsn_pdp_ctx *pctx);
 int sgsn_ggsn_ctx_drop_all_pdp_except(struct sgsn_ggsn_ctx *ggsn, struct 
sgsn_pdp_ctx *except);
 int sgsn_ggsn_ctx_drop_all_pdp(struct sgsn_ggsn_ctx *ggsn);
diff --git a/src/sgsn/gprs_sgsn.c b/src/sgsn/gprs_sgsn.c
index 42d1ece..8c2734b 100644
--- a/src/sgsn/gprs_sgsn.c
+++ b/src/sgsn/gprs_sgsn.c
@@ -713,11 +713,11 @@
ggsn = apn_ctx->ggsn;
} else if (llist_empty(&sgsn->apn_list)) {
/* No configuration -> use GGSN 0 */
-   ggsn = sgsn_ggsn_ctx_by_id(0);
+   ggsn = sgsn_ggsn_ctx_by_id(sgsn, 0);
} else if (allow_any_apn &&
   (selected_apn_str == NULL || strlen(selected_apn_str) == 0)) 
{
/* No APN given and no default configuration -> Use GGSN 0 */
-   ggsn = sgsn_ggsn_ctx_by_id(0);
+   ggsn = sgsn_ggsn_ctx_by_id(sgsn, 0);
} else {
/* No matching configuration found */
LOGMMCTXP(LOGL_NOTICE, mmctx,
diff --git a/src/sgsn/gprs_sm.c b/src/sgsn/gprs_sm.c
index 157e279..184350d 100644
--- a/src/sgsn/gprs_sm.c
+++ b/src/sgsn/gprs_sm.c
@@ -378,7 +378,7 @@
goto reject_due_failure;
}

-   ggsn = sgsn_ggsn_ctx_alloc(UINT32_MAX);
+   ggsn = sgsn_ggsn_ctx_alloc(sgsn, UINT32_MAX);
if (!ggsn) {
LOGMMCTXP(LOGL_ERROR, lookup->mmctx, "Failed to create 
ggsn.\n");
goto reject_due_failure;
diff --git a/src/sgsn/gtp_ggsn.c b/src/sgsn/gtp_ggsn.c
index be07d13..b43fb25 100644
--- a/src/sgsn/gtp_ggsn.c
+++ b/src/sgsn/gtp_ggsn.c
@@ -35,8 +35,6 @@
 #include 
 #include 

-extern void *tall_sgsn_ctx;
-
 void sgsn_ggsn_ctx_check_echo_timer(struct sgsn_ggsn_ctx *ggc)
 {
bool pending = osmo_timer_pending(&ggc->echo_timer);
@@ -59,11 +57,11 @@
osmo_timer_schedule(&ggc->echo_timer, ggc->echo_interval, 0);
 }

-struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_alloc(uint32_t id)
+struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_alloc(struct sgsn_instance *sgsn, uint32_t 
id)
 {
struct sgsn_ggsn_ctx *ggc;

-   ggc = talloc_zero(tall_sgsn_ctx, struct sgsn_ggsn_ctx);
+   ggc = talloc_zero(sgsn, struct sgsn_ggsn_ctx);
if (!ggc)
return NULL;

@@ -86,7 +84,7 @@
talloc_free(ggc);
 }

-struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_id(uint32_t id)
+struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_id(struct sgsn_instance *sgsn, uint32_t 
id)
 {
struct sgsn_ggsn_ctx *ggc;

@@ -97,7 +95,7 @@
return NULL;
 }

-struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_addr(struct in_addr *addr)
+struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_by_addr(struct sgsn_instance *sgsn, struct 
in_addr *addr)
 {
struct sgsn_ggsn_ctx *ggc;

@@ -109,13 +107,13 @@
 }


-struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_find_alloc(uint32_t id)
+struct sgsn_ggsn_ctx *sgsn_ggsn_ctx_find_alloc(struct sgsn_instance *sgsn, 
uint32_t id)
 {
struct sgsn_ggsn_ctx *ggc;

-   ggc = sgsn_ggsn_ctx_by_id(id);
+   ggc = sgsn_ggsn_ctx_by_id(sgsn, id);
if (!ggc)
-   ggc = sgs

Change in osmo-sgsn[master]: Move sgsn_ctrl_cmds_install() declaration to sgsn.h

2023-01-12 Thread pespin
pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/30900 )

Change subject: Move sgsn_ctrl_cmds_install() declaration to sgsn.h
..

Move sgsn_ctrl_cmds_install() declaration to sgsn.h

sgsn.h is the main header containing all misc app related contents.
This is another step towards shrinking gprs_sgsn.h mess.

Change-Id: I80e3a68e2e368d8c73135c850e4728bdf6cf5f09
---
M include/osmocom/sgsn/gprs_sgsn.h
M include/osmocom/sgsn/sgsn.h
2 files changed, 5 insertions(+), 5 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved
  lynxis lazus: Looks good to me, approved



diff --git a/include/osmocom/sgsn/gprs_sgsn.h b/include/osmocom/sgsn/gprs_sgsn.h
index 3fdf45d..424e16f 100644
--- a/include/osmocom/sgsn/gprs_sgsn.h
+++ b/include/osmocom/sgsn/gprs_sgsn.h
@@ -297,11 +297,6 @@
 uint32_t sgsn_alloc_ptmsi(void);

 /*
- * ctrl interface related work
- */
-int sgsn_ctrl_cmds_install(void);
-
-/*
  * Authorization/ACL handling
  */
 struct imsi_acl_entry {
diff --git a/include/osmocom/sgsn/sgsn.h b/include/osmocom/sgsn/sgsn.h
index a2cfa9c..c92b251 100644
--- a/include/osmocom/sgsn/sgsn.h
+++ b/include/osmocom/sgsn/sgsn.h
@@ -162,6 +162,11 @@
 extern struct sgsn_instance *sgsn;
 extern void *tall_sgsn_ctx;

+/*
+ * ctrl interface related work (sgsn_ctrl.c)
+ */
+int sgsn_ctrl_cmds_install(void);
+
 /* sgsn_vty.c */

 int sgsn_vty_init(struct sgsn_config *cfg);



1 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted 
one.
--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30900
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I80e3a68e2e368d8c73135c850e4728bdf6cf5f09
Gerrit-Change-Number: 30900
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-sgsn[master]: Move sgsn_pdp_ctx to its own file pdpctx.{c,h}

2023-01-12 Thread pespin
pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/30891 )

Change subject: Move sgsn_pdp_ctx to its own file pdpctx.{c,h}
..

Move sgsn_pdp_ctx to its own file pdpctx.{c,h}

This further shrinks the mess in gprs_sgsn.h, and allows to easily see
layer violations (like pdpctx.c requiring llc.h)

Change-Id: Iad4da06efee7d8514ff48423bdaebc0f26413cc1
---
M include/osmocom/sgsn/Makefile.am
M include/osmocom/sgsn/gprs_sgsn.h
A include/osmocom/sgsn/pdpctx.h
M src/sgsn/Makefile.am
M src/sgsn/gprs_gmm.c
M src/sgsn/gprs_mm_state_iu_fsm.c
M src/sgsn/gprs_ranap.c
M src/sgsn/gprs_sgsn.c
M src/sgsn/gprs_sm.c
M src/sgsn/gtp_ggsn.c
A src/sgsn/pdpctx.c
M src/sgsn/sgsn_cdr.c
M src/sgsn/sgsn_ctrl.c
M src/sgsn/sgsn_libgtp.c
M src/sgsn/sgsn_vty.c
M tests/sgsn/Makefile.am
16 files changed, 270 insertions(+), 193 deletions(-)

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



diff --git a/include/osmocom/sgsn/Makefile.am b/include/osmocom/sgsn/Makefile.am
index 4d43c6d..a3bc218 100644
--- a/include/osmocom/sgsn/Makefile.am
+++ b/include/osmocom/sgsn/Makefile.am
@@ -26,6 +26,7 @@
gtphub.h \
gtp_ggsn.h \
gtp_mme.h \
+   pdpctx.h \
sgsn.h \
sgsn_rim.h \
signal.h \
diff --git a/include/osmocom/sgsn/gprs_sgsn.h b/include/osmocom/sgsn/gprs_sgsn.h
index 8aaabfd..3fdf45d 100644
--- a/include/osmocom/sgsn/gprs_sgsn.h
+++ b/include/osmocom/sgsn/gprs_sgsn.h
@@ -23,6 +23,7 @@
 struct ctrl_handle;
 struct gprs_subscr;
 struct sgsn_ggsn_ctx;
+struct sgsn_pdp_ctx;

 enum gsm48_gsm_cause;

@@ -40,13 +41,6 @@
GMM_CTR_RA_UPDATE,
 };

-enum gprs_pdp_ctx {
-   PDP_CTR_PKTS_UDATA_IN,
-   PDP_CTR_PKTS_UDATA_OUT,
-   PDP_CTR_BYTES_UDATA_IN,
-   PDP_CTR_BYTES_UDATA_OUT,
-};
-
 enum gprs_t3350_mode {
GMM_T3350_MODE_NONE,
GMM_T3350_MODE_ATT,
@@ -291,64 +285,6 @@
enum gsm48_gsm_cause *gsm_cause,
char *apn_str);

-enum pdp_ctx_state {
-   PDP_STATE_NONE,
-   PDP_STATE_CR_REQ,
-   PDP_STATE_CR_CONF,
-
-   /* 04.08 / Figure 6.2 / 6.1.2.2 */
-   PDP_STATE_INACT_PEND,
-   PDP_STATE_INACTIVE = PDP_STATE_NONE,
-};
-
-enum pdp_type {
-   PDP_TYPE_NONE,
-   PDP_TYPE_ETSI_PPP,
-   PDP_TYPE_IANA_IPv4,
-   PDP_TYPE_IANA_IPv6,
-};
-
-struct sgsn_pdp_ctx {
-   struct llist_head   list;   /* list_head for mmctx->pdp_list */
-   struct llist_head   g_list; /* list_head for global list */
-   struct sgsn_mm_ctx  *mm;/* back pointer to MM CTX */
-   int destroy_ggsn; /* destroy it on destruction */
-   struct sgsn_ggsn_ctx*ggsn;  /* which GGSN serves this PDP */
-   struct llist_head   ggsn_list;  /* list_head for ggsn->pdp_list 
*/
-   struct rate_ctr_group   *ctrg;
-
-   //unsigned int  id;
-   struct pdp_t*lib;   /* pointer to libgtp PDP ctx */
-   enum pdp_ctx_state  state;
-   enum pdp_type   type;
-   uint32_taddress;
-   char*apn_subscribed;
-   //char  *apn_used;
-   uint16_tnsapi;  /* SNDCP */
-   uint16_tsapi;   /* LLC */
-   uint8_t ti; /* transaction identifier */
-   int vplmn_allowed;
-   uint32_tqos_profile_subscr;
-   //uint32_t  qos_profile_req;
-   //uint32_t  qos_profile_neg;
-   uint8_t radio_prio;
-   //uint32_t  charging_id;
-
-   struct osmo_timer_list  timer;
-   unsigned intT;  /* T number */
-   unsigned intnum_T_exp;  /* number of consecutive T 
expirations */
-
-   struct osmo_timer_list  cdr_timer;  /* CDR record wird timer */
-   struct timespec cdr_start;  /* The start of the CDR */
-   uint64_tcdr_bytes_in;
-   uint64_tcdr_bytes_out;
-   uint32_tcdr_charging_id;
-};
-
-#define LOGPDPCTXP(level, pdp, fmt, args...) \
-   LOGP(DGPRS, level, "PDP(%s/%u) " \
-fmt, (pdp)->mm ? (pdp)->mm->imsi : "---", (pdp)->ti, ## args)
-
 /* look up PDP context by MM context and NSAPI */
 struct sgsn_pdp_ctx *sgsn_pdp_ctx_by_nsapi(const struct sgsn_mm_ctx *mm,
   uint8_t nsapi);
@@ -356,19 +292,10 @@
 struct sgsn_pdp_ctx *sgsn_pdp_ctx_by_tid(const struct sgsn_mm_ctx *mm,
 uint8_t tid);

-struct sgsn_pdp_ctx *sgsn_pdp_ctx_alloc(struct sgsn_mm_ctx *mm,
-   struct sgsn_ggsn_ctx *ggs

Change in osmo-sgsn[master]: Move LOGGSUBSCRP to gprs_subscriber.h

2023-01-12 Thread pespin
pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/30901 )

Change subject: Move LOGGSUBSCRP to gprs_subscriber.h
..

Move LOGGSUBSCRP to gprs_subscriber.h

The define belongs to gprs_subscriber.h header.

Change-Id: Icdb7e55ca8e90dd2ba79ccdb1a8ba650a3942ab3
---
M include/osmocom/sgsn/gprs_sgsn.h
M include/osmocom/sgsn/gprs_subscriber.h
2 files changed, 5 insertions(+), 5 deletions(-)

Approvals:
  Jenkins Builder: Verified
  laforge: Looks good to me, approved
  lynxis lazus: Looks good to me, approved



diff --git a/include/osmocom/sgsn/gprs_sgsn.h b/include/osmocom/sgsn/gprs_sgsn.h
index 424e16f..c9e301d 100644
--- a/include/osmocom/sgsn/gprs_sgsn.h
+++ b/include/osmocom/sgsn/gprs_sgsn.h
@@ -306,11 +306,6 @@

 #define SGSN_ERROR_CAUSE_NONE (-1)

-#define LOGGSUBSCRP(level, subscr, fmt, args...) \
-   LOGP(DGPRS, level, "SUBSCR(%s) " fmt, \
-(subscr) ? (subscr)->imsi : "---", \
-## args)
-
 struct sgsn_config;
 struct sgsn_instance;
 extern const struct value_string *sgsn_auth_state_names;
diff --git a/include/osmocom/sgsn/gprs_subscriber.h 
b/include/osmocom/sgsn/gprs_subscriber.h
index d84a5d6..78de64a 100644
--- a/include/osmocom/sgsn/gprs_subscriber.h
+++ b/include/osmocom/sgsn/gprs_subscriber.h
@@ -99,3 +99,8 @@
 void gprs_subscr_update(struct gprs_subscr *subscr);
 void gprs_subscr_update_auth_info(struct gprs_subscr *subscr);
 int gprs_subscr_rx_gsup_message(struct msgb *msg);
+
+#define LOGGSUBSCRP(level, subscr, fmt, args...) \
+   LOGP(DGPRS, level, "SUBSCR(%s) " fmt, \
+(subscr) ? (subscr)->imsi : "---", \
+## args)



1 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted 
one.
--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30901
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: Icdb7e55ca8e90dd2ba79ccdb1a8ba650a3942ab3
Gerrit-Change-Number: 30901
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-sgsn[master]: Rename bscconfig.h -> config.h

2023-01-12 Thread pespin
pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/30902 )

Change subject: Rename bscconfig.h -> config.h
..

Rename bscconfig.h -> config.h

Change-Id: I007103be34c1aaab7a9375c44b226d4590fe5b24
---
M .gitignore
M configure.ac
M include/osmocom/sgsn/sgsn.h
M src/gtphub/gtphub_main.c
M src/sgsn/gprs_gmm.c
M src/sgsn/gprs_ns.c
M src/sgsn/gprs_ranap.c
M src/sgsn/gprs_sgsn.c
M src/sgsn/gprs_sm.c
M src/sgsn/sgsn_libgtp.c
M src/sgsn/sgsn_main.c
M src/sgsn/sgsn_vty.c
12 files changed, 13 insertions(+), 13 deletions(-)

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



diff --git a/.gitignore b/.gitignore
index 3626a5a..010f151 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,8 +6,8 @@
 .deps
 Makefile
 Makefile.in
-bscconfig.h
-bscconfig.h.in
+config.h
+config.h.in
 *.*~
 *.sw?
 .libs
diff --git a/configure.ac b/configure.ac
index 2c335d7..5985cf8 100644
--- a/configure.ac
+++ b/configure.ac
@@ -230,7 +230,7 @@
 AC_MSG_RESULT([CPPFLAGS="$CPPFLAGS"])

 dnl Generate the output
-AM_CONFIG_HEADER(bscconfig.h)
+AM_CONFIG_HEADER(config.h)

 AC_OUTPUT(
 include/Makefile
diff --git a/include/osmocom/sgsn/sgsn.h b/include/osmocom/sgsn/sgsn.h
index c92b251..aadb8a7 100644
--- a/include/osmocom/sgsn/sgsn.h
+++ b/include/osmocom/sgsn/sgsn.h
@@ -14,7 +14,7 @@
 #include 
 #include 

-#include "../../bscconfig.h"
+#include "../../config.h"

 #if BUILD_IU
 #include 
diff --git a/src/gtphub/gtphub_main.c b/src/gtphub/gtphub_main.c
index 0f389ab..4d1e9cf 100644
--- a/src/gtphub/gtphub_main.c
+++ b/src/gtphub/gtphub_main.c
@@ -44,7 +44,7 @@
 #include 
 #include 

-#include "../../bscconfig.h"
+#include "../../config.h"

 #if BUILD_IU
 #include 
diff --git a/src/sgsn/gprs_gmm.c b/src/sgsn/gprs_gmm.c
index 2630db9..2f15c92 100644
--- a/src/sgsn/gprs_gmm.c
+++ b/src/sgsn/gprs_gmm.c
@@ -30,7 +30,7 @@
 #include 
 #include 

-#include "bscconfig.h"
+#include "config.h"

 #include 
 #include 
diff --git a/src/sgsn/gprs_ns.c b/src/sgsn/gprs_ns.c
index b676917..e2ff931 100644
--- a/src/sgsn/gprs_ns.c
+++ b/src/sgsn/gprs_ns.c
@@ -29,7 +29,7 @@
 #include 
 #include 

-#include "bscconfig.h"
+#include "config.h"

 #include 
 #include 
diff --git a/src/sgsn/gprs_ranap.c b/src/sgsn/gprs_ranap.c
index 245de4b..d3d958d 100644
--- a/src/sgsn/gprs_ranap.c
+++ b/src/sgsn/gprs_ranap.c
@@ -21,7 +21,7 @@
  *
  */

-#include "bscconfig.h"
+#include "config.h"
 #include 

 #include 
diff --git a/src/sgsn/gprs_sgsn.c b/src/sgsn/gprs_sgsn.c
index 40efd4a..55e1cb2 100644
--- a/src/sgsn/gprs_sgsn.c
+++ b/src/sgsn/gprs_sgsn.c
@@ -58,7 +58,7 @@
 
 #include 

-#include "../../bscconfig.h"
+#include "../../config.h"

 #define GPRS_LLME_CHECK_TICK 30

diff --git a/src/sgsn/gprs_sm.c b/src/sgsn/gprs_sm.c
index 9a66e0a..3a5ba3b 100644
--- a/src/sgsn/gprs_sm.c
+++ b/src/sgsn/gprs_sm.c
@@ -26,7 +26,7 @@
 #include 
 #include 

-#include "bscconfig.h"
+#include "config.h"

 #include 
 #include 
diff --git a/src/sgsn/sgsn_libgtp.c b/src/sgsn/sgsn_libgtp.c
index 19a0f56..e2d5670 100644
--- a/src/sgsn/sgsn_libgtp.c
+++ b/src/sgsn/sgsn_libgtp.c
@@ -34,7 +34,7 @@
 #include 
 #include 

-#include "bscconfig.h"
+#include "config.h"

 #include 
 #include 
diff --git a/src/sgsn/sgsn_main.c b/src/sgsn/sgsn_main.c
index 7253348..d9d454c 100644
--- a/src/sgsn/sgsn_main.c
+++ b/src/sgsn/sgsn_main.c
@@ -70,7 +70,7 @@
 #include 
 #include 

-#include "../../bscconfig.h"
+#include "../../config.h"

 #if BUILD_IU
 #include 
diff --git a/src/sgsn/sgsn_vty.c b/src/sgsn/sgsn_vty.c
index d8ea420..fa62561 100644
--- a/src/sgsn/sgsn_vty.c
+++ b/src/sgsn/sgsn_vty.c
@@ -58,7 +58,7 @@
 #include 
 #include 

-#include "../../bscconfig.h"
+#include "../../config.h"

 #ifdef BUILD_IU
 #include 

--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30902
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I007103be34c1aaab7a9375c44b226d4590fe5b24
Gerrit-Change-Number: 30902
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmocom-bb[master]: cosmetic: layer23: Drop unnecessary space before function pointer arg...

2023-01-12 Thread pespin
pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/30944 )

Change subject: cosmetic: layer23: Drop unnecessary space before function 
pointer arguments
..

cosmetic: layer23: Drop unnecessary space before function pointer arguments

As requested by linter.

Change-Id: I87e1857722b9181d0187bdeabe3fa1f4e63463d0
---
M src/host/layer23/include/osmocom/bb/common/l23_app.h
M src/host/layer23/src/common/main.c
2 files changed, 4 insertions(+), 4 deletions(-)

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



diff --git a/src/host/layer23/include/osmocom/bb/common/l23_app.h 
b/src/host/layer23/include/osmocom/bb/common/l23_app.h
index 0b9994c..d5f0fd3 100644
--- a/src/host/layer23/include/osmocom/bb/common/l23_app.h
+++ b/src/host/layer23/include/osmocom/bb/common/l23_app.h
@@ -16,8 +16,8 @@
 /* initialization, called once when starting the app, before entering
  * select loop */
 extern int l23_app_init(struct osmocom_ms *ms);
-extern int (*l23_app_work) (struct osmocom_ms *ms);
-extern int (*l23_app_exit) (struct osmocom_ms *ms);
+extern int (*l23_app_work)(struct osmocom_ms *ms);
+extern int (*l23_app_exit)(struct osmocom_ms *ms);

 /* configuration options */
 struct l23_app_info {
diff --git a/src/host/layer23/src/common/main.c 
b/src/host/layer23/src/common/main.c
index f714010..6841313 100644
--- a/src/host/layer23/src/common/main.c
+++ b/src/host/layer23/src/common/main.c
@@ -54,8 +54,8 @@
 static char *vty_ip = "127.0.0.1";

 unsigned short vty_port = 4247;
-int (*l23_app_work) (struct osmocom_ms *ms) = NULL;
-int (*l23_app_exit) (struct osmocom_ms *ms) = NULL;
+int (*l23_app_work)(struct osmocom_ms *ms) = NULL;
+int (*l23_app_exit)(struct osmocom_ms *ms) = NULL;
 int quit = 0;
 struct gsmtap_inst *gsmtap_inst;


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I87e1857722b9181d0187bdeabe3fa1f4e63463d0
Gerrit-Change-Number: 30944
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmocom-bb[master]: layer23: Fix gcc warning sprintf() writing on too short buf

2023-01-12 Thread pespin
pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/30942 )

Change subject: layer23: Fix gcc warning sprintf() writing on too short buf
..

layer23: Fix gcc warning sprintf() writing on too short buf

Triggered with gcc 12.2.0:
/osmocom-bb/src/host/layer23/src/common/sysinfo.c: In function 
‘gsm48_sysinfo_dump’:
/osmocom-bb/src/host/layer23/src/common/sysinfo.c:198:42: warning: ‘sprintf’ 
may write a terminating nul past the end of the destination [-Wformat-overflow=]
  198 | sprintf(buffer + 69, " %d", i + 63);
  |  ^
/osmocom-bb/src/host/layer23/src/common/sysinfo.c:198:17: note: ‘sprintf’ 
output between 3 and 13 bytes into a destination of size 12
  198 | sprintf(buffer + 69, " %d", i + 63);
  | ^~~

Change-Id: I29a64fbb7aca0d1b469b6d278d4a24ddc6f57b3a
---
M src/host/layer23/src/common/sysinfo.c
1 file changed, 3 insertions(+), 3 deletions(-)

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



diff --git a/src/host/layer23/src/common/sysinfo.c 
b/src/host/layer23/src/common/sysinfo.c
index 392cdc3..be4e84b 100644
--- a/src/host/layer23/src/common/sysinfo.c
+++ b/src/host/layer23/src/common/sysinfo.c
@@ -68,7 +68,7 @@
   void (*print)(void *, const char *, ...),
   void *priv, uint8_t *freq_map)
 {
-   char buffer[81];
+   char buffer[82];
int i, j, k, index;
int refer_pcs = gsm_refer_pcs(arfcn, s);

@@ -173,7 +173,7 @@

/* frequency map */
for (i = 0; i < 1024; i += 64) {
-   sprintf(buffer, " %3d ", i);
+   snprintf(buffer, sizeof(buffer), " %3d ", i);
for (j = 0; j < 64; j++) {
index = i+j;
if (refer_pcs && index >= 512 && index <= 885)
@@ -195,7 +195,7 @@
}
for (; j < 64; j++)
buffer[j + 5] = ' ';
-   sprintf(buffer + 69, " %d", i + 63);
+   snprintf(buffer + 69, sizeof(buffer) - 69, " %d", i + 63);
print(priv, "%s\n", buffer);
}
print(priv, " 'S' = serv. cell  'n' = SI2 (neigh.)  'r' = SI5 (rep.)  "

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I29a64fbb7aca0d1b469b6d278d4a24ddc6f57b3a
Gerrit-Change-Number: 30942
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in libosmocore[master]: gsm_utils: improve gsm_gsmtime2fn()

2023-01-12 Thread fixeria
Attention is currently required from: laforge, dexter.
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/30946 )

Change subject: gsm_utils: improve gsm_gsmtime2fn()
..


Patch Set 2: Code-Review+1

(1 comment)

File src/gsm/gsm_utils.c:

https://gerrit.osmocom.org/c/libosmocore/+/30946/comment/6cce4a7b_635a7109
PS2, Line 893: TS 04.08
Let's better use the new spec. numbers: TS 44.008, TS 45.002. TS 48.058.



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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ibf94bca8223f1f7858a6dd67bf27de0ab6feab20
Gerrit-Change-Number: 30946
Gerrit-PatchSet: 2
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: laforge 
Gerrit-Attention: dexter 
Gerrit-Comment-Date: Thu, 12 Jan 2023 13:24:14 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmocore[master]: gsm0408_test: add unittest for gsm_gsmtime2fn()

2023-01-12 Thread fixeria
Attention is currently required from: laforge, dexter.
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/30945 )

Change subject: gsm0408_test: add unittest for gsm_gsmtime2fn()
..


Patch Set 2: Code-Review+1


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I8b9b71c8dcccf3b44326b5e61229f4637689d763
Gerrit-Change-Number: 30945
Gerrit-PatchSet: 2
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: laforge 
Gerrit-Attention: dexter 
Gerrit-Comment-Date: Thu, 12 Jan 2023 13:24:22 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-ttcn3-hacks[master]: Rename TC_tx_power_start_ramp_down_bcch

2023-01-12 Thread fixeria
Attention is currently required from: daniel.
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30690 )

Change subject: Rename TC_tx_power_start_ramp_down_bcch
..


Patch Set 4: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/30690
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: I463679d9678b95b7d3a5ace711c6ce17b3b24689
Gerrit-Change-Number: 30690
Gerrit-PatchSet: 4
Gerrit-Owner: daniel 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: daniel 
Gerrit-Comment-Date: Thu, 12 Jan 2023 13:24:48 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmocom-bb[master]: layer23: Introduce l23_app_start() API step

2023-01-12 Thread fixeria
Attention is currently required from: pespin.
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/30943 )

Change subject: layer23: Introduce l23_app_start() API step
..


Patch Set 3: Code-Review+1


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I1d232809764962f82fee86159bc61cdbc3eb3c48
Gerrit-Change-Number: 30943
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Thu, 12 Jan 2023 13:28:27 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmocom-bb[master]: layer23: Move extern declaration of l23_ctx to l23_app.h

2023-01-12 Thread fixeria
Attention is currently required from: pespin.
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/30949 )

Change subject: layer23: Move extern declaration of l23_ctx to l23_app.h
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I570d31cc4014b54b47b11a3a52791f62c999cad8
Gerrit-Change-Number: 30949
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Thu, 12 Jan 2023 13:29:06 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-sgsn[master]: gtphub.h: Remove dependency on sgsn/gprs_sgsn.h

2023-01-12 Thread fixeria
Attention is currently required from: pespin, lynxis lazus.
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/30903 )

Change subject: gtphub.h: Remove dependency on sgsn/gprs_sgsn.h
..


Patch Set 3: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30903
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I4c6110feeeaa1adfb6b1f0147eeb56dfe34636ec
Gerrit-Change-Number: 30903
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-CC: daniel 
Gerrit-CC: lynxis lazus 
Gerrit-Attention: pespin 
Gerrit-Attention: lynxis lazus 
Gerrit-Comment-Date: Thu, 12 Jan 2023 13:45:27 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmo-gprs[master]: sndcp: Initial support for async SN-XID.ind and SN-XID.rsp

2023-01-12 Thread fixeria
Attention is currently required from: pespin.
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmo-gprs/+/30907 )

Change subject: sndcp: Initial support for async SN-XID.ind and SN-XID.rsp
..


Patch Set 3: Code-Review+1

(1 comment)

File src/sndcp/sndcp_prim.c:

https://gerrit.osmocom.org/c/libosmo-gprs/+/30907/comment/9d925831_9ba62408 
PS3, Line 224: PRIM_OP_RESPONSE
(would be cleaner to do this in a separate patch)



--
To view, visit https://gerrit.osmocom.org/c/libosmo-gprs/+/30907
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-gprs
Gerrit-Branch: master
Gerrit-Change-Id: I0a5069fd3dc0d6c3dd28aeae09b51c49dd8be92d
Gerrit-Change-Number: 30907
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-CC: daniel 
Gerrit-CC: laforge 
Gerrit-CC: lynxis lazus 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Thu, 12 Jan 2023 13:52:11 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmo-gprs[master]: llc: Log error loading gprs chiper plugins

2023-01-12 Thread fixeria
Attention is currently required from: pespin.
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmo-gprs/+/30910 )

Change subject: llc: Log error loading gprs chiper plugins
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/libosmo-gprs/+/30910
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-gprs
Gerrit-Branch: master
Gerrit-Change-Id: Ie0438b444c2aff8991736806256fb67b59ee8bcc
Gerrit-Change-Number: 30910
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: fixeria 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Thu, 12 Jan 2023 13:52:29 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmo-gprs[master]: llc: Allow app provided callbacks to retain ownership of passed primi...

2023-01-12 Thread fixeria
Attention is currently required from: laforge, pespin.
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmo-gprs/+/30921 )

Change subject: llc: Allow app provided callbacks to retain ownership of passed 
primitive
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/libosmo-gprs/+/30921
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-gprs
Gerrit-Branch: master
Gerrit-Change-Id: I6ea91b8f190a399c4bcf6c7cba9a65809aaf3ddb
Gerrit-Change-Number: 30921
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Attention: laforge 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Thu, 12 Jan 2023 13:53:41 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmocom-bb[master]: layer23: Add VTY supports for l23_apps

2023-01-12 Thread fixeria
Attention is currently required from: pespin.
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/30950 )

Change subject: layer23: Add VTY supports for l23_apps
..


Patch Set 1:

(1 comment)

File src/host/layer23/src/common/main.c:

https://gerrit.osmocom.org/c/osmocom-bb/+/30950/comment/b8509498_cd25040c
PS1, Line 103: file.");
missing \n



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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Ife3a3373e5a9c0c8e5959ac714e140e72d6c363a
Gerrit-Change-Number: 30950
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: fixeria 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Thu, 12 Jan 2023 13:54:14 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment


Change in osmo-bsc[master]: abis_rsl: fix frame number calculation

2023-01-12 Thread dexter
dexter has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/30922 )

Change subject: abis_rsl: fix frame number calculation
..

abis_rsl: fix frame number calculation

The formula that is used to recover the (relative) frame number from the
T1, T2, T3 parameters matches the definition in the spec, but since the
partial term t3-t2 can be negative special precaution is required when
performing the MOD 26 operation.  This is due to the truncated modulo
implementation in C/C++, which has a very specific understanding on how
to deal with negative input parameters.

The libosmocore gsm_gsmtime2fn(() offers a correct implementation, so
lets use it.

Change-Id: I5fb2b0ada8d409730ac22963741fb4ab0026abdd
Related: OS#5198
---
M src/osmo-bsc/abis_rsl.c
1 file changed, 7 insertions(+), 7 deletions(-)

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



diff --git a/src/osmo-bsc/abis_rsl.c b/src/osmo-bsc/abis_rsl.c
index 640ff4d..df8163c 100644
--- a/src/osmo-bsc/abis_rsl.c
+++ b/src/osmo-bsc/abis_rsl.c
@@ -1800,10 +1800,10 @@
 /* Handle packet channel rach requests */
 static int rsl_rx_pchan_rqd(struct chan_rqd *rqd)
 {
-   uint8_t t1, t2, t3;
uint32_t fn;
uint8_t rqd_ta;
uint8_t is_11bit;
+   struct gsm_time gsm_time;

/* Process rach request and forward contained information to PCU */
if (rqd->ref.ra == 0x7F) {
@@ -1816,13 +1816,13 @@
is_11bit = 0;
rqd_ta = rqd->ta;

-   /* See also 3GPP TS 04.08, section 10.5.2.38 and 3GPP TS 08.58, 
section 9.3.8 */
-   t1 = rqd->ref.t1;
-   t2 = rqd->ref.t2;
-   t3 = rqd->ref.t3_low | (rqd->ref.t3_high << 3);
-   fn = (51 * ((t3-t2) % 26) + t3 + 51 * 26 * t1);
+   gsm_time.t1 = rqd->ref.t1;
+   gsm_time.t2 = rqd->ref.t2;
+   gsm_time.t3 = rqd->ref.t3_low | (rqd->ref.t3_high << 3);
+   fn = gsm_gsmtime2fn(&gsm_time);

-   LOG_BTS(rqd->bts, DRSL, LOGL_INFO, "CHAN RQD: 
fn(t1=%u,t3=%u,t2=%u) = %u\n", t1, t3, t2, fn);
+   LOG_BTS(rqd->bts, DRSL, LOGL_INFO, "CHAN RQD: 
fn(t1=%u,t3=%u,t2=%u) = %u\n",
+   gsm_time.t1, gsm_time.t3, gsm_time.t2, fn);
}

return pcu_tx_rach_ind(rqd->bts, rqd_ta, rqd->ref.ra, fn, is_11bit,

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

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I5fb2b0ada8d409730ac22963741fb4ab0026abdd
Gerrit-Change-Number: 30922
Gerrit-PatchSet: 3
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmocom-bb[master]: layer23: Add VTY supports for l23_apps

2023-01-12 Thread fixeria
Attention is currently required from: pespin.
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/30950 )

Change subject: layer23: Add VTY supports for l23_apps
..


Patch Set 1: Code-Review-1

(4 comments)

Patchset:

PS1:
CR-1 for talloc_free().


File src/host/layer23/src/common/main.c:

https://gerrit.osmocom.org/c/osmocom-bb/+/30950/comment/88c7a6a0_a2d3cc45
PS1, Line 271: handle_options
I may be missing something, but I believe option parsing, config parsing, and 
setting up the VTY should be done as early as possible. Otherwise, for 
instance, logging from l23_app_init() would not take the logging configuration 
into account.


https://gerrit.osmocom.org/c/osmocom-bb/+/30950/comment/97ba8e0c_8637cfd9
PS1, Line 274:  OSMO_ASSERT(app->vty_info);
cosmetic: setting up VTY stuff could be done in a separate [static] function, 
so that it's easier to read the main.


https://gerrit.osmocom.org/c/osmocom-bb/+/30950/comment/5072942e_a6eca72f
PS1, Line 331: talloc_free(config_file
This looks wrong to me. We did not allocate config_file using talloc, right?



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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Ife3a3373e5a9c0c8e5959ac714e140e72d6c363a
Gerrit-Change-Number: 30950
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Thu, 12 Jan 2023 14:06:24 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmocore[master]: gsm_utils: improve gsm_gsmtime2fn()

2023-01-12 Thread dexter
Attention is currently required from: laforge, fixeria, pespin.
Hello Jenkins Builder, laforge, fixeria, pespin,

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

https://gerrit.osmocom.org/c/libosmocore/+/30946

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

Change subject: gsm_utils: improve gsm_gsmtime2fn()
..

gsm_utils: improve gsm_gsmtime2fn()

The function gsm_gsmtime2fn() uses a hack to account for the truncated
modulo implementation of C/C++. libosmocore offers proven modulo
functions, so lets use OSMO_MOD_FLR() instead. Also arrange the formula
so that it looks more like the one in the spec.

Also add better spec references and a final modulo GSM_MAX_FN to
prevent frame number results that exceed the valid range.

Change-Id: Ibf94bca8223f1f7858a6dd67bf27de0ab6feab20
---
M src/gsm/gsm_utils.c
1 file changed, 13 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/46/30946/3
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/30946
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ibf94bca8223f1f7858a6dd67bf27de0ab6feab20
Gerrit-Change-Number: 30946
Gerrit-PatchSet: 3
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: laforge 
Gerrit-Attention: fixeria 
Gerrit-Attention: pespin 
Gerrit-MessageType: newpatchset


Change in libosmocore[master]: gsm_utils: improve gsm_gsmtime2fn()

2023-01-12 Thread dexter
Attention is currently required from: laforge, fixeria, pespin.
dexter has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/30946 )

Change subject: gsm_utils: improve gsm_gsmtime2fn()
..


Patch Set 3:

(2 comments)

Commit Message:

https://gerrit.osmocom.org/c/libosmocore/+/30946/comment/0af8d98d_17ed1489
PS2, Line 11: functions, so lets use OSMO_MOD_FLR() instead. Also arange the 
formula
> arrange
Done


File src/gsm/gsm_utils.c:

https://gerrit.osmocom.org/c/libosmocore/+/30946/comment/e4b3b4af_6bf0f6c2
PS2, Line 893: TS 04.08
> Let's better use the new spec. numbers: TS 44.008, TS 45.002. TS 48.058.
Done



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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ibf94bca8223f1f7858a6dd67bf27de0ab6feab20
Gerrit-Change-Number: 30946
Gerrit-PatchSet: 3
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: laforge 
Gerrit-Attention: fixeria 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Thu, 12 Jan 2023 14:33:45 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin 
Comment-In-Reply-To: fixeria 
Gerrit-MessageType: comment


Change in docker-playground[master]: */Dockerfile: clone from gerrit.osmocom.org using https://

2023-01-12 Thread pespin
Attention is currently required from: osmith, fixeria.
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/docker-playground/+/30896 )

Change subject: */Dockerfile: clone from gerrit.osmocom.org using https://
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/docker-playground/+/30896
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: docker-playground
Gerrit-Branch: master
Gerrit-Change-Id: I204fa6e3e3ebbdb8732393b897fca35659d61ae8
Gerrit-Change-Number: 30896
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-Attention: osmith 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Thu, 12 Jan 2023 14:35:40 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmo-gprs[master]: sndcp: Fix wrong prim op passed in osmo_gprs_sndcp_prim_alloc_sn_xid_...

2023-01-12 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmo-gprs/+/30951 )


Change subject: sndcp: Fix wrong prim op passed in 
osmo_gprs_sndcp_prim_alloc_sn_xid_rsp()
..

sndcp: Fix wrong prim op passed in osmo_gprs_sndcp_prim_alloc_sn_xid_rsp()

Change-Id: I0644bf481c06a2cfc1d9f57995eefedf36e8b839
---
M src/sndcp/sndcp_prim.c
1 file changed, 1 insertion(+), 1 deletion(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmo-gprs refs/changes/51/30951/1

diff --git a/src/sndcp/sndcp_prim.c b/src/sndcp/sndcp_prim.c
index 7dd9d43..09c37b7 100644
--- a/src/sndcp/sndcp_prim.c
+++ b/src/sndcp/sndcp_prim.c
@@ -210,7 +210,7 @@
 struct osmo_gprs_sndcp_prim *osmo_gprs_sndcp_prim_alloc_sn_xid_rsp(uint32_t 
tlli, uint8_t sapi, uint8_t nsapi)
 {
struct osmo_gprs_sndcp_prim *sndcp_prim;
-   sndcp_prim = sndcp_prim_sn_alloc(OSMO_GPRS_SNDCP_SN_XID, 
PRIM_OP_REQUEST, 0);
+   sndcp_prim = sndcp_prim_sn_alloc(OSMO_GPRS_SNDCP_SN_XID, 
PRIM_OP_RESPONSE, 0);
sndcp_prim->sn.tlli = tlli;
sndcp_prim->sn.sapi = sapi;
sndcp_prim->sn.xid_rsp.nsapi = nsapi;

--
To view, visit https://gerrit.osmocom.org/c/libosmo-gprs/+/30951
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-gprs
Gerrit-Branch: master
Gerrit-Change-Id: I0644bf481c06a2cfc1d9f57995eefedf36e8b839
Gerrit-Change-Number: 30951
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-MessageType: newchange


Change in libosmo-gprs[master]: llc: Log error loading gprs chiper plugins

2023-01-12 Thread pespin
Attention is currently required from: pespin.
Hello Jenkins Builder, fixeria, dexter,

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

https://gerrit.osmocom.org/c/libosmo-gprs/+/30910

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

Change subject: llc: Log error loading gprs chiper plugins
..

llc: Log error loading gprs chiper plugins

Change-Id: Ie0438b444c2aff8991736806256fb67b59ee8bcc
---
M src/llc/llc.c
1 file changed, 3 insertions(+), 1 deletion(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmo-gprs refs/changes/10/30910/2
--
To view, visit https://gerrit.osmocom.org/c/libosmo-gprs/+/30910
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-gprs
Gerrit-Branch: master
Gerrit-Change-Id: Ie0438b444c2aff8991736806256fb67b59ee8bcc
Gerrit-Change-Number: 30910
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: fixeria 
Gerrit-Attention: pespin 
Gerrit-MessageType: newpatchset


Change in libosmo-gprs[master]: llc: Allow app provided callbacks to retain ownership of passed primi...

2023-01-12 Thread pespin
Attention is currently required from: laforge, pespin.
Hello Jenkins Builder, laforge, fixeria,

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

https://gerrit.osmocom.org/c/libosmo-gprs/+/30921

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

Change subject: llc: Allow app provided callbacks to retain ownership of passed 
primitive
..

llc: Allow app provided callbacks to retain ownership of passed primitive

This way the app can, for instance, simply forward the primtiive pointer
from LLC callback to SNDCP layer, which will in the end take the
ownership of the primitive and free it.

Change-Id: I6ea91b8f190a399c4bcf6c7cba9a65809aaf3ddb
---
M src/llc/llc_prim.c
1 file changed, 6 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmo-gprs refs/changes/21/30921/2
--
To view, visit https://gerrit.osmocom.org/c/libosmo-gprs/+/30921
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-gprs
Gerrit-Branch: master
Gerrit-Change-Id: I6ea91b8f190a399c4bcf6c7cba9a65809aaf3ddb
Gerrit-Change-Number: 30921
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Attention: laforge 
Gerrit-Attention: pespin 
Gerrit-MessageType: newpatchset


Change in libosmocore[master]: gsm_utils: improve gsm_gsmtime2fn()

2023-01-12 Thread pespin
Attention is currently required from: laforge, fixeria, dexter.
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/30946 )

Change subject: gsm_utils: improve gsm_gsmtime2fn()
..


Patch Set 3: Code-Review+1


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ibf94bca8223f1f7858a6dd67bf27de0ab6feab20
Gerrit-Change-Number: 30946
Gerrit-PatchSet: 3
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: laforge 
Gerrit-Attention: fixeria 
Gerrit-Attention: dexter 
Gerrit-Comment-Date: Thu, 12 Jan 2023 14:39:24 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-sgsn[master]: Split gprs_sgsn.{c,h} -> {auth,mmctx,sgsn}.{c,h}

2023-01-12 Thread pespin
Attention is currently required from: laforge, lynxis lazus.
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/30904 )

Change subject: Split gprs_sgsn.{c,h} -> {auth,mmctx,sgsn}.{c,h}
..


Patch Set 5: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30904
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I048a082851c1275c959649942904205b02acce2a
Gerrit-Change-Number: 30904
Gerrit-PatchSet: 5
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-CC: lynxis lazus 
Gerrit-Attention: laforge 
Gerrit-Attention: lynxis lazus 
Gerrit-Comment-Date: Thu, 12 Jan 2023 14:41:14 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-sgsn[master]: vty: Introduce encryption cipher-plugin-path command

2023-01-12 Thread pespin
Attention is currently required from: dexter.
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/30909 )

Change subject: vty: Introduce encryption cipher-plugin-path command
..


Patch Set 2: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30909
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I4f965c7afafa193f4d7486750dd3e43cca22bb65
Gerrit-Change-Number: 30909
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: lynxis lazus 
Gerrit-Reviewer: pespin 
Gerrit-Attention: dexter 
Gerrit-Comment-Date: Thu, 12 Jan 2023 14:41:23 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmo-sgsn[master]: gtphub.h: Remove dependency on sgsn/gprs_sgsn.h

2023-01-12 Thread pespin
pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/30903 )

Change subject: gtphub.h: Remove dependency on sgsn/gprs_sgsn.h
..

gtphub.h: Remove dependency on sgsn/gprs_sgsn.h

It is only really needed to import define GSM_APN_LENGTH, which is
actually also available in libosmogsm. Hence simply use the one from
libosmogsm.

Change-Id: I4c6110feeeaa1adfb6b1f0147eeb56dfe34636ec
---
M include/osmocom/gtphub/gtphub.h
M src/gtphub/gtphub.c
M src/gtphub/gtphub_ares.c
M src/gtphub/gtphub_main.c
M src/gtphub/gtphub_sock.c
M tests/gtphub/gtphub_test.c
6 files changed, 14 insertions(+), 8 deletions(-)

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



diff --git a/include/osmocom/gtphub/gtphub.h b/include/osmocom/gtphub/gtphub.h
index 6a439b5..dbf8469 100644
--- a/include/osmocom/gtphub/gtphub.h
+++ b/include/osmocom/gtphub/gtphub.h
@@ -27,9 +27,7 @@
 #include 
 #include 
 #include 
-
-#include 
-
+#include 

 /* support */

@@ -428,7 +426,7 @@

/* The APN OI, the Operator Identifier, is the combined address,
 * including parts of the IMSI and APN NI, and ending with ".gprs". */
-   char apn_oi_str[GSM_APN_LENGTH];
+   char apn_oi_str[APN_MAXLEN+1];

/* Which address and port we resolved that to. */
struct gtphub_peer_port *peer;
diff --git a/src/gtphub/gtphub.c b/src/gtphub/gtphub.c
index 2b00f59..937e6a4 100644
--- a/src/gtphub/gtphub.c
+++ b/src/gtphub/gtphub.c
@@ -475,7 +475,7 @@
  * present but cannot be decoded. */
 static int get_ie_apn_str(union gtpie_member *ie[], const char **apn_str)
 {
-   static char apn_buf[GSM_APN_LENGTH];
+   static char apn_buf[APN_MAXLEN+1];
unsigned int len;
if (gtpie_gettlv(ie, GTPIE_APN, 0,
 &len, apn_buf, sizeof(apn_buf)) != 0)
diff --git a/src/gtphub/gtphub_ares.c b/src/gtphub/gtphub_ares.c
index a2d8a4a..774563d 100644
--- a/src/gtphub/gtphub_ares.c
+++ b/src/gtphub/gtphub_ares.c
@@ -33,6 +33,7 @@

 #include 
 #include 
+#include 

 /* TODO split GRX ares from sgsn into a separate struct and allow use without
  * globals. */
@@ -56,8 +57,8 @@
struct gtphub *hub;

char imsi_str[GSM23003_IMSI_MAX_DIGITS+1];
-   char apn_ni_str[GSM_APN_LENGTH];
-   char apn_oi_str[GSM_APN_LENGTH];
+   char apn_ni_str[APN_MAXLEN+1];
+   char apn_oi_str[APN_MAXLEN+1];
int have_3dig_mnc;
 };

diff --git a/src/gtphub/gtphub_main.c b/src/gtphub/gtphub_main.c
index 4d1e9cf..d25123e 100644
--- a/src/gtphub/gtphub_main.c
+++ b/src/gtphub/gtphub_main.c
@@ -34,6 +34,7 @@
 #include 
 #include 
 #include 
+#include 

 #include 
 #include 
diff --git a/src/gtphub/gtphub_sock.c b/src/gtphub/gtphub_sock.c
index 59a0d42..6f299d2 100644
--- a/src/gtphub/gtphub_sock.c
+++ b/src/gtphub/gtphub_sock.c
@@ -25,6 +25,11 @@
  * along with this program.  If not, see .
  */

+#include 
+#include 
+
+#include 
+
 #include 
 #include 

diff --git a/tests/gtphub/gtphub_test.c b/tests/gtphub/gtphub_test.c
index 4f58315..5fa730a 100644
--- a/tests/gtphub/gtphub_test.c
+++ b/tests/gtphub/gtphub_test.c
@@ -27,6 +27,7 @@

 #include 
 #include 
+#include 

 #include 

@@ -376,7 +377,7 @@
 }

 char resolve_ggsn_got_imsi[GSM23003_IMSI_MAX_DIGITS+1];
-char resolve_ggsn_got_ni[GSM_APN_LENGTH];
+char resolve_ggsn_got_ni[APN_MAXLEN+1];

 struct sgsn_sockaddr resolved_ggsn_addr;
 static int resolve_to_ggsn(const char *addr, uint16_t port)

--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30903
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I4c6110feeeaa1adfb6b1f0147eeb56dfe34636ec
Gerrit-Change-Number: 30903
Gerrit-PatchSet: 3
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-CC: daniel 
Gerrit-CC: lynxis lazus 
Gerrit-MessageType: merged


Change in osmo-sgsn[master]: Move global mmctx list into struct sgsn_instance

2023-01-12 Thread pespin
pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/30905 )

Change subject: Move global mmctx list into struct sgsn_instance
..

Move global mmctx list into struct sgsn_instance

Change-Id: Idf8458902321da03b9b0831dad3ad383a9c7afa1
---
M include/osmocom/sgsn/mmctx.h
M include/osmocom/sgsn/sgsn.h
M src/sgsn/mmctx.c
M src/sgsn/sgsn.c
M src/sgsn/sgsn_ctrl.c
M src/sgsn/sgsn_vty.c
M tests/sgsn/sgsn_test.c
7 files changed, 16 insertions(+), 15 deletions(-)

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



diff --git a/include/osmocom/sgsn/mmctx.h b/include/osmocom/sgsn/mmctx.h
index dd78124..c19f599 100644
--- a/include/osmocom/sgsn/mmctx.h
+++ b/include/osmocom/sgsn/mmctx.h
@@ -281,8 +281,6 @@
 struct sgsn_pdp_ctx *sgsn_pdp_ctx_by_tid(const struct sgsn_mm_ctx *mm,
 uint8_t tid);

-extern struct llist_head sgsn_mm_ctxts;
-
 uint32_t sgsn_alloc_ptmsi(void);

 /* Called on subscriber data updates */
diff --git a/include/osmocom/sgsn/sgsn.h b/include/osmocom/sgsn/sgsn.h
index 0963863..441a614 100644
--- a/include/osmocom/sgsn/sgsn.h
+++ b/include/osmocom/sgsn/sgsn.h
@@ -156,6 +156,7 @@
struct llist_head apn_list; /* list of struct sgsn_apn_ctx */
struct llist_head ggsn_list; /* list of struct sgsn_ggsn_ctx */
struct llist_head mme_list; /* list of struct sgsn_mme_ctx */
+   struct llist_head mm_list; /* list of struct sgsn_mm_ctx */
struct llist_head pdp_list; /* list of struct sgsn_pdp_ctx */

struct ctrl_handle *ctrlh;
diff --git a/src/sgsn/mmctx.c b/src/sgsn/mmctx.c
index c40db21..0e93092 100644
--- a/src/sgsn/mmctx.c
+++ b/src/sgsn/mmctx.c
@@ -60,8 +60,6 @@

 #include "../../config.h"

-LLIST_HEAD(sgsn_mm_ctxts);
-
 const struct value_string sgsn_ran_type_names[] = {
{ MM_CTX_T_GERAN_Gb, "GPRS/EDGE via Gb" },
{ MM_CTX_T_UTRAN_Iu, "UMTS via Iu" },
@@ -98,7 +96,7 @@
 {
struct sgsn_mm_ctx *ctx;

-   llist_for_each_entry(ctx, &sgsn_mm_ctxts, list) {
+   llist_for_each_entry(ctx, &sgsn->mm_list, list) {
if (ctx->ran_type == MM_CTX_T_UTRAN_Iu
&& uectx == ctx->iu.ue_ctx)
return ctx;
@@ -113,7 +111,7 @@
 {
struct sgsn_mm_ctx *ctx;

-   llist_for_each_entry(ctx, &sgsn_mm_ctxts, list) {
+   llist_for_each_entry(ctx, &sgsn->mm_list, list) {
if ((tlli == ctx->gb.tlli || tlli == ctx->gb.tlli_new) &&
gprs_ra_id_equals(raid, &ctx->ra))
return ctx;
@@ -137,7 +135,7 @@
if (tlli_type != TLLI_FOREIGN && tlli_type != TLLI_LOCAL)
return NULL;

-   llist_for_each_entry(ctx, &sgsn_mm_ctxts, list) {
+   llist_for_each_entry(ctx, &sgsn->mm_list, list) {
if ((gprs_tmsi2tlli(ctx->p_tmsi, tlli_type) == tlli ||
 gprs_tmsi2tlli(ctx->p_tmsi_old, tlli_type) == tlli) &&
gprs_ra_id_equals(raid, &ctx->ra))
@@ -151,7 +149,7 @@
 {
struct sgsn_mm_ctx *ctx;

-   llist_for_each_entry(ctx, &sgsn_mm_ctxts, list) {
+   llist_for_each_entry(ctx, &sgsn->mm_list, list) {
if (p_tmsi == ctx->p_tmsi ||
(ctx->p_tmsi_old && ctx->p_tmsi_old == p_tmsi))
return ctx;
@@ -163,7 +161,7 @@
 {
struct sgsn_mm_ctx *ctx;

-   llist_for_each_entry(ctx, &sgsn_mm_ctxts, list) {
+   llist_for_each_entry(ctx, &sgsn->mm_list, list) {
if (!strcmp(imsi, ctx->imsi))
return ctx;
}
@@ -205,7 +203,7 @@

INIT_LLIST_HEAD(&ctx->pdp_list);

-   llist_add(&ctx->list, &sgsn_mm_ctxts);
+   llist_add(&ctx->list, &sgsn->mm_list);

return ctx;

@@ -411,7 +409,7 @@
goto restart;
}

-   llist_for_each_entry(mm, &sgsn_mm_ctxts, list) {
+   llist_for_each_entry(mm, &sgsn->mm_list, list) {
if (mm->p_tmsi == ptmsi) {
if (!max_retries--)
goto failed;
diff --git a/src/sgsn/sgsn.c b/src/sgsn/sgsn.c
index f394db8..6619bf2 100644
--- a/src/sgsn/sgsn.c
+++ b/src/sgsn/sgsn.c
@@ -99,7 +99,7 @@
 {
struct sgsn_mm_ctx *mmctx = NULL;

-   llist_for_each_entry(mmctx, &sgsn_mm_ctxts, list) {
+   llist_for_each_entry(mmctx, &sgsn->mm_list, list) {
if (llme == mmctx->gb.llme) {
gsm0408_gprs_access_cancelled(mmctx, 
SGSN_ERROR_CAUSE_NONE);
return;
@@ -176,6 +176,7 @@
INIT_LLIST_HEAD(&inst->apn_list);
INIT_LLIST_HEAD(&inst->ggsn_list);
INIT_LLIST_HEAD(&inst->mme_list);
+   INIT_LLIST_HEAD(&inst->mm_list);
INIT_LLIST_HEAD(&inst->pdp_list);

osmo_timer_setup(&inst->llme_timer, sgsn_llme_check_cb, NULL);
diff --git 

Change in osmo-sgsn[master]: Fix extra whitespace in pdpctx_ctr_description

2023-01-12 Thread pespin
pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/30932 )

Change subject: Fix extra whitespace in pdpctx_ctr_description
..

Fix extra whitespace in pdpctx_ctr_description

Change-Id: I4d9145c681e725b709fde38f6e9b4516d37b4d8c
---
M src/sgsn/pdpctx.c
1 file changed, 4 insertions(+), 4 deletions(-)

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



diff --git a/src/sgsn/pdpctx.c b/src/sgsn/pdpctx.c
index 70fba20..e779420 100644
--- a/src/sgsn/pdpctx.c
+++ b/src/sgsn/pdpctx.c
@@ -40,10 +40,10 @@
 #include 

 static const struct rate_ctr_desc pdpctx_ctr_description[] = {
-   { "udata:packets:in",   "User Data  Messages ( In)" },
-   { "udata:packets:out",  "User Data  Messages (Out)" },
-   { "udata:bytes:in", "User Data  Bytes( In)" },
-   { "udata:bytes:out","User Data  Bytes(Out)" },
+   { "udata:packets:in",   "User Data Messages ( In)" },
+   { "udata:packets:out",  "User Data Messages (Out)" },
+   { "udata:bytes:in", "User Data Bytes( In)" },
+   { "udata:bytes:out","User Data Bytes(Out)" },
 };

 static const struct rate_ctr_group_desc pdpctx_ctrg_desc = {

--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30932
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I4d9145c681e725b709fde38f6e9b4516d37b4d8c
Gerrit-Change-Number: 30932
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-sgsn[master]: Split gprs_sgsn.{c,h} -> {auth,mmctx,sgsn}.{c,h}

2023-01-12 Thread pespin
pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/30904 )

Change subject: Split gprs_sgsn.{c,h} -> {auth,mmctx,sgsn}.{c,h}
..

Split gprs_sgsn.{c,h} -> {auth,mmctx,sgsn}.{c,h}

Some level of split already existed, like sgsn_auth.c, but headers were
entangled together.
Let's clearly separate application centric code (sgsn.c/h), auth related
code (auth.c/h) and mmctx related code (mmctx.c/h).

Change-Id: I048a082851c1275c959649942904205b02acce2a
---
M include/osmocom/sgsn/Makefile.am
A include/osmocom/sgsn/auth.h
M include/osmocom/sgsn/gprs_gmm.h
M include/osmocom/sgsn/gprs_gmm_fsm.h
M include/osmocom/sgsn/gprs_llc.h
M include/osmocom/sgsn/gprs_ranap.h
M include/osmocom/sgsn/gprs_sm.h
M include/osmocom/sgsn/gprs_sndcp.h
R include/osmocom/sgsn/mmctx.h
M include/osmocom/sgsn/sgsn.h
M src/gprs/gprs_llc_parse.c
M src/sgsn/Makefile.am
M src/sgsn/gprs_bssgp.c
M src/sgsn/gprs_gmm.c
M src/sgsn/gprs_gmm_attach.c
M src/sgsn/gprs_llc.c
M src/sgsn/gprs_mm_state_gb_fsm.c
M src/sgsn/gprs_mm_state_iu_fsm.c
M src/sgsn/gprs_ns.c
M src/sgsn/gprs_ranap.c
M src/sgsn/gprs_sm.c
M src/sgsn/gprs_sndcp.c
M src/sgsn/gprs_subscriber.c
R src/sgsn/mmctx.c
M src/sgsn/pdpctx.c
A src/sgsn/sgsn.c
M src/sgsn/sgsn_auth.c
M src/sgsn/sgsn_cdr.c
M src/sgsn/sgsn_ctrl.c
M src/sgsn/sgsn_libgtp.c
M src/sgsn/sgsn_vty.c
M tests/sgsn/Makefile.am
M tests/sgsn/gprs_gb_parse.c
33 files changed, 312 insertions(+), 219 deletions(-)

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



diff --git a/include/osmocom/sgsn/Makefile.am b/include/osmocom/sgsn/Makefile.am
index 017954d..aa6cd0f 100644
--- a/include/osmocom/sgsn/Makefile.am
+++ b/include/osmocom/sgsn/Makefile.am
@@ -1,5 +1,6 @@
 noinst_HEADERS = \
apn.h \
+   auth.h \
common.h \
crc24.h \
debug.h \
@@ -13,7 +14,6 @@
gprs_llc.h \
gprs_llc_xid.h \
gprs_ranap.h \
-   gprs_sgsn.h \
gprs_sm.h \
gprs_sndcp_comp.h \
gprs_sndcp_dcomp.h \
@@ -25,6 +25,7 @@
gtp.h \
gtp_ggsn.h \
gtp_mme.h \
+   mmctx.h \
pdpctx.h \
sgsn.h \
sgsn_rim.h \
diff --git a/include/osmocom/sgsn/auth.h b/include/osmocom/sgsn/auth.h
new file mode 100644
index 000..a46fb16
--- /dev/null
+++ b/include/osmocom/sgsn/auth.h
@@ -0,0 +1,39 @@
+/* MS authorization and subscriber data handling */
+#pragma once
+
+#include 
+
+struct sgsn_config;
+struct sgsn_instance;
+struct sgsn_mm_ctx;
+struct gsm_auth_tuple;
+
+/* Authorization/ACL handling */
+enum sgsn_auth_state {
+   SGSN_AUTH_UNKNOWN,
+   SGSN_AUTH_AUTHENTICATE,
+   SGSN_AUTH_UMTS_RESYNC,
+   SGSN_AUTH_ACCEPTED,
+   SGSN_AUTH_REJECTED
+};
+
+extern const struct value_string *sgsn_auth_state_names;
+
+void sgsn_auth_init(struct sgsn_instance *sgsn);
+/* Request authorization */
+enum sgsn_auth_state sgsn_auth_state(struct sgsn_mm_ctx *mm);
+int sgsn_auth_request(struct sgsn_mm_ctx *mm);
+void sgsn_auth_update(struct sgsn_mm_ctx *mm);
+struct gsm_auth_tuple *sgsn_auth_get_tuple(struct sgsn_mm_ctx *mmctx,
+  unsigned key_seq);
+
+/*
+ * Authorization/ACL handling
+ */
+struct imsi_acl_entry {
+   struct llist_head list;
+   char imsi[OSMO_IMSI_BUF_SIZE];
+};
+struct imsi_acl_entry *sgsn_acl_lookup(const char *imsi, const struct 
sgsn_config *cfg);
+int sgsn_acl_add(const char *imsi, struct sgsn_config *cfg);
+int sgsn_acl_del(const char *imsi, struct sgsn_config *cfg);
diff --git a/include/osmocom/sgsn/gprs_gmm.h b/include/osmocom/sgsn/gprs_gmm.h
index 0d04280..71dd1fa 100644
--- a/include/osmocom/sgsn/gprs_gmm.h
+++ b/include/osmocom/sgsn/gprs_gmm.h
@@ -1,11 +1,15 @@
 #ifndef _GPRS_GMM_H
 #define _GPRS_GMM_H

-#include 
-#include 
-
 #include 

+#include 
+#include 
+#include 
+
+struct sgsn_mm_ctx;
+struct gprs_llc_llme;
+
 int gsm48_tx_gmm_auth_ciph_req(struct sgsn_mm_ctx *mm,
  const struct osmo_auth_vector *vec,
  uint8_t key_seq, bool force_standby);
diff --git a/include/osmocom/sgsn/gprs_gmm_fsm.h 
b/include/osmocom/sgsn/gprs_gmm_fsm.h
index f10851e..2f0e81a 100644
--- a/include/osmocom/sgsn/gprs_gmm_fsm.h
+++ b/include/osmocom/sgsn/gprs_gmm_fsm.h
@@ -1,8 +1,10 @@
 #pragma once

 #include 
-#include 

+#include 
+
+struct gprs_llc_llme;

 /* 3GPP TS 24.008 § 4.1.3.3 GMM mobility management states on the network side 
*/
 enum gmm_fsm_states {
diff --git a/include/osmocom/sgsn/gprs_llc.h b/include/osmocom/sgsn/gprs_llc.h
index 32b16b0..6f0e492 100644
--- a/include/osmocom/sgsn/gprs_llc.h
+++ b/include/osmocom/sgsn/gprs_llc.h
@@ -2,9 +2,15 @@

 #include 
 #include 
-#include 
+
+#include 
+#include 
+#include 
+
 #include 

+struct sgsn_mm_ctx;
+
 /* Section 4.7 LLC Layer

Change in osmo-sgsn[master]: vty: Introduce encryption cipher-plugin-path command

2023-01-12 Thread pespin
pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-sgsn/+/30909 )

Change subject: vty: Introduce encryption cipher-plugin-path command
..

vty: Introduce encryption cipher-plugin-path command

The load of plugins will eventually be moved to libosmo-gprs
implementation, and path will be passed as a parameter. Once it's moved
inside libosmo-gprs, it will be more strict on load failures, which can
cause internally if the path doesn't exist (unless NULL is passed).
Hence, add a VTY config to allow configuring the right path, and have it
disabled by default.

Change-Id: I4f965c7afafa193f4d7486750dd3e43cca22bb65
---
M include/osmocom/sgsn/sgsn.h
M src/sgsn/sgsn_main.c
M src/sgsn/sgsn_vty.c
M tests/osmo-sgsn_test-nodes.vty
4 files changed, 30 insertions(+), 2 deletions(-)

Approvals:
  Jenkins Builder: Verified
  daniel: Looks good to me, but someone else must approve
  pespin: Looks good to me, approved
  dexter: Looks good to me, but someone else must approve
  lynxis lazus: Looks good to me, but someone else must approve



diff --git a/include/osmocom/sgsn/sgsn.h b/include/osmocom/sgsn/sgsn.h
index 441a614..6e93178 100644
--- a/include/osmocom/sgsn/sgsn.h
+++ b/include/osmocom/sgsn/sgsn.h
@@ -77,6 +77,7 @@
/* misc */
struct gprs_ns2_inst *nsi;

+   char *crypt_cipher_plugin_path;
enum sgsn_auth_policy auth_policy;
uint8_t gea_encryption_mask;
uint8_t uea_encryption_mask;
diff --git a/src/sgsn/sgsn_main.c b/src/sgsn/sgsn_main.c
index d9d454c..04de6a2 100644
--- a/src/sgsn/sgsn_main.c
+++ b/src/sgsn/sgsn_main.c
@@ -413,8 +413,6 @@
sgsn->cfg.nsi = sgsn_nsi;
bssgp_set_bssgp_callback(sgsn_bssgp_dispatch_ns_unitdata_req_cb, 
sgsn_nsi);

-   gprs_llc_init("/usr/local/lib/osmocom/crypt/");
-
gprs_ns2_vty_init(sgsn_nsi);
bssgp_vty_init();
gprs_llc_vty_init();
@@ -449,6 +447,8 @@
if (rc < 0)
exit(1);

+   gprs_llc_init(sgsn->cfg.crypt_cipher_plugin_path);
+
rc = sgsn_gtp_init(sgsn);
if (rc) {
LOGP(DGPRS, LOGL_FATAL, "Cannot bind/listen on GTP socket\n");
diff --git a/src/sgsn/sgsn_vty.c b/src/sgsn/sgsn_vty.c
index 79764f1..b31fb59 100644
--- a/src/sgsn/sgsn_vty.c
+++ b/src/sgsn/sgsn_vty.c
@@ -282,6 +282,8 @@

vty_out(vty, "%s", VTY_NEWLINE);
}
+   if (g_cfg->crypt_cipher_plugin_path)
+   vty_out(vty, "encryption cipher-plugin-path %s%s", 
g_cfg->crypt_cipher_plugin_path, VTY_NEWLINE);
if (g_cfg->sgsn_ipa_name)
vty_out(vty, " gsup ipa-name %s%s", g_cfg->sgsn_ipa_name, 
VTY_NEWLINE);
if (g_cfg->gsup_server_addr.sin_addr.s_addr)
@@ -839,6 +841,27 @@
return CMD_SUCCESS;
 }

+DEFUN(cfg_encrypt_cipher_plugin_path, cfg_encrypt_cipher_plugin_path_cmd,
+   "encryption cipher-plugin-path PATH",
+   ENCRYPTION_STR
+   "Path to gprs encryption cipher plugin directory\n"
+   "Plugin path\n")
+{
+   osmo_talloc_replace_string(sgsn, &sgsn->cfg.crypt_cipher_plugin_path, 
argv[0]);
+
+   return CMD_SUCCESS;
+}
+
+DEFUN(cfg_no_encrypt_cipher_plugin_path, cfg_no_encrypt_cipher_plugin_path_cmd,
+   "no encryption cipher-plugin-path PATH",
+   NO_STR ENCRYPTION_STR
+   "Path to gprs encryption cipher plugin directory\n"
+   "Plugin path\n")
+{
+   TALLOC_FREE(sgsn->cfg.crypt_cipher_plugin_path);
+   return CMD_SUCCESS;
+}
+
 DEFUN(cfg_authentication, cfg_authentication_cmd,
   "authentication (optional|required)",
   "Whether to enforce MS authentication in GERAN (only with auth-policy 
remote)\n"
@@ -1773,6 +1796,8 @@
install_element(SGSN_NODE, &cfg_encrypt2_cmd);
install_element(SGSN_NODE, &cfg_encrypt_cmd);
install_element(SGSN_NODE, &cfg_encryption_uea_cmd);
+   install_element(SGSN_NODE, &cfg_encrypt_cipher_plugin_path_cmd);
+   install_element(SGSN_NODE, &cfg_no_encrypt_cipher_plugin_path_cmd);

install_element(SGSN_NODE, &cfg_gsup_ipa_name_cmd);
install_element(SGSN_NODE, &cfg_gsup_remote_ip_cmd);
diff --git a/tests/osmo-sgsn_test-nodes.vty b/tests/osmo-sgsn_test-nodes.vty
index 22d81d2..4c65415 100644
--- a/tests/osmo-sgsn_test-nodes.vty
+++ b/tests/osmo-sgsn_test-nodes.vty
@@ -37,6 +37,8 @@
   authentication (optional|required)
   encryption gea <0-4> [<0-4>] [<0-4>] [<0-4>] [<0-4>]
   encryption uea <0-2> [<0-2>] [<0-2>]
+  encryption cipher-plugin-path PATH
+  no encryption cipher-plugin-path PATH
   gsup ipa-name NAME
   gsup remote-ip A.B.C.D
   gsup remote-port <0-65535>

--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/30909
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I4f965c7afafa193f4d7486750dd3e43cca22bb65
Gerrit-Change-Number: 30909
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Revi

Change in libosmocore[master]: gsm_utils: improve gsm_gsmtime2fn()

2023-01-12 Thread fixeria
Attention is currently required from: laforge, dexter.
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/30946 )

Change subject: gsm_utils: improve gsm_gsmtime2fn()
..


Patch Set 3: Code-Review+2


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ibf94bca8223f1f7858a6dd67bf27de0ab6feab20
Gerrit-Change-Number: 30946
Gerrit-PatchSet: 3
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: laforge 
Gerrit-Attention: dexter 
Gerrit-Comment-Date: Thu, 12 Jan 2023 14:42:03 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmocore[master]: gsm0408_test: add unittest for gsm_gsmtime2fn()

2023-01-12 Thread fixeria
Attention is currently required from: laforge, dexter.
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmocore/+/30945 )

Change subject: gsm0408_test: add unittest for gsm_gsmtime2fn()
..


Patch Set 2: Code-Review+2


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

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I8b9b71c8dcccf3b44326b5e61229f4637689d763
Gerrit-Change-Number: 30945
Gerrit-PatchSet: 2
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-Attention: laforge 
Gerrit-Attention: dexter 
Gerrit-Comment-Date: Thu, 12 Jan 2023 14:42:13 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in docker-playground[master]: */Dockerfile: clone from gerrit.osmocom.org using https://

2023-01-12 Thread fixeria
fixeria has submitted this change. ( 
https://gerrit.osmocom.org/c/docker-playground/+/30896 )

Change subject: */Dockerfile: clone from gerrit.osmocom.org using https://
..

*/Dockerfile: clone from gerrit.osmocom.org using https://

* Do not clone using deprecated git://, use https:// instead.
* Clone from the main repo gerrit.osmocom.org (if possible).
* Use the gitiles plugin to fetch the last commit from Gerrit.

Change-Id: I204fa6e3e3ebbdb8732393b897fca35659d61ae8
---
M fpga-build/Dockerfile
M gr-gsm-master/Dockerfile
M nplab-m3ua-test/Dockerfile
M nplab-sua-test/Dockerfile
M osmo-bsc-master/Dockerfile
M osmo-bts-master/Dockerfile
M osmo-cbc-master/Dockerfile
M osmo-dev-on-debian-sid/Dockerfile
M osmo-gbproxy-master/Dockerfile
M osmo-ggsn-master/Dockerfile
M osmo-hlr-master/Dockerfile
M osmo-hnbgw-master/Dockerfile
M osmo-hnodeb-master/Dockerfile
M osmo-mgw-master/Dockerfile
M osmo-msc-master/Dockerfile
M osmo-nitb-master/Dockerfile
M osmo-ns-master/Dockerfile
M osmo-pcap-master/Dockerfile
M osmo-pcu-master/Dockerfile
M osmo-remsim-master/Dockerfile
M osmo-sgsn-master/Dockerfile
M osmo-sip-master/Dockerfile
M osmo-smlc-master/Dockerfile
M osmo-stp-master/Dockerfile
M osmo-uecups-master/Dockerfile
M osmo-upf-master/Dockerfile
M osmocom-bb-host-master/Dockerfile
27 files changed, 59 insertions(+), 56 deletions(-)

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



diff --git a/fpga-build/Dockerfile b/fpga-build/Dockerfile
index 6e975a7..1421d29 100644
--- a/fpga-build/Dockerfile
+++ b/fpga-build/Dockerfile
@@ -39,13 +39,13 @@
 ENV
PATH=/opt/fpga-toolchain/bin:/opt/xpack-riscv-none-embed-gcc-${RISCV_TOOLCHAIN_VER}/bin:${PATH}

 # Install osmo-ci.git/scripts to /usr/local/bin
-ADDhttp://git.osmocom.org/osmo-ci/patch /tmp/osmo-ci-commit
-RUNgit clone https://git.osmocom.org/osmo-ci osmo-ci && \
+ADDhttps://gerrit.osmocom.org/plugins/gitiles/osmo-ci/+/master?format=TEXT 
/tmp/osmo-ci-commit
+RUNgit clone https://gerrit.osmocom.org/osmo-ci.git && \
cp -v $(find osmo-ci/scripts \
-maxdepth 1 \
-type f ) \
   /usr/local/bin

 # Install osmo-gsm-manuals to /opt/osmo-gsm-manuals
-ADDhttp://git.osmocom.org/osmo-gsm-manuals/patch 
/tmp/osmo-gsm-manuals-commit
-RUNgit -C /opt clone https://git.osmocom.org/osmo-gsm-manuals
+ADD
https://gerrit.osmocom.org/plugins/gitiles/osmo-gsm-manuals/+/master?format=TEXT
 /tmp/osmo-gsm-manuals-commit
+RUNgit -C /opt clone https://gerrit.osmocom.org/osmo-gsm-manuals
diff --git a/gr-gsm-master/Dockerfile b/gr-gsm-master/Dockerfile
index f0e4e97..3301bfd 100644
--- a/gr-gsm-master/Dockerfile
+++ b/gr-gsm-master/Dockerfile
@@ -13,8 +13,8 @@

 ARGGR_GSM_BRANCH="master"

-RUNgit clone git://git.osmocom.org/gr-gsm
-ADD http://git.osmocom.org/gr-gsm/patch?h=$GR_GSM_BRANCH /tmp/commit-gr-gsm
+RUNgit clone https://gerrit.osmocom.org/gr-gsm
+ADD
https://gerrit.osmocom.org/plugins/gitiles/gr-gsm/+/$GR_GSM_BRANCH?format=TEXT 
/tmp/commit-gr-gsm

 RUNcd gr-gsm \
&& git fetch && git checkout -f -B $GR_GSM_BRANCH origin/$GR_GSM_BRANCH 
\
diff --git a/nplab-m3ua-test/Dockerfile b/nplab-m3ua-test/Dockerfile
index 1a53329..2f6ad93 100644
--- a/nplab-m3ua-test/Dockerfile
+++ b/nplab-m3ua-test/Dockerfile
@@ -2,7 +2,7 @@
 FROM $USER/sigtran-tests


-RUNcd /tmp && git clone git://git.osmocom.org/nplab/m3ua-testtool
+RUNcd /tmp && git clone https://git.osmocom.org/nplab/m3ua-testtool
 ADDhttp://git.osmocom.org/nplab/m3ua-testtool/patch/?h=laforge/python3 
/tmp/commit
 RUNcd /tmp/m3ua-testtool && \
git fetch && \
diff --git a/nplab-sua-test/Dockerfile b/nplab-sua-test/Dockerfile
index 931623b..6bb3ad2 100644
--- a/nplab-sua-test/Dockerfile
+++ b/nplab-sua-test/Dockerfile
@@ -2,7 +2,7 @@
 FROM $USER/sigtran-tests


-RUNcd /tmp && git clone git://git.osmocom.org/nplab/sua-testtool
+RUNcd /tmp && git clone https://git.osmocom.org/nplab/sua-testtool
 ADDhttp://git.osmocom.org/nplab/sua-testtool/patch/?h=laforge/python3 
/tmp/commit
 RUNcd /tmp/sua-testtool && \
git fetch && \
diff --git a/osmo-bsc-master/Dockerfile b/osmo-bsc-master/Dockerfile
index 32ded30..65ec5d4 100644
--- a/osmo-bsc-master/Dockerfile
+++ b/osmo-bsc-master/Dockerfile
@@ -36,8 +36,8 @@

 ARGOSMO_BSC_BRANCH="master"

-RUNgit clone git://git.osmocom.org/osmo-bsc.git
-ADDhttp://git.osmocom.org/osmo-bsc/patch?h=$OSMO_BSC_BRANCH 
/tmp/commit-osmo-bsc
+RUNgit clone https://gerrit.osmocom.org/osmo-bsc.git
+ADD
https://gerrit.osmocom.org/plugins/gitiles/osmo-bsc/+/$OSMO_BSC_BRANCH?format=TEXT
 /tmp/commit-osmo-bsc

 RUNcd osmo-bsc && \
git fetch && git checkout $OSMO_BSC_BRANCH && \
diff --git a/osmo-bts-master/Dockerfile b/osmo-bts-master/Dockerfile
index 67dd75f..8c43973 100644
--- a/osmo-bts-master

Change in libosmo-gprs[master]: sndcp: Fix wrong prim op passed in osmo_gprs_sndcp_prim_alloc_sn_xid_...

2023-01-12 Thread fixeria
Attention is currently required from: pespin.
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmo-gprs/+/30951 )

Change subject: sndcp: Fix wrong prim op passed in 
osmo_gprs_sndcp_prim_alloc_sn_xid_rsp()
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/libosmo-gprs/+/30951
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-gprs
Gerrit-Branch: master
Gerrit-Change-Id: I0644bf481c06a2cfc1d9f57995eefedf36e8b839
Gerrit-Change-Number: 30951
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Thu, 12 Jan 2023 14:44:18 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in libosmo-gprs[master]: sndcp: Initial support for async SN-XID.ind and SN-XID.rsp

2023-01-12 Thread fixeria
Attention is currently required from: laforge, pespin.
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmo-gprs/+/30907 )

Change subject: sndcp: Initial support for async SN-XID.ind and SN-XID.rsp
..


Patch Set 4: Code-Review+2

(2 comments)

File src/sndcp/sndcp.c:

https://gerrit.osmocom.org/c/libosmo-gprs/+/30907/comment/ef44c1bb_bff1cc1c
PS2, Line 724: compo_fields
> comp_fields
Done


File src/sndcp/sndcp_prim.c:

https://gerrit.osmocom.org/c/libosmo-gprs/+/30907/comment/ea37f495_b9599816
PS3, Line 224: PRIM_OP_RESPONSE
> (would be cleaner to do this in a separate patch)
Done



--
To view, visit https://gerrit.osmocom.org/c/libosmo-gprs/+/30907
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-gprs
Gerrit-Branch: master
Gerrit-Change-Id: I0a5069fd3dc0d6c3dd28aeae09b51c49dd8be92d
Gerrit-Change-Number: 30907
Gerrit-PatchSet: 4
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-CC: daniel 
Gerrit-CC: laforge 
Gerrit-CC: lynxis lazus 
Gerrit-Attention: laforge 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Thu, 12 Jan 2023 14:44:50 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: Yes
Comment-In-Reply-To: laforge 
Comment-In-Reply-To: fixeria 
Gerrit-MessageType: comment


Change in libosmo-gprs[master]: sndcp: Initial support for async SN-XID.ind and SN-XID.rsp

2023-01-12 Thread fixeria
Attention is currently required from: laforge, pespin.
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmo-gprs/+/30907 )

Change subject: sndcp: Initial support for async SN-XID.ind and SN-XID.rsp
..


Patch Set 4: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/libosmo-gprs/+/30907
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-gprs
Gerrit-Branch: master
Gerrit-Change-Id: I0a5069fd3dc0d6c3dd28aeae09b51c49dd8be92d
Gerrit-Change-Number: 30907
Gerrit-PatchSet: 4
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-CC: daniel 
Gerrit-CC: laforge 
Gerrit-CC: lynxis lazus 
Gerrit-Attention: laforge 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Thu, 12 Jan 2023 14:45:05 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmocom-bb[master]: layer23: Add VTY supports for l23_apps

2023-01-12 Thread pespin
Attention is currently required from: fixeria.
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/30950 )

Change subject: layer23: Add VTY supports for l23_apps
..


Patch Set 1:

(2 comments)

File src/host/layer23/src/common/main.c:

https://gerrit.osmocom.org/c/osmocom-bb/+/30950/comment/0ea8aa82_b4a1bb65
PS1, Line 271: handle_options
> I may be missing something, but I believe option parsing, config parsing, and 
> setting up the VTY sho […]
It doesn't take VTY config anyway. It's chicken an egg problem we have in all 
apps.
The idea anyway is that l23_app_info() mostly initializes memory, but doesn't 
"open" stuff which may be prone to errors, etc. that will be done in new 
l23_app_start() API, which is called after cmdline and VTY parsing.


https://gerrit.osmocom.org/c/osmocom-bb/+/30950/comment/f0d79599_f806c3c8
PS1, Line 331: talloc_free(config_file
> This looks wrong to me. […]
Ack



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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Ife3a3373e5a9c0c8e5959ac714e140e72d6c363a
Gerrit-Change-Number: 30950
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Thu, 12 Jan 2023 14:49:38 +
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: fixeria 
Gerrit-MessageType: comment


Change in osmocom-bb[master]: modem: send CHANNEL REQUEST from modem_rx_bcch()

2023-01-12 Thread fixeria
fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/30952 )


Change subject: modem: send CHANNEL REQUEST from modem_rx_bcch()
..

modem: send CHANNEL REQUEST from modem_rx_bcch()

Sending CHANNEL REQUEST from handle_si13() was a bad idea because
this function returns early if SI13 was received before SI1.

Change-Id: I21f1d68cb9b1d20b356697ba1efe28c3d87fa004
Fixes: 49d993e4abdd8fac8b111e92078563fd9bb28df1
Related: OS#5500
---
M src/host/layer23/src/modem/app_modem.c
1 file changed, 24 insertions(+), 15 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/52/30952/1

diff --git a/src/host/layer23/src/modem/app_modem.c 
b/src/host/layer23/src/modem/app_modem.c
index ec267e5..8af3243 100644
--- a/src/host/layer23/src/modem/app_modem.c
+++ b/src/host/layer23/src/modem/app_modem.c
@@ -67,6 +67,26 @@
return 0x78 | (rnd & 0x07);
 }

+static int modem_tx_chan_req(struct osmocom_ms *ms, bool single_block)
+{
+   struct gsm48_rrlayer *rr = &ms->rrlayer;
+
+   OSMO_ASSERT(rr->state == GSM48_RR_ST_IDLE);
+
+   if (!app_data.si.si1)
+   return -EBUSY;
+   if (!app_data.si.gprs.supported)
+   return -ENOTSUP;
+
+   rr->cr_ra = gen_chan_req(single_block);
+   LOGP(DRR, LOGL_NOTICE, "Sending CHANNEL REQUEST (0x%02x)\n", rr->cr_ra);
+   l1ctl_tx_rach_req(ms, RSL_CHAN_RACH, 0x00, rr->cr_ra, 0,
+ app_data.ccch_mode == CCCH_MODE_COMBINED);
+
+   rr->state = GSM48_RR_ST_CONN_PEND;
+   return 0;
+}
+
 static int handle_si1(struct osmocom_ms *ms, struct msgb *msg)
 {
int rc;
@@ -147,7 +167,6 @@

 static int handle_si13(struct osmocom_ms *ms, struct msgb *msg)
 {
-   struct gsm48_rrlayer *rr = &ms->rrlayer;
int rc;

if (msgb_l3len(msg) != GSM_MACBLOCK_LEN)
@@ -159,20 +178,6 @@
if (rc != 0)
return rc;

-   /* HACK: request an Uplink TBF here (one phase access) */
-   if (rr->state == GSM48_RR_ST_IDLE) {
-   if (!app_data.si.si1)
-   return 0;
-   if (!app_data.si.gprs.supported)
-   return 0;
-
-   rr->cr_ra = gen_chan_req(false);
-   LOGP(DRR, LOGL_NOTICE, "Sending CHANNEL REQUEST (0x%02x)\n", 
rr->cr_ra);
-   l1ctl_tx_rach_req(ms, RSL_CHAN_RACH, 0x00, rr->cr_ra, 0,
- app_data.ccch_mode == CCCH_MODE_COMBINED);
-   rr->state = GSM48_RR_ST_CONN_PEND;
-   }
-
return 0;
 }

@@ -184,6 +189,10 @@
LOGP(DRR, LOGL_INFO, "BCCH message (type=0x%02x): %s\n",
 si_type, gsm48_rr_msg_name(si_type));

+   /* HACK: request an Uplink TBF here (one phase access) */
+   if (ms->rrlayer.state == GSM48_RR_ST_IDLE)
+   modem_tx_chan_req(ms, false);
+
switch (si_type) {
case GSM48_MT_RR_SYSINFO_1:
return handle_si1(ms, msg);

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I21f1d68cb9b1d20b356697ba1efe28c3d87fa004
Gerrit-Change-Number: 30952
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-MessageType: newchange


Change in osmocom-bb[master]: modem: send CHANNEL REQUEST from modem_rx_bcch()

2023-01-12 Thread pespin
Attention is currently required from: fixeria.
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/30952 )

Change subject: modem: send CHANNEL REQUEST from modem_rx_bcch()
..


Patch Set 1: Code-Review+2


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I21f1d68cb9b1d20b356697ba1efe28c3d87fa004
Gerrit-Change-Number: 30952
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-Reviewer: pespin 
Gerrit-Attention: fixeria 
Gerrit-Comment-Date: Thu, 12 Jan 2023 14:52:50 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmocom-bb[master]: modem: send CHANNEL REQUEST from modem_rx_bcch()

2023-01-12 Thread fixeria
fixeria has submitted this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/30952 )

Change subject: modem: send CHANNEL REQUEST from modem_rx_bcch()
..

modem: send CHANNEL REQUEST from modem_rx_bcch()

Sending CHANNEL REQUEST from handle_si13() was a bad idea because
this function returns early if SI13 was received before SI1.

Change-Id: I21f1d68cb9b1d20b356697ba1efe28c3d87fa004
Fixes: 49d993e4abdd8fac8b111e92078563fd9bb28df1
Related: OS#5500
---
M src/host/layer23/src/modem/app_modem.c
1 file changed, 24 insertions(+), 15 deletions(-)

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



diff --git a/src/host/layer23/src/modem/app_modem.c 
b/src/host/layer23/src/modem/app_modem.c
index ec267e5..8af3243 100644
--- a/src/host/layer23/src/modem/app_modem.c
+++ b/src/host/layer23/src/modem/app_modem.c
@@ -67,6 +67,26 @@
return 0x78 | (rnd & 0x07);
 }

+static int modem_tx_chan_req(struct osmocom_ms *ms, bool single_block)
+{
+   struct gsm48_rrlayer *rr = &ms->rrlayer;
+
+   OSMO_ASSERT(rr->state == GSM48_RR_ST_IDLE);
+
+   if (!app_data.si.si1)
+   return -EBUSY;
+   if (!app_data.si.gprs.supported)
+   return -ENOTSUP;
+
+   rr->cr_ra = gen_chan_req(single_block);
+   LOGP(DRR, LOGL_NOTICE, "Sending CHANNEL REQUEST (0x%02x)\n", rr->cr_ra);
+   l1ctl_tx_rach_req(ms, RSL_CHAN_RACH, 0x00, rr->cr_ra, 0,
+ app_data.ccch_mode == CCCH_MODE_COMBINED);
+
+   rr->state = GSM48_RR_ST_CONN_PEND;
+   return 0;
+}
+
 static int handle_si1(struct osmocom_ms *ms, struct msgb *msg)
 {
int rc;
@@ -147,7 +167,6 @@

 static int handle_si13(struct osmocom_ms *ms, struct msgb *msg)
 {
-   struct gsm48_rrlayer *rr = &ms->rrlayer;
int rc;

if (msgb_l3len(msg) != GSM_MACBLOCK_LEN)
@@ -159,20 +178,6 @@
if (rc != 0)
return rc;

-   /* HACK: request an Uplink TBF here (one phase access) */
-   if (rr->state == GSM48_RR_ST_IDLE) {
-   if (!app_data.si.si1)
-   return 0;
-   if (!app_data.si.gprs.supported)
-   return 0;
-
-   rr->cr_ra = gen_chan_req(false);
-   LOGP(DRR, LOGL_NOTICE, "Sending CHANNEL REQUEST (0x%02x)\n", 
rr->cr_ra);
-   l1ctl_tx_rach_req(ms, RSL_CHAN_RACH, 0x00, rr->cr_ra, 0,
- app_data.ccch_mode == CCCH_MODE_COMBINED);
-   rr->state = GSM48_RR_ST_CONN_PEND;
-   }
-
return 0;
 }

@@ -184,6 +189,10 @@
LOGP(DRR, LOGL_INFO, "BCCH message (type=0x%02x): %s\n",
 si_type, gsm48_rr_msg_name(si_type));

+   /* HACK: request an Uplink TBF here (one phase access) */
+   if (ms->rrlayer.state == GSM48_RR_ST_IDLE)
+   modem_tx_chan_req(ms, false);
+
switch (si_type) {
case GSM48_MT_RR_SYSINFO_1:
return handle_si1(ms, msg);

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I21f1d68cb9b1d20b356697ba1efe28c3d87fa004
Gerrit-Change-Number: 30952
Gerrit-PatchSet: 2
Gerrit-Owner: fixeria 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmocom-bb[master]: layer23: Add VTY supports for l23_apps

2023-01-12 Thread pespin
Attention is currently required from: fixeria.
Hello Jenkins Builder, fixeria,

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

https://gerrit.osmocom.org/c/osmocom-bb/+/30950

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

Change subject: layer23: Add VTY supports for l23_apps
..

layer23: Add VTY supports for l23_apps

Initial VTY "boilerplate" code for modem app is already added in
this commit as a showcase what's needed by an app to have the VTY
config file read and VTY interface initialized.

Change-Id: Ife3a3373e5a9c0c8e5959ac714e140e72d6c363a
---
M src/host/layer23/include/osmocom/bb/common/l23_app.h
M src/host/layer23/src/common/main.c
M src/host/layer23/src/misc/Makefile.am
M src/host/layer23/src/modem/app_modem.c
4 files changed, 78 insertions(+), 22 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/50/30950/2
--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/30950
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Ife3a3373e5a9c0c8e5959ac714e140e72d6c363a
Gerrit-Change-Number: 30950
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria 
Gerrit-Attention: fixeria 
Gerrit-MessageType: newpatchset


Change in osmo-bsc[master]: pcu_sock: guard against too many TRX

2023-01-12 Thread dexter
dexter has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/30873 )

Change subject: pcu_sock: guard against too many TRX
..

pcu_sock: guard against too many TRX

The pcuif only supports a limited but sufficient number of TRXs. When
filling in the TRX array in info_ind, we must guard against overflowing
the maximum number of TRXs

Change-Id: I351080a112f3d3fdf833ee7fa0d77c4cd1d13e42
Related: OS#5198
---
M src/osmo-bsc/pcu_sock.c
1 file changed, 6 insertions(+), 0 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/osmo-bsc/pcu_sock.c b/src/osmo-bsc/pcu_sock.c
index 1dcab56..ab3b7d5 100644
--- a/src/osmo-bsc/pcu_sock.c
+++ b/src/osmo-bsc/pcu_sock.c
@@ -226,6 +226,12 @@
trx = gsm_bts_trx_num(bts, i);
if (!trx)
continue;
+   if (trx->nr >= ARRAY_SIZE(info_ind->trx)) {
+   LOG_TRX(trx, DPCU, LOGL_NOTICE, "PCU interface (version 
%u) "
+   "cannot handle more than %zu transceivers => 
skipped\n",
+   PCU_IF_VERSION, ARRAY_SIZE(info_ind->trx));
+   break;
+   }
info_ind->trx[i].hlayer1 = 0x2342;
info_ind->trx[i].pdch_mask = 0;
info_ind->trx[i].arfcn = trx->arfcn;



5 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted 
one.
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/30873
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: I351080a112f3d3fdf833ee7fa0d77c4cd1d13e42
Gerrit-Change-Number: 30873
Gerrit-PatchSet: 6
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmo-bsc[master]: pcu_sock: move code that fills in trx info to helper function

2023-01-12 Thread dexter
dexter has submitted this change. ( 
https://gerrit.osmocom.org/c/osmo-bsc/+/30874 )

Change subject: pcu_sock: move code that fills in trx info to helper function
..

pcu_sock: move code that fills in trx info to helper function

The function pcu_tx_info_ind() fills the trx information in the info
indication. Since the function is already quite long, move the trx
related part into a sperate helper function.

Change-Id: Ic30185c9364adcc61d0a9d3483b0550ac1cdf894
Related: OS#5198
---
M src/osmo-bsc/pcu_sock.c
1 file changed, 35 insertions(+), 26 deletions(-)

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



diff --git a/src/osmo-bsc/pcu_sock.c b/src/osmo-bsc/pcu_sock.c
index ab3b7d5..ddcf66b 100644
--- a/src/osmo-bsc/pcu_sock.c
+++ b/src/osmo-bsc/pcu_sock.c
@@ -103,6 +103,39 @@
ts_info->ma_bit_len = ts->hopping.ma_len * 8 - ts->hopping.ma.cur_bit;
 }

+/* Fill the TRX parameter */
+static void info_ind_fill_trx(struct gsm_pcu_if_info_trx *trx_info, const 
struct gsm_bts_trx *trx)
+{
+   unsigned int tn;
+   const struct gsm_bts_trx_ts *ts;
+
+   trx_info->hlayer1 = 0x2342;
+   trx_info->pdch_mask = 0;
+   trx_info->arfcn = trx->arfcn;
+
+   for (tn = 0; tn < ARRAY_SIZE(trx->ts); tn++) {
+   ts = &trx->ts[tn];
+   if (ts->mo.nm_state.operational != NM_OPSTATE_ENABLED ||
+   ts->pchan_is != GSM_PCHAN_PDCH)
+   continue;
+
+   trx_info->pdch_mask |= (1 << tn);
+   trx_info->ts[tn].tsc =
+   (ts->tsc >= 0) ? ts->tsc : trx->bts->bsic & 7;
+
+   if (ts->hopping.enabled)
+   info_ind_fill_fhp(&trx_info->ts[tn], ts);
+
+   LOGP(DPCU, LOGL_INFO, "trx=%d ts=%d: PDCH is available "
+"(tsc=%u ", trx->nr, ts->nr, trx_info->ts[tn].tsc);
+   if (ts->hopping.enabled)
+   LOGPC(DPCU, LOGL_INFO, "hopping=yes hsn=%u maio=%u 
ma_bit_len=%u)\n",
+ ts->hopping.hsn, ts->hopping.maio, 
trx->ts[tn].hopping.ma.data_len - trx->ts[tn].hopping.ma.cur_bit);
+   else
+   LOGPC(DPCU, LOGL_INFO, "hopping=no arfcn=%u)\n", 
trx->arfcn);
+   }
+}
+
 /* Send BTS properties to the PCU */
 static int pcu_tx_info_ind(struct gsm_bts *bts)
 {
@@ -113,8 +146,7 @@
struct gsm_bts_sm *bts_sm;
struct gsm_gprs_nsvc *nsvc;
struct gsm_bts_trx *trx;
-   struct gsm_bts_trx_ts *ts;
-   int i, tn;
+   int i;

OSMO_ASSERT(bts);
OSMO_ASSERT(bts->network);
@@ -232,30 +264,7 @@
PCU_IF_VERSION, ARRAY_SIZE(info_ind->trx));
break;
}
-   info_ind->trx[i].hlayer1 = 0x2342;
-   info_ind->trx[i].pdch_mask = 0;
-   info_ind->trx[i].arfcn = trx->arfcn;
-   for (tn = 0; tn < ARRAY_SIZE(trx->ts); tn++) {
-   ts = &trx->ts[tn];
-   if (ts->mo.nm_state.operational != NM_OPSTATE_ENABLED ||
-   ts->pchan_is != GSM_PCHAN_PDCH)
-   continue;
-
-   info_ind->trx[i].pdch_mask |= (1 << tn);
-   info_ind->trx[i].ts[tn].tsc =
-   (ts->tsc >= 0) ? ts->tsc : bts->bsic & 
7;
-
-   if (ts->hopping.enabled)
-   info_ind_fill_fhp(&info_ind->trx[i].ts[tn], ts);
-
-   LOGP(DPCU, LOGL_INFO, "trx=%d ts=%d: PDCH is available "
-"(tsc=%u ", trx->nr, ts->nr, 
info_ind->trx[i].ts[tn].tsc);
-   if (ts->hopping.enabled)
-   LOGPC(DPCU, LOGL_INFO, "hopping=yes hsn=%u 
maio=%u ma_bit_len=%u)\n",
- ts->hopping.hsn, ts->hopping.maio, 
trx->ts[tn].hopping.ma.data_len - trx->ts[tn].hopping.ma.cur_bit);
-   else
-   LOGPC(DPCU, LOGL_INFO, "hopping=no 
arfcn=%u)\n", trx->arfcn);
-   }
+   info_ind_fill_trx(&info_ind->trx[trx->nr], trx);
}

return pcu_sock_send(bts, msg);



1 is the latest approved patch-set.
No files were changed between the latest approved patch-set and the submitted 
one.
--
To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/30874
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-bsc
Gerrit-Branch: master
Gerrit-Change-Id: Ic30185c9364adcc61d0a9d3483b0550ac1cdf894
Gerrit-Change-Number: 30874
Gerrit-PatchSet: 6
Gerrit-Owner: dexter 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter 
Gerrit-Reviewer: fixeria 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


Change in osmocom-bb[master]: cosmetic: layer23/include/common/Makefile.am: Set one item per line

2023-01-12 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/30953 )


Change subject: cosmetic: layer23/include/common/Makefile.am: Set one item per 
line
..

cosmetic: layer23/include/common/Makefile.am: Set one item per line

Change-Id: I2e385d403bd37ad9491fd421509fe7e4104225f9
---
M src/host/layer23/include/osmocom/bb/common/Makefile.am
1 file changed, 15 insertions(+), 3 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/53/30953/1

diff --git a/src/host/layer23/include/osmocom/bb/common/Makefile.am 
b/src/host/layer23/include/osmocom/bb/common/Makefile.am
index f9364cd..31bb6b6 100644
--- a/src/host/layer23/include/osmocom/bb/common/Makefile.am
+++ b/src/host/layer23/include/osmocom/bb/common/Makefile.am
@@ -1,3 +1,15 @@
-noinst_HEADERS = l1ctl.h l1l2_interface.h l23_app.h logging.h \
-networks.h gps.h sysinfo.h osmocom_data.h utils.h \
-sap_proto.h sap_fsm.h sap_interface.h sim.h
+noinst_HEADERS = \
+   l1ctl.h \
+   l1l2_interface.h \
+   l23_app.h \
+   logging.h \
+   networks.h \
+   gps.h \
+   sysinfo.h \
+   osmocom_data.h \
+   utils.h \
+   sap_proto.h \
+   sap_fsm.h \
+   sap_interface.h \
+   sim.h \
+   $(NULL)

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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I2e385d403bd37ad9491fd421509fe7e4104225f9
Gerrit-Change-Number: 30953
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-MessageType: newchange


Change in osmocom-bb[master]: cosmetic: layer23/include/common/Makefile.am: Set one item per line

2023-01-12 Thread fixeria
Attention is currently required from: pespin.
fixeria has posted comments on this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/30953 )

Change subject: cosmetic: layer23/include/common/Makefile.am: Set one item per 
line
..


Patch Set 1: Code-Review+1


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I2e385d403bd37ad9491fd421509fe7e4104225f9
Gerrit-Change-Number: 30953
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: fixeria 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Thu, 12 Jan 2023 15:14:37 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


Change in osmocom-bb[master]: modem: fix modem_tx_chan_req(): check if SI13 was received

2023-01-12 Thread fixeria
fixeria has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/30954 )


Change subject: modem: fix modem_tx_chan_req(): check if SI13 was received
..

modem: fix modem_tx_chan_req(): check if SI13 was received

There was no need for this check because the channel establishment
logic was at the end of handle_si13(), so I overlooked this.

Change-Id: I829948de325461ab5d7e950493497a7537ba06ac
Fixes: 8a506dcd4e2736aac2bf30d1784f0e1f0c3a9d00
Related: OS#5500
---
M src/host/layer23/src/modem/app_modem.c
1 file changed, 2 insertions(+), 2 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/54/30954/1

diff --git a/src/host/layer23/src/modem/app_modem.c 
b/src/host/layer23/src/modem/app_modem.c
index 8af3243..ad05603 100644
--- a/src/host/layer23/src/modem/app_modem.c
+++ b/src/host/layer23/src/modem/app_modem.c
@@ -73,8 +73,8 @@

OSMO_ASSERT(rr->state == GSM48_RR_ST_IDLE);

-   if (!app_data.si.si1)
-   return -EBUSY;
+   if (!app_data.si.si1 || !app_data.si.si13)
+   return -EAGAIN;
if (!app_data.si.gprs.supported)
return -ENOTSUP;


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

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: I829948de325461ab5d7e950493497a7537ba06ac
Gerrit-Change-Number: 30954
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria 
Gerrit-MessageType: newchange


Change in libosmocore[master]: Add osmo_io with initial poll backend

2023-01-12 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/+/30934

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

Change subject: Add osmo_io with initial poll backend
..

Add osmo_io with initial poll backend

* make backend configurable for later
* segmentation callback for chunked streams
* logging target for osmo_io
* support partial writes

Change-Id: I50d73cf550d6ce8154bf827bf47408131cf5b0a0
Related: SYS#5094, OS#5751
---
M TODO-RELEASE
M include/Makefile.am
M include/osmocom/core/logging.h
A include/osmocom/core/osmo_io.h
M src/Makefile.am
M src/logging.c
A src/osmo_io.c
A src/osmo_io_internal.h
A src/osmo_io_poll.c
M tests/logging/logging_vty_test.vty
10 files changed, 854 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/34/30934/3
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/30934
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I50d73cf550d6ce8154bf827bf47408131cf5b0a0
Gerrit-Change-Number: 30934
Gerrit-PatchSet: 3
Gerrit-Owner: daniel 
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: laforge 
Gerrit-Attention: daniel 
Gerrit-MessageType: newpatchset


  1   2   >