Changes of Revision 340

libosmocore.spec Changed
x
 
1
@@ -14,13 +14,13 @@
2
 
3
 Name:           libosmocore
4
 Requires: osmocom-master
5
-Version: 1.9.0.195.dafd
6
+Version: 1.9.0.196.9975
7
 Release:        0
8
 Summary:        The Open Source Mobile Communications Core Library
9
 License:        GPL-2.0-only AND GPL-2.0-or-later AND LGPL-2.1-or-later AND AGPL-3.0-or-later
10
 Group:          Productivity/Telephony/Utilities
11
 Url:            https://osmocom.org/projects/libosmocore/wiki/Libosmocore
12
-Source: libosmocore_1.9.0.195.dafd.tar.xz
13
+Source: libosmocore_1.9.0.196.9975.tar.xz
14
 Source1: rpmlintrc
15
 BuildRequires:  automake >= 1.6
16
 BuildRequires:  libtool >= 2
17
commit_99750d5cae843e01180bc0baeafc06da78d1b0b7.txt Added
commit_dafdb1181b9f64848caa2265a563444ffcf5e370.txt Deleted
libosmocore_1.9.0.195.dafd.dsc -> libosmocore_1.9.0.196.9975.dsc Changed
22
 
1
@@ -2,7 +2,7 @@
2
 Source: libosmocore
3
 Binary: libosmocore, libosmocodec4, libosmocodec-doc, libosmocoding0, libosmocoding-doc, libosmocore21, libosmocore-doc, libosmogb14, libosmogb-doc, libosmogsm20, libosmogsm-doc, libosmoisdn0, libosmoisdn-doc, libosmovty13, libosmovty-doc, libosmoctrl0, libosmoctrl-doc, libosmosim2, libosmosim-doc, libosmousb0, libosmousb-doc, libosmocore-dev, libosmocore-utils, libosmocore-dbg
4
 Architecture: any all
5
-Version: 1.9.0.195.dafd
6
+Version: 1.9.0.196.9975
7
 Maintainer: Osmocom team <openbsc@lists.osmocom.org>
8
 Homepage: https://projects.osmocom.org/projects/libosmocore
9
 Standards-Version: 3.9.8
10
@@ -35,8 +35,8 @@
11
  libosmovty-doc deb doc optional arch=all
12
  libosmovty13 deb libs optional arch=any
13
 Checksums-Sha1:
14
- 965aa43aecc15ab0c75a9b6689276c59a08c6a9c 1110076 libosmocore_1.9.0.195.dafd.tar.xz
15
+ 8c0c45cb13bdb858c0a8699329b4f0cb7f3e7f35 1108904 libosmocore_1.9.0.196.9975.tar.xz
16
 Checksums-Sha256:
17
- 887dcc82f94dba9ebaa49ee12509a310bfc253d661a316dcb7239932554c17db 1110076 libosmocore_1.9.0.195.dafd.tar.xz
18
+ 278723259753c523e9222918bc8dc26ddaa63e960dce577107cef8ddcd0e364e 1108904 libosmocore_1.9.0.196.9975.tar.xz
19
 Files:
20
- 2ad407215c64b5df967f08362b2de0bb 1110076 libosmocore_1.9.0.195.dafd.tar.xz
21
+ a3ac1c1d4350fb4b15cbcc94a5525809 1108904 libosmocore_1.9.0.196.9975.tar.xz
22
libosmocore_1.9.0.195.dafd.tar.xz/.tarball-version -> libosmocore_1.9.0.196.9975.tar.xz/.tarball-version Changed
4
 
1
@@ -1 +1 @@
2
-1.9.0.195-dafd
3
+1.9.0.196-9975
4
libosmocore_1.9.0.195.dafd.tar.xz/debian/changelog -> libosmocore_1.9.0.196.9975.tar.xz/debian/changelog Changed
12
 
1
@@ -1,8 +1,8 @@
2
-libosmocore (1.9.0.195.dafd) unstable; urgency=medium
3
+libosmocore (1.9.0.196.9975) unstable; urgency=medium
4
 
5
   * Automatically generated changelog entry for building the Osmocom master feed
6
 
7
- -- Osmocom OBS scripts <info@osmocom.org>  Tue, 23 Apr 2024 09:42:45 +0000
8
+ -- Osmocom OBS scripts <info@osmocom.org>  Wed, 24 Apr 2024 18:57:12 +0000
9
 
10
 libosmocore (1.9.0) unstable; urgency=medium
11
 
12
libosmocore_1.9.0.195.dafd.tar.xz/include/osmocom/core/osmo_io.h -> libosmocore_1.9.0.196.9975.tar.xz/include/osmocom/core/osmo_io.h Changed
55
 
1
@@ -100,6 +100,7 @@
2
         *  \paramin msg message buffer containing the read data. Ownership is transferred to the
3
         *  call-back, and it must make sure to msgb_free() it eventually! */
