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

June 2023

  • 1 participants
  • 2480 discussions
[M] Change in libosmo-netif[master]: stream: Add IPA send function/IPA-mode read to srv
by arehbein 06 Jun '23

06 Jun '23
arehbein has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/33201 ) Change subject: stream: Add IPA send function/IPA-mode read to srv ...................................................................... stream: Add IPA send function/IPA-mode read to srv Also: Adapt the example to work with the new changes. Related OS#5753, OS#5751 Change-Id: I61e1fe59166c46595efe8c1f32b8f2607cb6c529 --- M examples/ipa-stream-server.c M include/osmocom/netif/stream.h M src/stream.c M tests/stream/stream_test.c M tests/stream/stream_test.ok 5 files changed, 114 insertions(+), 21 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/01/33201/1 diff --git a/examples/ipa-stream-server.c b/examples/ipa-stream-server.c index df5c26c..3146e63 100644 --- a/examples/ipa-stream-server.c +++ b/examples/ipa-stream-server.c @@ -49,15 +49,9 @@ int read_cb(struct osmo_stream_srv *conn, struct msgb *msg) { - LOGP(DSTREAMTEST, LOGL_DEBUG, "received message from stream (len=%d)\n", msgb_length(msg)); + LOGP(DSTREAMTEST, LOGL_DEBUG, "received message from stream (payload len=%d)\n", msgb_length(msg)); - if (osmo_ipa_process_msg(msg) < 0) { - LOGP(DSTREAMTEST, LOGL_ERROR, "Bad IPA message\n"); - msgb_free(msg); - return 0; - } - - osmo_stream_srv_send(conn, msg); + osmo_stream_srv_send_ipa(conn, IPAC_PROTO_UNSPECIFIED, IPAC_PROTO_UNSPECIFIED, msg); return 0; } diff --git a/include/osmocom/netif/stream.h b/include/osmocom/netif/stream.h index fa76d96..16940dc 100644 --- a/include/osmocom/netif/stream.h +++ b/include/osmocom/netif/stream.h @@ -4,6 +4,7 @@ #include <stdint.h> #include <osmocom/core/msgb.h> +#include <osmocom/gsm/protocol/ipaccess.h> /*! \addtogroup stream * @{ @@ -29,6 +30,8 @@ _NUM_OSMO_STREAM_PROTOS }; +#define IPAC_PROTO_UNSPECIFIED -1 + /*! \brief Shortcut for unsetting the stream protocol (gets rid of segmentation pertaining to stream protocol) */ #define osmo_stream_srv_link_unset_stream_proto(struct_osmo_stream_srv_link_ptr)\ osmo_stream_srv_link_set_stream_proto(struct_osmo_stream_srv_link_ptr, OSMO_STREAM_UNSPECIFIED) @@ -68,6 +71,8 @@ void osmo_stream_srv_set_data(struct osmo_stream_srv *conn, void *data); void osmo_stream_srv_send(struct osmo_stream_srv *conn, struct msgb *msg); +void osmo_stream_srv_send_ipa(struct osmo_stream_srv *conn, int ipaccess_proto, + enum ipaccess_proto_ext pe, struct msgb *msg); int osmo_stream_srv_recv(struct osmo_stream_srv *conn, struct msgb *msg); void osmo_stream_srv_clear_tx_queue(struct osmo_stream_srv *conn); diff --git a/src/stream.c b/src/stream.c index fbce7b4..396f344 100644 --- a/src/stream.c +++ b/src/stream.c @@ -44,6 +44,7 @@ #include <osmocom/core/talloc.h> #include <osmocom/core/socket.h> +#include <osmocom/netif/ipa.h> #include <osmocom/netif/stream.h> #include "config.h" @@ -628,6 +629,45 @@ cli->connect_cb(cli); } +#define LOG_CLI_OR_SRV(cli, level, fmt, args...) do {\ + if (cli != NULL)\ + LOGSCLI(cli, level, fmt, ## args);\ + else\ + LOGP(DLINP, level, fmt, ## args);\ +} while (0) + +/* Check and remove headers, in case of p == IPAC_PROTO_OSMO also the IPA extension header. + * Returns a negative number on error, otherwise the number of header octets removed */ +static inline int ipa_check_pull_headers(struct msgb *msg, struct osmo_stream_cli *cli) +{ + int ret; + size_t octets_removed = 0; + msg->l1h = msg->data; + struct ipa_head *ih = (struct ipa_head *)msg->data; + if ((ret = osmo_ipa_process_msg(msg)) < 0) { + LOG_CLI_OR_SRV(cli, LOGL_ERROR, "Error processing IPA message\n"); + return ret; + } + msgb_pull(msg, sizeof(struct ipa_head)); + octets_removed += sizeof(struct ipa_head); + if (ih->proto != IPAC_PROTO_OSMO) /* No extensions expected */ + return octets_removed; + msg->l2h = msg->data; + msgb_pull(msg, sizeof(struct ipa_head_ext)); + octets_removed += sizeof(struct ipa_head_ext); + return octets_removed; +} + +/* Push IPA headers; if we have IPAC_PROTO_OSMO this also takes care of the + * extension header */ +static inline void ipa_push_headers(enum ipaccess_proto p, enum ipaccess_proto_ext pe, + struct msgb *msg) +{ + if (p == IPAC_PROTO_OSMO) + ipa_prepend_header_ext(msg, pe); + osmo_ipa_msg_push_header(msg, p); +} + static void stream_cli_iofd_read_cb(struct osmo_io_fd *iofd, int res, struct msgb *msg) { struct osmo_stream_cli *cli = osmo_iofd_get_data(iofd); @@ -1419,6 +1459,8 @@ if (osmo_iofd_txqueue_len(iofd) == 0) osmo_stream_srv_destroy(conn); } else if (conn->iofd_read_cb) { + if (conn->srv->stream_proto == OSMO_STREAM_IPAC) + ipa_check_pull_headers(msg, NULL); conn->iofd_read_cb(conn, msg); // TODO: Handle return value? } @@ -1883,6 +1925,46 @@ talloc_free(conn); } +/* msgb_l1(msg) is expected to be set */ +static inline enum ipaccess_proto msg_get_ipa_proto(struct msgb *msg) +{ + struct ipa_head *ih = msgb_l1(msg); + OSMO_ASSERT(ih); + return ih->proto; +} + +/* msgb->l1h is expected to be set, msgb->l2h is expected to be set if + * we have IPAC_PROTO_OSMO specified in the header. + * Returns the protocol extension (enum ipaccess_proto) or -ENOPROTOOPT if + * we don't have IPAC_PROTO_OSMO specified in the IPA header */ +static inline int msg_get_ipa_proto_ext(struct msgb *msg) +{ + if (msg_get_ipa_proto(msg) != IPAC_PROTO_OSMO) + return -ENOPROTOOPT; + struct ipa_head_ext *ihe = msgb_l2(msg); + OSMO_ASSERT(ihe); + return ihe->proto; +} + +/*! \brief Enqueue IPA data to be sent via an Osmocom stream server + * \param[in] conn Stream Server through which we want to send + * \param[in] p Protocol transported by IPA. When set to IPAC_PROTO_UNSPECIFIED, the protocol will be + * read from the msgb structure's l1 and possibly l2 headers. + * \param[in] pe Ignored, unless p == IPAC_PROTO_OSMO, in which case this specifies the + * Osmocom protocol extension + * \param[in] msg Message buffer to enqueue in transmit queue */ +void osmo_stream_srv_send_ipa(struct osmo_stream_srv *conn, int ipaccess_proto, + enum ipaccess_proto_ext pe, struct msgb *msg) +{ + OSMO_ASSERT(msg); + if (ipaccess_proto == IPAC_PROTO_UNSPECIFIED) { + ipaccess_proto = msg_get_ipa_proto(msg); + pe = msg_get_ipa_proto_ext(msg); + } + ipa_push_headers(ipaccess_proto, pe, msg); + osmo_stream_srv_send(conn, msg); +} + /*! \brief Enqueue data to be sent via an Osmocom stream server * \param[in] conn Stream Server through which we want to send * \param[in] msg Message buffer to enqueue in transmit queue */ diff --git a/tests/stream/stream_test.c b/tests/stream/stream_test.c index b537d5e..4d0ad1e 100644 --- a/tests/stream/stream_test.c +++ b/tests/stream/stream_test.c @@ -553,23 +553,22 @@ { unsigned char *data; struct msgb *m; - uint8_t *msgt = msg->data + sizeof(struct ipa_head); - LOGSRV(conn, "[%u-srv] Received message from stream (len = %" PRIu16 ")\n", + uint8_t *msgt = msg->l2h; /* Octet right after IPA header */ + LOGSRV(conn, "[%u-srv] Received IPA message from stream (paylod len = %" PRIu16 ")\n", ++msgnum_srv, msgb_length(msg)); - msgb_pull(msg, sizeof(struct ipa_head)); LOGSRV(conn, "\tIPA data: %s\n", osmo_hexdump(msg->data, msg->len)); LOGSRV(conn, "\tType: %s\n", IPAC_MSG_TYPES[*msgt]); - LOGSRV(conn, "\t(msg dump: %s)\n", osmo_hexdump(msg->data - sizeof(struct ipa_head), - msg->len + sizeof(struct ipa_head))); + LOGSRV(conn, "\t(msg dump: %s)\n", osmo_hexdump(msg->l1h, msg->len + sizeof(struct ipa_head))); if (*msgt == IPAC_MSGT_ID_RESP) { /* */ LOGSRV(conn, "Send IPAC_MSGT_ID_GET to trigger client to send 2nd half\n\n"); - m = msgb_alloc_headroom(128, 0, "IPA messages"); + m = msgb_alloc_headroom(128, sizeof(struct ipa_head), "IPA messages"); if (m == NULL) { fprintf(stderr, "Cannot allocate message\n"); return -ENOMEM; } - put_ipa_msg(data, m, ipac_msg_idreq); - osmo_stream_srv_send(conn, m); + data = msgb_put(m, IPAC_MSG_ID_REQ_LEN); + memcpy(data, ipac_msg_idreq + sizeof(struct ipa_head), IPAC_MSG_ID_REQ_LEN); + osmo_stream_srv_send_ipa(conn, IPAC_PROTO_IPACCESS, -1, m); } else if (*msgt == IPAC_MSGT_ID_GET) { all_msgs_processed = true; } diff --git a/tests/stream/stream_test.ok b/tests/stream/stream_test.ok index 7763212..65a7478 100644 --- a/tests/stream/stream_test.ok +++ b/tests/stream/stream_test.ok @@ -62,19 +62,19 @@ {20.000020} [OK] Client's test_segm_cli_connect_cb(): Sending 4 1/2 messages as one: {20.000020} [OK] Client's test_segm_cli_connect_cb(): (msg dump: 00 01 fe 00 00 01 fe 01 00 01 fe 00 00 07 fe 05 01 01 de ad be ef 00 03 fe ) -{20.000022} [NA|OK] Server's test_segm_stream_srv_read_cb(): [1-srv] Received message from stream (len = 4) +{20.000022} [NA|OK] Server's test_segm_stream_srv_read_cb(): [1-srv] Received IPA message from stream (paylod len = 1) {20.000022} [NA|OK] Server's test_segm_stream_srv_read_cb(): IPA data: 00 {20.000022} [NA|OK] Server's test_segm_stream_srv_read_cb(): Type: IPAC_MSGT_PING {20.000022} [NA|OK] Server's test_segm_stream_srv_read_cb(): (msg dump: 00 01 fe 00 ) -{20.000022} [NA|OK] Server's test_segm_stream_srv_read_cb(): [2-srv] Received message from stream (len = 4) +{20.000022} [NA|OK] Server's test_segm_stream_srv_read_cb(): [2-srv] Received IPA message from stream (paylod len = 1) {20.000022} [NA|OK] Server's test_segm_stream_srv_read_cb(): IPA data: 01 {20.000022} [NA|OK] Server's test_segm_stream_srv_read_cb(): Type: IPAC_MSGT_PONG {20.000022} [NA|OK] Server's test_segm_stream_srv_read_cb(): (msg dump: 00 01 fe 01 ) -{20.000022} [NA|OK] Server's test_segm_stream_srv_read_cb(): [3-srv] Received message from stream (len = 4) +{20.000022} [NA|OK] Server's test_segm_stream_srv_read_cb(): [3-srv] Received IPA message from stream (paylod len = 1) {20.000022} [NA|OK] Server's test_segm_stream_srv_read_cb(): IPA data: 00 {20.000022} [NA|OK] Server's test_segm_stream_srv_read_cb(): Type: IPAC_MSGT_PING {20.000022} [NA|OK] Server's test_segm_stream_srv_read_cb(): (msg dump: 00 01 fe 00 ) -{20.000022} [NA|OK] Server's test_segm_stream_srv_read_cb(): [4-srv] Received message from stream (len = 10) +{20.000022} [NA|OK] Server's test_segm_stream_srv_read_cb(): [4-srv] Received IPA message from stream (paylod len = 7) {20.000022} [NA|OK] Server's test_segm_stream_srv_read_cb(): IPA data: 05 01 01 de ad be ef {20.000022} [NA|OK] Server's test_segm_stream_srv_read_cb(): Type: IPAC_MSGT_ID_RESP {20.000022} [NA|OK] Server's test_segm_stream_srv_read_cb(): (msg dump: 00 07 fe 05 01 01 de ad be ef ) @@ -86,7 +86,7 @@ {20.000024} [OK] Client's test_segm_stream_cli_read_cb(): [5-cli] Sending second half of IPAC_MSGT_ID_GET {20.000024} [OK] Client's test_segm_stream_cli_read_cb(): (msg dump: 04 01 01 ) -{20.000026} [NA|OK] Server's test_segm_stream_srv_read_cb(): [5-srv] Received message from stream (len = 6) +{20.000026} [NA|OK] Server's test_segm_stream_srv_read_cb(): [5-srv] Received IPA message from stream (paylod len = 3) {20.000026} [NA|OK] Server's test_segm_stream_srv_read_cb(): IPA data: 04 01 01 {20.000026} [NA|OK] Server's test_segm_stream_srv_read_cb(): Type: IPAC_MSGT_ID_GET {20.000026} [NA|OK] Server's test_segm_stream_srv_read_cb(): (msg dump: 00 03 fe 04 01 01 ) -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/33201 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I61e1fe59166c46595efe8c1f32b8f2607cb6c529 Gerrit-Change-Number: 33201 Gerrit-PatchSet: 1 Gerrit-Owner: arehbein <arehbein(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in libosmocore[master]: gsm/ipa: Add segmentation callback
by fixeria 06 Jun '23

