lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

January 2025

  • 1 participants
  • 1491 discussions
[M] Change in pysim[master]: global_platform: add new command "install_cap"
by dexter 20 Jan '25

20 Jan '25
Attention is currently required from: laforge. Hello Jenkins Builder, laforge, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/pysim/+/39199?usp=email to look at the new patch set (#7). The following approvals got outdated and were removed: Verified+1 by Jenkins Builder Change subject: global_platform: add new command "install_cap" ...................................................................... global_platform: add new command "install_cap" Installing JAVA-card applets from a CAP file is a multi step process, which is difficult when done manually. Fortunately it is easy to automate the process, so let's add a dedicated command for that. Change-Id: I6cbd37f0fad5579b20e83c27349bd5acc129e6d0 Related: OS#6679 --- A docs/cap-tutorial.rst M docs/shell.rst M pySim/global_platform/__init__.py A pySim/global_platform/install_param.py M tests/unittests/test_globalplatform.py 5 files changed, 241 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/99/39199/7 -- To view, visit https://gerrit.osmocom.org/c/pysim/+/39199?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I6cbd37f0fad5579b20e83c27349bd5acc129e6d0 Gerrit-Change-Number: 39199 Gerrit-PatchSet: 7 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: laforge <laforge(a)osmocom.org>
1 0
0 0
[M] Change in osmo-pcap[master]: server: zero-copy msgb from tcp read to file write
by osmith 20 Jan '25

20 Jan '25
Attention is currently required from: pespin. osmith has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-pcap/+/39370?usp=email ) Change subject: server: zero-copy msgb from tcp read to file write ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-pcap/+/39370?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-pcap Gerrit-Branch: master Gerrit-Change-Id: Iae9b9eaec42ad8ec86d1a8144d676115fa057766 Gerrit-Change-Number: 39370 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Mon, 20 Jan 2025 08:31:20 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[M] Change in osmo-pcap[master]: server: Implement non-blocking write to pcap file with osmo_io
by osmith 20 Jan '25

20 Jan '25
Attention is currently required from: pespin. osmith has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-pcap/+/39367?usp=email ) Change subject: server: Implement non-blocking write to pcap file with osmo_io ...................................................................... Patch Set 2: Code-Review+1 (2 comments) File src/osmo_pcap_wr_file.c: https://gerrit.osmocom.org/c/osmo-pcap/+/39367/comment/7e7a7854_166df88a?us… : PS2, Line 47: werf wrf? File src/osmo_server_core.c: https://gerrit.osmocom.org/c/osmo-pcap/+/39367/comment/d2a88811_d106c7f0?us… : PS2, Line 262: lossing losing -- To view, visit https://gerrit.osmocom.org/c/osmo-pcap/+/39367?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-pcap Gerrit-Branch: master Gerrit-Change-Id: I098a9455a2a4cc626444e6fc13aa88c4cc9694f0 Gerrit-Change-Number: 39367 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Mon, 20 Jan 2025 08:26:19 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes
1 0
0 0
[L] Change in osmo-pcap[master]: server: Introduce struct osmo_pcap_wr_file
by osmith 20 Jan '25

20 Jan '25
Attention is currently required from: laforge, pespin. osmith has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-pcap/+/39353?usp=email ) Change subject: server: Introduce struct osmo_pcap_wr_file ...................................................................... Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-pcap/+/39353?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-pcap Gerrit-Branch: master Gerrit-Change-Id: I5244fbc7a5dc047e1f5f7b77954cbb9c1f610181 Gerrit-Change-Number: 39353 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Mon, 20 Jan 2025 08:18:14 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[M] Change in osmo-pcap[master]: server: Use osmo_stream_srv for non-tls read tcp sock
by osmith 20 Jan '25

20 Jan '25
Attention is currently required from: pespin. osmith has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-pcap/+/39343?usp=email ) Change subject: server: Use osmo_stream_srv for non-tls read tcp sock ...................................................................... Patch Set 4: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-pcap/+/39343?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-pcap Gerrit-Branch: master Gerrit-Change-Id: I537620fcad6c8e65206a41a1c21bd4b6453fbed4 Gerrit-Change-Number: 39343 Gerrit-PatchSet: 4 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Mon, 20 Jan 2025 08:12:28 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[M] Change in osmocom-bb[master]: [WIP] Revert "Revert "trx_toolkit/transceiver.py: implement the trans...
by Jenkins Builder 19 Jan '25