4
        void (*read_cb)(struct osmo_io_fd *iofd, int res, struct msgb *msg);
5
+
6
        /*! completion call-back function when write issued via osmo_iofd_write_msgb() has completed
7
         * on fd. Only valid in OSMO_IO_FD_MODE_READ_WRITE.
8
         *  \paramin iofd on which a write() has completed.
9
@@ -108,9 +109,14 @@
10
         *  call-back; it is automatically freed after the call-back terminates! */
11
        void (*write_cb)(struct osmo_io_fd *iofd, int res,
12
                 struct msgb *msg);
13
-       /*! optional call-back function to segment the data at message boundaries. This is useful when
14
-        *  message boundaries are to be preserved over a SOCK_STREAM transport socket like TCP.  Can
15
-        *  be NULL for any application not requiring de-segmentation of received data.
16
+
17
+       /*! optional call-back function to segment the data at message boundaries.
18
+        *  \paramin msg message buffer whose data is to be segmented
19
+        *  \returns See full function description.
20
+        *
21
+        *  This is useful when message boundaries are to be preserved over a SOCK_STREAM transport
22
+        *  socket like TCP.  Can be NULL for any application not requiring de-segmentation of
23
+        *  received data.
24
         *
25
         *  The call-back needs to return the size of the next message. If it returns
26
         *  -EAGAIN or a value larger than msgb_length() (message is incomplete)
27
@@ -119,8 +125,26 @@
28
         *  If a full message was received (segmentation_cb() returns a value <= msgb_length())
29
         *  the msgb will be trimmed to size by osmo_io and forwarded to the read call-back. Any
30
         *  parsing done to the msgb by segmentation_cb() will be preserved for the read_cb()
31
-        *  (e.g. setting lxh or msgb->cb). */
32
+        *  (e.g. setting lxh or msgb->cb).
33
+        *
34
+        * Only one (or none) of both segmentation_cb and segmentation_cb2 shall be set.
35
+        * Having both set will be considered an error during iofd setup. */
36
        int (*segmentation_cb)(struct msgb *msg);
37
+
38
+       /*! optional call-back function to segment the data at message boundaries.
39
+        *  \paramin iofd handling msg
40
+        *  \paramin msg message buffer whose data is to be segmented
41
+        *  \returns See full function description.
42
+        *
43
+        *  Same as segmentation_cb above, with an extra parameter to have access to the iofd and its
44
+        *  related functionalities (eg data pointer). This is useful for users requiring to store
45
+        *  global state or access external objects while segmenting.
46
+        *
47
+        * The provided iofd shall not be freed by the user during the callback.
48
+        *
49
+        * Only one (or none) of both segmentation_cb and segmentation_cb2 shall be set.
50
+        * Having both set will be considered an error during iofd setup. */
51
+       int (*segmentation_cb2)(struct osmo_io_fd *iofd, struct msgb *msg);
52
    };
53
 
54
    /* mode OSMO_IO_FD_MODE_RECVFROM_SENDTO: */
55
libosmocore_1.9.0.195.dafd.tar.xz/src/core/osmo_io.c -> libosmocore_1.9.0.196.9975.tar.xz/src/core/osmo_io.c Changed
38
 
1
@@ -267,7 +267,7 @@
2
 */
3
 static enum iofd_seg_act iofd_handle_segmentation(struct osmo_io_fd *iofd, struct msgb *msg, struct msgb **pending_out)
4
 {
5
-   int extra_len, received_len;
6
+   int extra_len, received_len, expected_len;
7
    struct msgb *msg_pending;
8
 
9
    /* Save the start of message before segmentation_cb (which could change it) */
10
@@ -275,12 +275,15 @@
11
 
12
    received_len = msgb_length(msg);
13
 
14
-   if (!iofd->io_ops.segmentation_cb) {
15
+   if (iofd->io_ops.segmentation_cb2) {
16
+       expected_len = iofd->io_ops.segmentation_cb2(iofd, msg);
17
+   } else if (iofd->io_ops.segmentation_cb) {
18
+       expected_len = iofd->io_ops.segmentation_cb(msg);
19
+   } else {
20
        *pending_out = NULL;
21
        return IOFD_SEG_ACT_HANDLE_ONE;
22
    }
23
 
24
-   int expected_len = iofd->io_ops.segmentation_cb(msg);
25
    if (expected_len == -EAGAIN) {
26
        goto defer;
27
    } else if (expected_len < 0) {
28
@@ -599,6 +602,9 @@
29
            return false;
30
        if (ops->recvmsg_cb || ops->sendmsg_cb)
31
            return false;
32
+       /* Forbid both segementation_cb set, something is wrong: */
33
+       if (ops->segmentation_cb && ops->segmentation_cb2)
34
+           return false;
35
        break;
36
    case OSMO_IO_FD_MODE_RECVFROM_SENDTO:
37
        if (ops->read_cb || ops->write_cb)
38