06 Jun '23
Attention is currently required from: arehbein, pespin. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/33083 ) Change subject: gsm/ipa: Add segmentation callback ...................................................................... Patch Set 3: (1 comment) File src/gsm/ipa.c: https://gerrit.osmocom.org/c/libosmocore/+/33083/comment/1db0a43a_ee417b58 PS2, Line 724: if (msgb_length(msg) < sizeof(struct ipaccess_head)) > cosmetic: more than one line, add curly braces please Done -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/33083 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I3a639e6896cc3b3fc8e9b2e1a58254710efa0d3f Gerrit-Change-Number: 33083 Gerrit-PatchSet: 3 Gerrit-Owner: arehbein <arehbein(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: daniel <dwillmann(a)sysmocom.de> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: arehbein <arehbein(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Tue, 06 Jun 2023 15:03:36 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-ci[master]: DAHDI gerrit verification job diversification
by pespin 06 Jun '23

06 Jun '23
Attention is currently required from: laforge. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ci/+/33191 ) Change subject: DAHDI gerrit verification job diversification ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/33191 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: I60aa61cb5020c9ce50126b048a0fa546a535236f Gerrit-Change-Number: 33191 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Tue, 06 Jun 2023 14:56:17 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-ci[master]: DAHDI master build diversification
by pespin 06 Jun '23