19 Jan '25
Attention is currently required from: kirr. Jenkins Builder has posted comments on this change by kirr. ( https://gerrit.osmocom.org/c/osmocom-bb/+/39328?usp=email ) Change subject: [WIP] Revert "Revert "trx_toolkit/transceiver.py: implement the transmit burst queue"" ...................................................................... Patch Set 3: (1 comment) File src/target/trx_toolkit/transceiver.py: Robot Comment from checkpatch (run ID jenkins-gerrit-lint-21093): https://gerrit.osmocom.org/c/osmocom-bb/+/39328/comment/1b044537_073d46e4?u… : PS3, Line 134: a L12TRX message on the TRXD (data) inteface, so it gets queued by 'inteface' may be misspelled - perhaps 'interface'? -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/39328?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I41291708effdd2c767be680fff22ffbd9a56815e Gerrit-Change-Number: 39328 Gerrit-PatchSet: 3 Gerrit-Owner: kirr <kirr(a)nexedi.com> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-CC: osmith <osmith(a)sysmocom.de> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: kirr <kirr(a)nexedi.com> Gerrit-Comment-Date: Sun, 19 Jan 2025 20:38:26 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No
1 0
0 0
[M] Change in osmocom-bb[master]: [WIP] Revert "Revert "trx_toolkit/transceiver.py: implement the trans...
by kirr 19 Jan '25

19 Jan '25
Attention is currently required from: kirr. Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmocom-bb/+/39328?usp=email to look at the new patch set (#3). The following approvals got outdated and were removed: Verified-1 by Jenkins Builder Change subject: [WIP] Revert "Revert "trx_toolkit/transceiver.py: implement the transmit burst queue"" ...................................................................... [WIP] Revert "Revert "trx_toolkit/transceiver.py: implement the transmit burst queue"" This reverts commit d4ed09df57b3461470af501e9687ddd80eb78838, reinstating tx queue into fake_trx. It is ok to do so because, as explained in abc63d8d (trx_toolkit/clck_gen.py: Fix clock generator not to accumulate timing error), the reason for GSM clock jitter problem was timing error accumulation in CLCKgen, not problems with py threading.Event. Note: this restores original tx queue implementation basically as-is with only resolve minor conflicts during the revert. The original tx queue implementation wastes CPU cycles though because it linearly scans the whole tx queue at every TDMA frame. If that CPU usage becomes a real problem it should be straightforward to fix by reworking tx queue to use priority queue instead of unordered array via heapq module from standard library. See https://docs.python.org/3/library/heapq.html for details. (WIP because I did not tested this patch fully as I could not yet organize a working fake_trx setup due to not fully done homework yet) Related: OS#4658, OS#6672 Change-Id: I41291708effdd2c767be680fff22ffbd9a56815e --- M src/target/trx_toolkit/fake_trx.py M src/target/trx_toolkit/transceiver.py 2 files changed, 72 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmocom-bb refs/changes/28/39328/3 -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/39328?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: I41291708effdd2c767be680fff22ffbd9a56815e Gerrit-Change-Number: 39328 Gerrit-PatchSet: 3 Gerrit-Owner: kirr <kirr(a)nexedi.com> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-CC: osmith <osmith(a)sysmocom.de> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: kirr <kirr(a)nexedi.com>
1 0
0 0
[XS] Change in osmo-pcap[master]: server: Correct error check calling osmo_pcap_conn_process_data()
by pespin 18 Jan '25

18 Jan '25
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-pcap/+/39366?usp=email ) Change subject: server: Correct error check calling osmo_pcap_conn_process_data() ...................................................................... server: Correct error check calling osmo_pcap_conn_process_data() The function is not expected to return >0, so clarify it when calling it. Change-Id: I8338b886db7bb7996229d78fe19025ebe5d0c5f8 --- M src/osmo_server_network.c 1 file changed, 1 insertion(+), 1 deletion(-) Approvals: laforge: Looks good to me, approved pespin: Verified diff --git a/src/osmo_server_network.c b/src/osmo_server_network.c index c93ce6d..5b31958 100644 --- a/src/osmo_server_network.c +++ b/src/osmo_server_network.c @@ -252,7 +252,7 @@ if ((rc = validate_link_data(conn, data)) < 0) return rc; - if ((rc = osmo_pcap_conn_process_data(conn, &data->data[0], data->len))) + if ((rc = osmo_pcap_conn_process_data(conn, &data->data[0], data->len)) < 0) return rc; return 1; } -- To view, visit https://gerrit.osmocom.org/c/osmo-pcap/+/39366?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-pcap Gerrit-Branch: master Gerrit-Change-Id: I8338b886db7bb7996229d78fe19025ebe5d0c5f8 Gerrit-Change-Number: 39366 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[XS] Change in osmo-pcap[master]: server: Correct error check calling osmo_pcap_conn_process_data()
by pespin 18 Jan '25

