Attention is currently required from: pespin.
laforge has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/libosmocore/+/41667?usp=email )
Change subject: socket: Introduce API osmo_sock_set_nonblock()
......................................................................
Patch Set 1: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41667?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: comment
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I8b9011df0ff1fe8303e1effcc9906d9c3350c66e
Gerrit-Change-Number: 41667
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Sun, 14 Dec 2025 20:49:25 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/41669?usp=email )
Change subject: pySim.esim.saip: Fix compatibility with pytohn < 3.11
......................................................................
pySim.esim.saip: Fix compatibility with pytohn < 3.11
In python up to 3.10, the byteorder argument of the int.to_bytes()
method was mandatory, even if the length of the target byte sequence
is 1 and there factually is no byteorder.
https://docs.python.org/3.10/library/stdtypes.html#int.to_bytes
vs
https://docs.python.org/3.11/library/stdtypes.html#int.to_bytes
See also: https://discourse.osmocom.org/t/assistance-required-with-saip-pysim-tool-er…
Change-Id: I8ba29d42c8d7bf0a36772cc3370eff1f6afa879f
---
M pySim/esim/saip/__init__.py
1 file changed, 3 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/69/41669/1
diff --git a/pySim/esim/saip/__init__.py b/pySim/esim/saip/__init__.py
index c7f3e75..1c0c715 100644
--- a/pySim/esim/saip/__init__.py
+++ b/pySim/esim/saip/__init__.py
@@ -183,7 +183,7 @@
self.file_type = template.file_type
self.fid = template.fid
self.sfi = template.sfi
- self.arr = template.arr.to_bytes(1)
+ self.arr = template.arr.to_bytes(1, 'big')
if hasattr(template, 'rec_len'):
self.rec_len = template.rec_len
else:
@@ -227,7 +227,7 @@
fileDescriptor['shortEFID'] = bytes([self.sfi])
if self.df_name:
fileDescriptor['dfName'] = self.df_name
- if self.arr and self.arr != self.template.arr.to_bytes(1):
+ if self.arr and self.arr != self.template.arr.to_bytes(1, 'big'):
fileDescriptor['securityAttributesReferenced'] = self.arr
if self.file_type in ['LF', 'CY']:
fdb_dec['file_type'] = 'working_ef'
@@ -264,7 +264,7 @@
if self.read_and_update_when_deact:
spfi |= 0x40 # TS 102 222 Table 5
if spfi != 0x00:
- pefi['specialFileInformation'] = spfi.to_bytes(1)
+ pefi['specialFileInformation'] = spfi.to_bytes(1, 'big')
if self.fill_pattern:
if not self.fill_pattern_repeat:
pefi['fillPattern'] = self.fill_pattern
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/41669?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I8ba29d42c8d7bf0a36772cc3370eff1f6afa879f
Gerrit-Change-Number: 41669
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge(a)osmocom.org>
falconia has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/41668?usp=email )
Change subject: gsm/rsl: add definition for TFO transparent container IE
......................................................................
gsm/rsl: add definition for TFO transparent container IE
3GPP Rel5 version of TS 48.058 RSL spec introduced a new IE named
"TFO transparent container". By this point in GSM/3GPP evolutionary
history, Abis was already treated as a de facto proprietary interface,
and the spec is silent regarding the exact bit content of this new IE.
(See vague description in section 9.3.59.) However, this IE was added
at the same time as Generic Config Frames for TFO (TS 28.062 Annex H),
hence one can reasonably infer that this IE is intended to transport
the content of these GCFs between the BTS and the BSC, with the BTS
relaying, mostly transparently, between the BSC and the TRAU channel.
Add RSL_IE_TFO_XPAR_CONT definition, to make it possible to add this
IE to CHAN ACTIV and MODE MODIFY commands (and thus enable TFO-AMR
on those E1 BTS models that implement Rel5 version thereof) and to
parse BTS response and notification messages that may also contain
this IE.
Change-Id: Ic6839827fb2bf8e401476af1d7907b577e5f094d
---
M include/osmocom/gsm/protocol/gsm_08_58.h
M src/gsm/rsl.c
2 files changed, 2 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/68/41668/1
diff --git a/include/osmocom/gsm/protocol/gsm_08_58.h b/include/osmocom/gsm/protocol/gsm_08_58.h
index 13e84ba..fe41237 100644
--- a/include/osmocom/gsm/protocol/gsm_08_58.h
+++ b/include/osmocom/gsm/protocol/gsm_08_58.h
@@ -358,6 +358,7 @@
RSL_IE_RTD,
RSL_IE_TFO_STATUS,
RSL_IE_LLP_APDU,
+ RSL_IE_TFO_XPAR_CONT,
/* Siemens vendor-specific */
RSL_IE_SIEMENS_MRPCI = 0x40,
RSL_IE_SIEMENS_PREF_AREA_TYPE = 0x43,
diff --git a/src/gsm/rsl.c b/src/gsm/rsl.c
index c7d69a1..b394a34 100644
--- a/src/gsm/rsl.c
+++ b/src/gsm/rsl.c
@@ -121,6 +121,7 @@
[RSL_IE_RTD] = { TLV_TYPE_TV },
[RSL_IE_TFO_STATUS] = { TLV_TYPE_TV },
[RSL_IE_LLP_APDU] = { TLV_TYPE_TLV },
+ [RSL_IE_TFO_XPAR_CONT] = { TLV_TYPE_TLV },
[RSL_IE_SIEMENS_MRPCI] = { TLV_TYPE_TV },
[RSL_IE_OSMO_REP_ACCH_CAP] = { TLV_TYPE_TLV },
[RSL_IE_OSMO_TRAINING_SEQUENCE] = { TLV_TYPE_TLV },
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41668?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: Ic6839827fb2bf8e401476af1d7907b577e5f094d
Gerrit-Change-Number: 41668
Gerrit-PatchSet: 1
Gerrit-Owner: falconia <falcon(a)freecalypso.org>
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/41667?usp=email )
Change subject: socket: Introduce API osmo_sock_set_nonblock()
......................................................................
socket: Introduce API osmo_sock_set_nonblock()
Change-Id: I8b9011df0ff1fe8303e1effcc9906d9c3350c66e
---
M TODO-RELEASE
M include/osmocom/core/socket.h
M src/core/libosmocore.map
M src/core/socket.c
4 files changed, 15 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/67/41667/1
diff --git a/TODO-RELEASE b/TODO-RELEASE
index 0ed7189..1562b38 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -7,3 +7,4 @@
# If any interfaces have been added since the last public release: c:r:a + 1.
# If any interfaces have been removed or changed since the last public release: c:r:0.
#library what description / commit summary line
+core added osmo_sock_set_nonblock()
diff --git a/include/osmocom/core/socket.h b/include/osmocom/core/socket.h
index ea73cda..088a444 100644
--- a/include/osmocom/core/socket.h
+++ b/include/osmocom/core/socket.h
@@ -219,6 +219,7 @@
int osmo_sock_set_dscp(int fd, uint8_t dscp);
int osmo_sock_set_priority(int fd, int prio);
+int osmo_sock_set_nonblock(int fd, int on);
int osmo_sock_sctp_get_peer_addr_info(int fd, struct sctp_paddrinfo *pinfo, size_t *pinfo_cnt);
diff --git a/src/core/libosmocore.map b/src/core/libosmocore.map
index 198b31e..166eea9 100644
--- a/src/core/libosmocore.map
+++ b/src/core/libosmocore.map
@@ -454,6 +454,7 @@
osmo_sock_multiaddr_get_name_buf;
osmo_sock_sctp_get_peer_addr_info;
osmo_sock_set_dscp;
+osmo_sock_set_nonblock;
osmo_sock_set_priority;
osmo_sock_unix_init;
osmo_sock_unix_init_ofd;
diff --git a/src/core/socket.c b/src/core/socket.c
index 915c70e..01093bb 100644
--- a/src/core/socket.c
+++ b/src/core/socket.c
@@ -133,12 +133,12 @@
static int socket_helper_tail(int sfd, unsigned int flags)
{
- int rc, on = 1;
+ int rc;
uint8_t dscp = GET_OSMO_SOCK_F_DSCP(flags);
uint8_t prio = GET_OSMO_SOCK_F_PRIO(flags);
if (flags & OSMO_SOCK_F_NONBLOCK) {
- if (ioctl(sfd, FIONBIO, (unsigned char *)&on) < 0) {
+ if (osmo_sock_set_nonblock(sfd, 1) < 0) {
LOGP(DLGLOBAL, LOGL_ERROR,
"cannot set this socket unblocking: %s\n",
strerror(errno));
@@ -2746,6 +2746,16 @@
return setsockopt(fd, SOL_SOCKET, SO_PRIORITY, &prio, sizeof(prio));
}
+/*! Set the socket as non-blocking or blocking.
+ * \param[in] fd File descriptor of the socket
+ * \param[in] on set to 1 to set as non-blocking, 0 to set as blocking.
+ * \returns 0 on success; negative on error. */
+int osmo_sock_set_nonblock(int fd, int on)
+{
+ /* and write it back to the kernel */
+ return ioctl(fd, FIONBIO, (unsigned char *)&on);
+}
+
#ifdef HAVE_LIBSCTP
/*! Fill in array of struct sctp_paddrinfo with each of the remote addresses of an SCTP socket
* \param[in] fd file descriptor of SCTP socket
--
To view, visit https://gerrit.osmocom.org/c/libosmocore/+/41667?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmocore
Gerrit-Branch: master
Gerrit-Change-Id: I8b9011df0ff1fe8303e1effcc9906d9c3350c66e
Gerrit-Change-Number: 41667
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/41666?usp=email )
Change subject: stream_srv: srv_link: Set OSMO_SOCK_F_NONBLOCK during socket creation
......................................................................
stream_srv: srv_link: Set OSMO_SOCK_F_NONBLOCK during socket creation
This should be needed to potentially avoid blocking during accept()
call.
In practice right now is not needed because osmo_fd/osmo_iofd takes care
of setting to non-blocking during registering:
* osmo_fd: osmo_fd_register() sets the fd to non-bloking.
* osmo_iofd:
** osmo_io_poll: it uses osmo_fd_register() internally, see above
** osmo_io_uring: only set to non-blocking as a side-effect of calling
osmo_fd_register() if IOFD_FLAG_NOTIFY_CONNECTED was passed.
Since for the srv_link so far always uses an osmo_fd regardless of
whether OSMO_STREAM_MODE_* is used, in practice we are safed by
osmo_fd_register().
In any case, better pass the flag at socket creation time so it's
already applied then, instead of relying on osmo_fd_register() as a
side-effect, specially if in the future we switch the listen socket to
be operated over osmo_io_uring.
Change-Id: I98a6ef55a0a7289b9eeb7e8062e9afa4d87f51eb
---
M src/stream_srv.c
1 file changed, 4 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/66/41666/1
diff --git a/src/stream_srv.c b/src/stream_srv.c
index 6f86cfd..95ddb1b 100644
--- a/src/stream_srv.c
+++ b/src/stream_srv.c
@@ -584,7 +584,7 @@
switch (link->sk_domain) {
case AF_UNIX:
- ret = osmo_sock_unix_init(link->sk_type, 0, link->addr[0], OSMO_SOCK_F_BIND);
+ ret = osmo_sock_unix_init(link->sk_type, 0, link->addr[0], OSMO_SOCK_F_BIND | OSMO_SOCK_F_NONBLOCK);
break;
case AF_UNSPEC:
case AF_INET:
@@ -594,12 +594,13 @@
case IPPROTO_SCTP:
ret = osmo_sock_init2_multiaddr2(link->sk_domain, link->sk_type, link->proto,
(const char **)link->addr, link->addrcnt, link->port,
- NULL, 0, 0, OSMO_SOCK_F_BIND, &link->ma_pars);
+ NULL, 0, 0, OSMO_SOCK_F_BIND | OSMO_SOCK_F_NONBLOCK,
+ &link->ma_pars);
break;
#endif
default:
ret = osmo_sock_init(link->sk_domain, link->sk_type, link->proto,
- link->addr[0], link->port, OSMO_SOCK_F_BIND);
+ link->addr[0], link->port, OSMO_SOCK_F_BIND | OSMO_SOCK_F_NONBLOCK);
}
break;
default:
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/41666?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I98a6ef55a0a7289b9eeb7e8062e9afa4d87f51eb
Gerrit-Change-Number: 41666
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>