06 Jun '23
Attention is currently required from: laforge. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ci/+/33190 ) Change subject: DAHDI master build diversification ...................................................................... Patch Set 3: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/33190 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: Ibc0527a6f7d11c4f99c19e73c948b9baacd4e5a2 Gerrit-Change-Number: 33190 Gerrit-PatchSet: 3 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Tue, 06 Jun 2023 14:56:03 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in libosmocore[master]: gsm/ipa: Add segmentation callback
by arehbein 06 Jun '23

06 Jun '23
Attention is currently required from: pespin, fixeria. arehbein has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/33083 ) Change subject: gsm/ipa: Add segmentation callback ...................................................................... Patch Set 4: (4 comments) File include/osmocom/gsm/ipa.h: https://gerrit.osmocom.org/c/libosmocore/+/33083/comment/539c9206_4a3fa969 PS2, Line 74: int ipa_iofd_segmentation_cb(struct msgb *msg, int read); > what does "read" mean here? read_bytes? read_rc? ah I had deleted this line, but that must have gotten lost somehow in a local change after I changed my workflow File src/gsm/ipa.c: https://gerrit.osmocom.org/c/libosmocore/+/33083/comment/995caa9c_cdd4d12a PS2, Line 724: if (msgb_length(msg) < sizeof(struct ipaccess_head)) > cosmetic: more than one line, add curly braces please Done https://gerrit.osmocom.org/c/libosmocore/+/33083/comment/dfdfae1a_12d9218a PS2, Line 727: struct ipaccess_head *hh > const? Done https://gerrit.osmocom.org/c/libosmocore/+/33083/comment/10d48632_720d9922 PS2, Line 730: payload_len < 0 > I doubt this is possible, because a) `size_t` unsigned, and b) neither `hh->len` nor `sizeof(*hh)` c […] Done -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/33083 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I3a639e6896cc3b3fc8e9b2e1a58254710efa0d3f Gerrit-Change-Number: 33083 Gerrit-PatchSet: 4 Gerrit-Owner: arehbein <arehbein(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: daniel <dwillmann(a)sysmocom.de> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Tue, 06 Jun 2023 14:53:35 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: pespin <pespin(a)sysmocom.de> Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[S] Change in libosmocore[master]: gsm/ipa: Add segmentation callback
by arehbein 06 Jun '23