18 Jan '25
Attention is currently required from: daniel. pespin has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-pcap/+/39366?usp=email ) Change subject: server: Correct error check calling osmo_pcap_conn_process_data() ...................................................................... Patch Set 1: Verified+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-pcap/+/39366?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-pcap Gerrit-Branch: master Gerrit-Change-Id: I8338b886db7bb7996229d78fe19025ebe5d0c5f8 Gerrit-Change-Number: 39366 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: daniel <dwillmann(a)sysmocom.de> Gerrit-Comment-Date: Sat, 18 Jan 2025 22:59:31 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes
1 0
0 0
[M] Change in libosmo-netif[master]: stream: Introduce osmo_stream_{cli,srv}_set_segmentation_cb2
by pespin 18 Jan '25

18 Jan '25
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/39316?usp=email ) Change subject: stream: Introduce osmo_stream_{cli,srv}_set_segmentation_cb2 ...................................................................... stream: Introduce osmo_stream_{cli,srv}_set_segmentation_cb2 This is useful for users requiring to store global state or access external objects while segmenting. For instance, figure out if too much data has been received according to whatever external limits are expected according to configuration. Change-Id: I6e8dd6ece13397074075f05a1a0a8dbdd80d8848 --- M TODO-RELEASE M include/osmocom/netif/stream.h M src/stream_cli.c M src/stream_srv.c 4 files changed, 105 insertions(+), 23 deletions(-) Approvals: fixeria: Looks good to me, but someone else must approve Jenkins Builder: Verified pespin: Looks good to me, approved laforge: Looks good to me, but someone else must approve osmith: Looks good to me, but someone else must approve diff --git a/TODO-RELEASE b/TODO-RELEASE index 5092ee7..e66b421 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -9,4 +9,5 @@ #library what description / commit summary line libosmo-netif add API osmo_stream_cli_set_{ip_dscp,priority}(), osmo_stream_srv_link_set_{ip_dscp,priority}() libosmo-netif add API osmo-stream_cli_set_tx_queue_max_length(), osmo_stream_srv_link_set_tx_queue_max_length() -libosmo-netif add API struct osmo_ipa_ka_fsm_inst \ No newline at end of file +libosmo-netif add API struct osmo_ipa_ka_fsm_inst +libosmo-netif add API osmo_stream_{cli,srv}_set_segmentation_cb2() diff --git a/include/osmocom/netif/stream.h b/include/osmocom/netif/stream.h index f63560a..e793a26 100644 --- a/include/osmocom/netif/stream.h +++ b/include/osmocom/netif/stream.h @@ -117,6 +117,7 @@ typedef int (*osmo_stream_srv_read_cb2_t)(struct osmo_stream_srv *conn, int res, struct msgb *msg); typedef int (*osmo_stream_srv_segmentation_cb_t)(struct msgb *msg); +typedef int (*osmo_stream_srv_segmentation_cb2_t)(struct osmo_stream_srv *conn, struct msgb *msg); struct osmo_stream_srv *osmo_stream_srv_create(void *ctx, struct osmo_stream_srv_link *link, int fd, osmo_stream_srv_read_cb_t read_cb, @@ -138,7 +139,8 @@ void osmo_stream_srv_set_flush_and_destroy(struct osmo_stream_srv *conn); void osmo_stream_srv_set_data(struct osmo_stream_srv *conn, void *data); -void osmo_stream_srv_set_segmentation_cb(struct osmo_stream_srv *conn, osmo_stream_srv_segmentation_cb_t segmentation_cb); +void osmo_stream_srv_set_segmentation_cb(struct osmo_stream_srv *conn, osmo_stream_srv_segmentation_cb_t segmentation_cb) OSMO_DEPRECATED("Use osmo_stream_srv_set_segmentation_cb2() instead"); +void osmo_stream_srv_set_segmentation_cb2(struct osmo_stream_srv *conn, osmo_stream_srv_segmentation_cb2_t segmentation_cb2); void osmo_stream_srv_send(struct osmo_stream_srv *conn, struct msgb *msg); int osmo_stream_srv_recv(struct osmo_stream_srv *conn, struct msgb *msg); @@ -197,6 +199,7 @@ typedef int (*osmo_stream_cli_read_cb2_t)(struct osmo_stream_cli *cli, int res, struct msgb *msg); typedef int (*osmo_stream_cli_segmentation_cb_t)(struct msgb *msg); +typedef int (*osmo_stream_cli_segmentation_cb2_t)(struct osmo_stream_cli *cli, struct msgb *msg); void osmo_stream_cli_set_name(struct osmo_stream_cli *cli, const char *name); const char *osmo_stream_cli_get_name(const struct osmo_stream_cli *cli); @@ -224,7 +227,8 @@ void osmo_stream_cli_set_disconnect_cb(struct osmo_stream_cli *cli, osmo_stream_cli_disconnect_cb_t disconnect_cb); void osmo_stream_cli_set_read_cb(struct osmo_stream_cli *cli, osmo_stream_cli_read_cb_t read_cb); void osmo_stream_cli_set_read_cb2(struct osmo_stream_cli *cli, osmo_stream_cli_read_cb2_t read_cb); -void osmo_stream_cli_set_segmentation_cb(struct osmo_stream_cli *cli, osmo_stream_cli_segmentation_cb_t segmentation_cb); +void osmo_stream_cli_set_segmentation_cb(struct osmo_stream_cli *cli, osmo_stream_cli_segmentation_cb_t segmentation_cb) OSMO_DEPRECATED("Use osmo_stream_cli_set_segmentation_cb2() instead"); +void osmo_stream_cli_set_segmentation_cb2(struct osmo_stream_cli *cli, osmo_stream_cli_segmentation_cb2_t segmentation_cb2); void osmo_stream_cli_reconnect(struct osmo_stream_cli *cli); bool osmo_stream_cli_is_connected(struct osmo_stream_cli *cli); diff --git a/src/stream_cli.c b/src/stream_cli.c index 48a8858..586b1b0 100644 --- a/src/stream_cli.c +++ b/src/stream_cli.c @@ -117,6 +117,7 @@ osmo_stream_cli_read_cb_t read_cb; osmo_stream_cli_read_cb2_t iofd_read_cb; osmo_stream_cli_segmentation_cb_t segmentation_cb; + osmo_stream_cli_segmentation_cb2_t segmentation_cb2; void *data; int flags; int reconnect_timeout; @@ -511,7 +512,6 @@ cli->state = STREAM_CLI_STATE_CLOSED; osmo_timer_setup(&cli->timer, cli_timer_cb, cli); cli->reconnect_timeout = 5; /* default is 5 seconds. */ - cli->segmentation_cb = NULL; INIT_LLIST_HEAD(&cli->tx_queue); cli->tx_queue_max_length = 1024; /* Default tx queue size, msgbs. */ @@ -598,8 +598,6 @@ static const struct osmo_io_ops osmo_stream_cli_ioops = { .read_cb = stream_cli_iofd_read_cb, .write_cb = stream_cli_iofd_write_cb, - - .segmentation_cb = NULL, }; #ifdef HAVE_LIBSCTP @@ -659,8 +657,6 @@ static const struct osmo_io_ops osmo_stream_cli_ioops_sctp = { .recvmsg_cb = stream_cli_iofd_recvmsg_cb, .sendmsg_cb = stream_cli_iofd_write_cb, - - .segmentation_cb = NULL, }; #endif @@ -795,28 +791,58 @@ cli->flags |= OSMO_STREAM_CLI_F_RECONF; } +/* Callback from iofd, forward to stream_cli user: */ +static int stream_cli_iofd_segmentation_cb2(struct osmo_io_fd *iofd, struct msgb *msg) +{ + struct osmo_stream_cli *cli = osmo_iofd_get_data(iofd); + if (cli->segmentation_cb2) + return cli->segmentation_cb2(cli, msg); + if (cli->segmentation_cb) + return cli->segmentation_cb(msg); + OSMO_ASSERT(0); + return 0; +} + /* Configure client side segmentation for the iofd */ -static void configure_cli_segmentation_cb(struct osmo_stream_cli *cli, - osmo_stream_cli_segmentation_cb_t segmentation_cb) +static void configure_cli_segmentation_cb(struct osmo_stream_cli *cli) { /* Copy default settings */ struct osmo_io_ops client_ops; osmo_iofd_get_ioops(cli->iofd, &client_ops); /* Set segmentation cb for this client */ - client_ops.segmentation_cb = segmentation_cb; + if (cli->segmentation_cb || cli->segmentation_cb2) + client_ops.segmentation_cb2 = stream_cli_iofd_segmentation_cb2; + else + client_ops.segmentation_cb2 = NULL; osmo_iofd_set_ioops(cli->iofd, &client_ops); } /*! Set the segmentation callback for the client. * \param[in,out] cli Stream Client to modify * \param[in] segmentation_cb Target segmentation callback + * + * DEPRECATED: Use osmo_cli_set_segmentation_cb2() instead. */ void osmo_stream_cli_set_segmentation_cb(struct osmo_stream_cli *cli, osmo_stream_cli_segmentation_cb_t segmentation_cb) { cli->segmentation_cb = segmentation_cb; + cli->segmentation_cb2 = NULL; if (cli->iofd) /* Otherwise, this will be done in osmo_stream_cli_open() */ - configure_cli_segmentation_cb(cli, segmentation_cb); + configure_cli_segmentation_cb(cli); +} + +/*! Set the segmentation callback for the client. + * \param[in,out] cli Stream Client to modify + * \param[in] segmentation_cb2 Target segmentation callback + */ +void osmo_stream_cli_set_segmentation_cb2(struct osmo_stream_cli *cli, + osmo_stream_cli_segmentation_cb2_t segmentation_cb2) +{ + cli->segmentation_cb = NULL; + cli->segmentation_cb2 = segmentation_cb2; + if (cli->iofd) /* Otherwise, this will be done in osmo_stream_cli_open() */ + configure_cli_segmentation_cb(cli); } /*! Set the socket type for the stream server link. @@ -1257,7 +1283,7 @@ osmo_iofd_set_txqueue_max_length(cli->iofd, cli->tx_queue_max_length); osmo_iofd_notify_connected(cli->iofd); - configure_cli_segmentation_cb(cli, cli->segmentation_cb); + configure_cli_segmentation_cb(cli); if (osmo_iofd_register(cli->iofd, fd) < 0) goto error_close_socket; diff --git a/src/stream_srv.c b/src/stream_srv.c index c74f7b0..c2b187a 100644 --- a/src/stream_srv.c +++ b/src/stream_srv.c @@ -664,6 +664,8 @@ osmo_stream_srv_closed_cb_t closed_cb; osmo_stream_srv_read_cb_t read_cb; osmo_stream_srv_read_cb2_t iofd_read_cb; + osmo_stream_srv_segmentation_cb_t segmentation_cb; + osmo_stream_srv_segmentation_cb2_t segmentation_cb2; void *data; int flags; }; @@ -1040,7 +1042,37 @@ conn->data = data; } +/* Callback from iofd, forward to stream_srv user: */ +static int stream_srv_iofd_segmentation_cb2(struct osmo_io_fd *iofd, struct msgb *msg) +{ + struct osmo_stream_srv *conn = osmo_iofd_get_data(iofd); + if (conn->segmentation_cb2) + return conn->segmentation_cb2(conn, msg); + if (conn->segmentation_cb) + return conn->segmentation_cb(msg); + OSMO_ASSERT(0); + return 0; +} + +/* Configure server side segmentation for the iofd */ +static void configure_srv_segmentation_cb(struct osmo_stream_srv *conn) +{ + /* Copy default settings */ + struct osmo_io_ops client_ops; + osmo_iofd_get_ioops(conn->iofd, &client_ops); + /* Set segmentation cb for this client */ + if (conn->segmentation_cb || conn->segmentation_cb2) + client_ops.segmentation_cb2 = stream_srv_iofd_segmentation_cb2; + else + client_ops.segmentation_cb2 = NULL; + osmo_iofd_set_ioops(conn->iofd, &client_ops); +} + /*! Set the segmentation callback for target osmo_stream_srv structure. + * \param[in,out] conn Target Stream Server to modify + * \param[in] segmentation_cb Segmentation callback to be set + * + * DEPRECATED: Use osmo_stream_srv_set_segmentation_cb2() instead. * * A segmentation call-back can optionally be used when a packet based protocol (like TCP) is used within a * STREAM style socket that does not preserve message boundaries within the stream. If a segmentation @@ -1048,22 +1080,41 @@ * complete single messages, and not arbitrary segments of the stream. * * This function only works with osmo_stream_srv in osmo_io mode, created by osmo_stream_srv_create2()! - * The connection has to have been established prior to calling this function. - * - * \param[in,out] conn Target Stream Server to modify - * \param[in] segmentation_cb Segmentation callback to be set */ + * The connection has to have been established prior to calling this function. + * + */ void osmo_stream_srv_set_segmentation_cb(struct osmo_stream_srv *conn, osmo_stream_srv_segmentation_cb_t segmentation_cb) { /* Note that the following implies that iofd != NULL, since * osmo_stream_srv_create2() creates the iofd member, too */ OSMO_ASSERT(conn->mode == OSMO_STREAM_MODE_OSMO_IO); - /* Copy default settings */ - struct osmo_io_ops conn_ops; - osmo_iofd_get_ioops(conn->iofd, &conn_ops); - /* Set segmentation cb for this connection */ - conn_ops.segmentation_cb = segmentation_cb; - osmo_iofd_set_ioops(conn->iofd, &conn_ops); + conn->segmentation_cb = segmentation_cb; + conn->segmentation_cb2 = NULL; + configure_srv_segmentation_cb(conn); +} + +/*! Set the segmentation callback for target osmo_stream_srv structure. + * \param[in,out] conn Target Stream Server to modify + * \param[in] segmentation_cb2 Segmentation callback to be set + * + * A segmentation call-back can optionally be used when a packet based protocol (like TCP) is used within a + * STREAM style socket that does not preserve message boundaries within the stream. If a segmentation + * call-back is given, the osmo_stream_srv library code will makes sure that the read_cb called only for + * complete single messages, and not arbitrary segments of the stream. + * + * This function only works with osmo_stream_srv in osmo_io mode, created by osmo_stream_srv_create2()! + * The connection has to have been established prior to calling this function. + */ +void osmo_stream_srv_set_segmentation_cb2(struct osmo_stream_srv *conn, + osmo_stream_srv_segmentation_cb2_t segmentation_cb2) +{ + /* Note that the following implies that iofd != NULL, since + * osmo_stream_srv_create2() creates the iofd member, too */ + OSMO_ASSERT(conn->mode == OSMO_STREAM_MODE_OSMO_IO); + conn->segmentation_cb = NULL; + conn->segmentation_cb2 = segmentation_cb2; + configure_srv_segmentation_cb(conn); } /*! Retrieve application private data of the stream server -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/39316?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I6e8dd6ece13397074075f05a1a0a8dbdd80d8848 Gerrit-Change-Number: 39316 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 49
  • 50
  • 51
  • 52
  • 53
  • 54
  • 55
  • ...
  • 150
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.