06 Jun '23
Attention is currently required from: arehbein, fixeria. Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/libosmocore/+/33083 to look at the new patch set (#4). Change subject: gsm/ipa: Add segmentation callback ...................................................................... gsm/ipa: Add segmentation callback Add segmentation callback to be used by the streaming backend of libosmo-netif Related: OS#5753, OS#5751 Change-Id: I3a639e6896cc3b3fc8e9b2e1a58254710efa0d3f --- M include/osmocom/gsm/ipa.h M src/gsm/ipa.c M src/gsm/libosmogsm.map 3 files changed, 37 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/83/33083/4 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/33083 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I3a639e6896cc3b3fc8e9b2e1a58254710efa0d3f Gerrit-Change-Number: 33083 Gerrit-PatchSet: 4 Gerrit-Owner: arehbein <arehbein(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: daniel <dwillmann(a)sysmocom.de> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: arehbein <arehbein(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
[S] Change in libosmocore[master]: gsm/ipa: Add segmentation callback
by daniel 06 Jun '23

06 Jun '23
Attention is currently required from: arehbein, fixeria. daniel has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmocore/+/33083 ) Change subject: gsm/ipa: Add segmentation callback ...................................................................... Patch Set 3: (1 comment) File src/gsm/ipa.c: https://gerrit.osmocom.org/c/libosmocore/+/33083/comment/9c53568a_dbc2c5f8 PS2, Line 730: msg->data_len < total_len > Is `msg->data_len < total_len` really an error? Given that the underlying transport is usually TCP, […] This (is supposed to) check the case where the msgb is not large enough to contain a complete message. So e.g. msgb was allocated with a size of 1024, payload_len turns out to be 2342. I'm not 100% sure if ->data_len is the correct field, though. Do we want msgb_tailroom() + msgb_length() ? -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/33083 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I3a639e6896cc3b3fc8e9b2e1a58254710efa0d3f Gerrit-Change-Number: 33083 Gerrit-PatchSet: 3 Gerrit-Owner: arehbein <arehbein(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: daniel <dwillmann(a)sysmocom.de> Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: arehbein <arehbein(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Tue, 06 Jun 2023 14:46:03 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[S] Change in libosmocore[master]: gsm/ipa: Add segmentation callback
by arehbein 06 Jun '23

06 Jun '23
Attention is currently required from: arehbein. Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/libosmocore/+/33083 to look at the new patch set (#3). Change subject: gsm/ipa: Add segmentation callback ...................................................................... gsm/ipa: Add segmentation callback Add segmentation callback to be used by the streaming backend of libosmo-netif Related: OS#5753, OS#5751 Change-Id: I3a639e6896cc3b3fc8e9b2e1a58254710efa0d3f --- M include/osmocom/gsm/ipa.h M src/gsm/ipa.c M src/gsm/libosmogsm.map 3 files changed, 37 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/83/33083/3 -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/33083 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I3a639e6896cc3b3fc8e9b2e1a58254710efa0d3f Gerrit-Change-Number: 33083 Gerrit-PatchSet: 3 Gerrit-Owner: arehbein <arehbein(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: arehbein <arehbein(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
[S] Change in libosmocore[arehbein/osmo_io_ipa]: gsm/ipa: Add segmentation callback
by arehbein 06 Jun '23

06 Jun '23
arehbein has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmocore/+/33192 ) Change subject: gsm/ipa: Add segmentation callback ...................................................................... gsm/ipa: Add segmentation callback Add segmentation callback to be used by the streaming backend of libosmo-netif Related: OS#5753, OS#5751 Change-Id: I3a639e6896cc3b3fc8e9b2e1a58254710efa0d3f --- M include/osmocom/gsm/ipa.h M src/gsm/ipa.c M src/gsm/libosmogsm.map 3 files changed, 37 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmocore refs/changes/92/33192/1 diff --git a/include/osmocom/gsm/ipa.h b/include/osmocom/gsm/ipa.h index 851b58e..37672d6 100644 --- a/include/osmocom/gsm/ipa.h +++ b/include/osmocom/gsm/ipa.h @@ -5,6 +5,7 @@ #include <stdint.h> #include <osmocom/core/msgb.h> +#include <osmocom/core/osmo_io.h> #include <osmocom/gsm/tlv.h> struct osmo_fd; @@ -79,3 +80,6 @@ int ipa_msg_recv(int fd, struct msgb **rmsg); int ipa_msg_recv_buffered(int fd, struct msgb **rmsg, struct msgb **tmp_msg); + +/* Callback for segmenting TCP stream data into IPA packets */ +int ipa_segmentation_cb(struct msgb *msg); diff --git a/src/gsm/ipa.c b/src/gsm/ipa.c index 447e8e3..de04537 100644 --- a/src/gsm/ipa.c +++ b/src/gsm/ipa.c @@ -30,6 +30,7 @@ #include <stdint.h> #include <errno.h> #include <stdlib.h> +#include <inttypes.h> #include <sys/types.h> @@ -39,6 +40,7 @@ #include <osmocom/core/logging.h> #include <osmocom/core/macaddr.h> #include <osmocom/core/select.h> +#include <osmocom/core/osmo_io.h> #include <osmocom/gsm/tlv.h> #include <osmocom/gsm/protocol/ipaccess.h> @@ -718,4 +720,22 @@ return nmsg; } +int ipa_segmentation_cb(struct msgb *msg) +{ + if (msgb_length(msg) < sizeof(struct ipaccess_head)) { + /* Haven't even the read entire header */ + return -EAGAIN; + } + struct ipaccess_head *hh = (struct ipaccess_head *) msg->data; + size_t payload_len = osmo_ntohs(hh->len); + size_t total_len = payload_len + sizeof(*hh); + if (msg->data_len < total_len) { + LOGP(DLINP, LOGL_ERROR, "bad message length of %zu bytes, " + "received %" PRIu16 "bytes\n", payload_len, + msg->len); + return -EIO; + } + return total_len; +} + /*! @} */ diff --git a/src/gsm/libosmogsm.map b/src/gsm/libosmogsm.map index 0018e1c..0c074f6 100644 --- a/src/gsm/libosmogsm.map +++ b/src/gsm/libosmogsm.map @@ -638,6 +638,7 @@ ipa_ccm_id_resp_parse; ipa_ccm_make_id_resp; ipa_ccm_make_id_resp_from_req; +ipa_segmentation_cb; ipa_msg_alloc; ipa_msg_recv; ipa_msg_recv_buffered; -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/33192 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: arehbein/osmo_io_ipa Gerrit-Change-Id: I3a639e6896cc3b3fc8e9b2e1a58254710efa0d3f Gerrit-Change-Number: 33192 Gerrit-PatchSet: 1 Gerrit-Owner: arehbein <arehbein(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in osmocom-bb[master]: fake_trx.py: remove SETSLOT based burst filtering
by fixeria 06 Jun '23

06 Jun '23
Attention is currently required from: laforge, pespin. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmocom-bb/+/33165 ) Change subject: fake_trx.py: remove SETSLOT based burst filtering ...................................................................... Patch Set 1: (1 comment) Patchset: PS1: > Maybe make this filtering optional through a cmd arg? I see no practical use for keeping SETSLOT based filtering: * osmo-bts-trx is usually activating all timeslots, except those explicitly disabled in `osmo-bsc.cfg` and/or masked out in `osmo-bts.cfg` (see the `slotmask` command). This is rarely used AFAIK, perhaps only for CalypsoBTS? * for trxcon we *need* to receive on all timeslots in order to generate NOPE.inds. As an option, I can update this patch and keep the filtering only for bursts being sent by a transceiver (i.e. UL bursts for trxcon, and DL bursts for osmo-bts) and unconditionally pass all received bursts, but this makes a little sense IMO. -- To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/33165 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmocom-bb Gerrit-Branch: master Gerrit-Change-Id: Ia42550d5c2d8b49efbdf8ef0ce46b26afd1c464e Gerrit-Change-Number: 33165 Gerrit-PatchSet: 1 Gerrit-Owner: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Tue, 06 Jun 2023 14:36:14 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 196
  • 197
  • 198
  • 199
  • 200
  • 201
  • 202
  • ...
  • 248
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.