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
[S] Change in libosmo-netif[master]: stream: Document osmo_stream_cli_create2()
by daniel 15 Jun '23

15 Jun '23
daniel has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/33327 ) Change subject: stream: Document osmo_stream_cli_create2() ...................................................................... stream: Document osmo_stream_cli_create2() Change-Id: I0c2f46e02d94c3459e4043a9db7fccd906521dd2 --- M src/stream.c 1 file changed, 16 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/27/33327/1 diff --git a/src/stream.c b/src/stream.c index b6ef92f..d46bc78 100644 --- a/src/stream.c +++ b/src/stream.c @@ -616,7 +616,13 @@ .segmentation_cb = NULL, }; - +/*! \brief Create an Osmocom stream client + * \param[in] ctx talloc context from which to allocate memory + * This function allocates a new \ref osmo_stream_cli and initializes + * it with default values (5s reconnect timer, TCP protocol) + * \param[in] name a description of the stream client. Will be used in logging + * \return allocated stream client, or NULL in case of error + */ struct osmo_stream_cli *osmo_stream_cli_create2(void *ctx, const char *name) { struct osmo_stream_cli *cli; -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/33327 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I0c2f46e02d94c3459e4043a9db7fccd906521dd2 Gerrit-Change-Number: 33327 Gerrit-PatchSet: 1 Gerrit-Owner: daniel <dwillmann(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in libosmo-netif[master]: stream: Remove duplicated code in osmo_stream_cli_create()
by daniel 15 Jun '23

15 Jun '23
daniel has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/33328 ) Change subject: stream: Remove duplicated code in osmo_stream_cli_create() ...................................................................... stream: Remove duplicated code in osmo_stream_cli_create() Simply call osmo_stream_cli_create2() with name "" Change-Id: I0652361a6bdf194545f36edc5e12e5d26798163a --- M src/stream.c 1 file changed, 12 insertions(+), 17 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/28/33328/1 diff --git a/src/stream.c b/src/stream.c index d46bc78..2ba4cde 100644 --- a/src/stream.c +++ b/src/stream.c @@ -552,23 +552,7 @@ */ struct osmo_stream_cli *osmo_stream_cli_create(void *ctx) { - struct osmo_stream_cli *cli; - - cli = talloc_zero(ctx, struct osmo_stream_cli); - if (!cli) - return NULL; - - cli->name = ""; - cli->mode = OSMO_STREAM_MODE_UNKNOWN; - cli->sk_domain = AF_UNSPEC; - cli->sk_type = SOCK_STREAM; - cli->proto = IPPROTO_TCP; - cli->state = STREAM_CLI_STATE_CLOSED; - osmo_timer_setup(&cli->timer, cli_timer_cb, cli); - cli->reconnect_timeout = 5; /* default is 5 seconds. */ - INIT_LLIST_HEAD(&cli->tx_queue); - - return cli; + return osmo_stream_cli_create2(ctx, ""); } static void stream_cli_iofd_read_cb(struct osmo_io_fd *iofd, int res, struct msgb *msg) -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/33328 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I0652361a6bdf194545f36edc5e12e5d26798163a Gerrit-Change-Number: 33328 Gerrit-PatchSet: 1 Gerrit-Owner: daniel <dwillmann(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in libosmo-sccp[master]: Forbid partial VTY configurations of ASPs with name asp-clnt-*
by pespin 15 Jun '23

15 Jun '23
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/33325 ) Change subject: Forbid partial VTY configurations of ASPs with name asp-clnt-* ...................................................................... Forbid partial VTY configurations of ASPs with name asp-clnt-* A recent commit (83db938859428ce3835239e2692d93c557b750e1) changed the behavior of default "sctp-role" and "role" values of ASPs named asp-clnt-* which are used by osmo_sccp_simple_client_on_ss7_id(), in order to avoid having different default values when than function is used, which is totally confusing for end users. As it was already informed when submitting the mentioned commit, it changes the behavior on that specific case, and that made some users start having problems without a proper "your config is wrong!" error. This commit addresses it by basically forbiding that exact use case, that is, partially defining an asp-clnt-* ASP through VTY without explicitly configuring a "role" and "sctp-role". With this patch, function osmo_sccp_simple_client_on_ss7_id() will print a proper error informing the user and will return NULL, potentially triggering an early program exit which can then easily be fixed by using proper configuration. Related: SYS#6486 Change-Id: I65b5fad2ec06a9d9c521f1e3ce8aab633da95a47 --- M TODO-RELEASE M include/osmocom/sigtran/osmo_ss7.h M src/osmo_ss7_vty.c M src/sccp_user.c 4 files changed, 68 insertions(+), 14 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/25/33325/1 diff --git a/TODO-RELEASE b/TODO-RELEASE index 05e12a6..ede41b5 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -8,3 +8,4 @@ # If any interfaces have been removed or changed since the last public release: c:r:0. #library what description / commit summary line libosmocore >1.8.0 uses new osmo_prim_operation_name() +osmo_sccp_simple_client_on_ss7_id() behavior change: ASPs asp-clnt-* defined through VTY must explicitly configure "role" and "sctp-role" \ No newline at end of file diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index eff16b9..f413983 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -430,6 +430,8 @@ enum osmo_ss7_asp_admin_state adm_state; bool is_server; enum osmo_ss7_asp_role role; + bool role_set_by_vty; + bool sctp_role_set_by_vty; struct osmo_ss7_asp_peer local; struct osmo_ss7_asp_peer remote; diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 09e5f0a..ebec5f6 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -715,6 +715,8 @@ return CMD_WARNING; } else OSMO_ASSERT(0); + + asp->cfg.role_set_by_vty = true; return CMD_SUCCESS; } @@ -733,6 +735,8 @@ asp->cfg.is_server = true; else OSMO_ASSERT(0); + + asp->cfg.sctp_role_set_by_vty = true; return CMD_SUCCESS; } diff --git a/src/sccp_user.c b/src/sccp_user.c index aac6ee0..1b0758e 100644 --- a/src/sccp_user.c +++ b/src/sccp_user.c @@ -646,24 +646,43 @@ osmo_ss7_as_add_asp(as, asp->cfg.name); } - /* If ASP was configured through VTY it may be explicitly configured as - * SCTP server. It may be a bit confusing since this function is to create - * a "SCCP simple client", but this allows users of this API such as - * osmo-hnbgw to support SCTP-role server if properly configured through VTY. - */ - if (asp->cfg.is_server) { - struct osmo_xua_server *xs; - LOGP(DLSCCP, LOGL_NOTICE, - "%s: Requesting an SCCP simple client on ASP %s configured with 'sctp-role server'\n", - name, asp->cfg.name); - xs = osmo_ss7_xua_server_find(ss7, prot, asp->cfg.local.port); - if (!xs) { + /* Extra sanity checks if the ASP asp-clnt-* was pre-configured over VTY: */ + if (!asp->simple_client_allocated) { + /* Forbid ASPs defined through VTY that are not entirely + * configured. "role" and "sctp-role" must be explicitly provided: + */ + if (!asp->cfg.role_set_by_vty) { LOGP(DLSCCP, LOGL_ERROR, - "%s: Requesting an SCCP simple client on ASP %s configured with 'sctp-role server' " - "but no matching xUA server was configured!\n", + "%s: ASP %s defined in VTY but 'role' was not set there, please set it.\n", name, asp->cfg.name); goto out_asp; } + if (!asp->cfg.sctp_role_set_by_vty) { + LOGP(DLSCCP, LOGL_ERROR, + "%s: ASP %s defined in VTY but 'sctp-role' was not set there, please set it.\n", + name, asp->cfg.name); + goto out_asp; + } + + /* If ASP was configured through VTY it may be explicitly configured as + * SCTP server. It may be a bit confusing since this function is to create + * a "SCCP simple client", but this allows users of this API such as + * osmo-hnbgw to support SCTP-role server if properly configured through VTY. + */ + if (asp->cfg.is_server) { + struct osmo_xua_server *xs; + LOGP(DLSCCP, LOGL_NOTICE, + "%s: Requesting an SCCP simple client on ASP %s configured with 'sctp-role server'\n", + name, asp->cfg.name); + xs = osmo_ss7_xua_server_find(ss7, prot, asp->cfg.local.port); + if (!xs) { + LOGP(DLSCCP, LOGL_ERROR, + "%s: Requesting an SCCP simple client on ASP %s configured with 'sctp-role server' " + "but no matching xUA server was configured!\n", + name, asp->cfg.name); + goto out_asp; + } + } } /* Restart ASP */ -- To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/33325 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Change-Id: I65b5fad2ec06a9d9c521f1e3ce8aab633da95a47 Gerrit-Change-Number: 33325 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[S] Change in osmo-bsc[master]: cosmetic: Fix type in VTY description
by daniel 15 Jun '23

15 Jun '23
daniel has submitted this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/33324 ) Change subject: cosmetic: Fix type in VTY description ...................................................................... cosmetic: Fix type in VTY description Change-Id: I3301d1c84b3386e0a4e9c3f18f89aee62e9097d5 --- M src/osmo-bsc/bts_vty.c 1 file changed, 10 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved diff --git a/src/osmo-bsc/bts_vty.c b/src/osmo-bsc/bts_vty.c index 040f2ed..657d03e 100644 --- a/src/osmo-bsc/bts_vty.c +++ b/src/osmo-bsc/bts_vty.c @@ -1621,7 +1621,7 @@ "Tbvc-block timeout\n" \ "Tbvc-block retries\n" \ "Tbvc-unblock retries\n" \ - "Tbvcc-reset timeout\n" \ + "Tbvc-reset timeout\n" \ "Tbvc-reset retries\n" \ "Tbvc-suspend timeout\n" \ "Tbvc-suspend retries\n" \ -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/33324 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I3301d1c84b3386e0a4e9c3f18f89aee62e9097d5 Gerrit-Change-Number: 33324 Gerrit-PatchSet: 1 Gerrit-Owner: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[S] Change in osmo-bsc[master]: cosmetic: Fix type in VTY description
by pespin 15 Jun '23

15 Jun '23
Attention is currently required from: daniel. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-bsc/+/33324 ) Change subject: cosmetic: Fix type in VTY description ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/33324 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I3301d1c84b3386e0a4e9c3f18f89aee62e9097d5 Gerrit-Change-Number: 33324 Gerrit-PatchSet: 1 Gerrit-Owner: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: daniel <dwillmann(a)sysmocom.de> Gerrit-Comment-Date: Thu, 15 Jun 2023 16:52:05 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: bsc: Introduce test TC_mgwpool_keepalive
by pespin 15 Jun '23

15 Jun '23
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33323 ) Change subject: bsc: Introduce test TC_mgwpool_keepalive ...................................................................... Patch Set 2: This change is ready for review. -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33323 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: Ib3cd00dafee87258ac229df78217326a6182f028 Gerrit-Change-Number: 33323 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Thu, 15 Jun 2023 16:47:50 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-bsc[master]: cosmetic: Fix type in VTY description
by daniel 15 Jun '23

15 Jun '23
daniel has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/33324 ) Change subject: cosmetic: Fix type in VTY description ...................................................................... cosmetic: Fix type in VTY description Change-Id: I3301d1c84b3386e0a4e9c3f18f89aee62e9097d5 --- M src/osmo-bsc/bts_vty.c 1 file changed, 10 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/24/33324/1 diff --git a/src/osmo-bsc/bts_vty.c b/src/osmo-bsc/bts_vty.c index 040f2ed..657d03e 100644 --- a/src/osmo-bsc/bts_vty.c +++ b/src/osmo-bsc/bts_vty.c @@ -1621,7 +1621,7 @@ "Tbvc-block timeout\n" \ "Tbvc-block retries\n" \ "Tbvc-unblock retries\n" \ - "Tbvcc-reset timeout\n" \ + "Tbvc-reset timeout\n" \ "Tbvc-reset retries\n" \ "Tbvc-suspend timeout\n" \ "Tbvc-suspend retries\n" \ -- To view, visit https://gerrit.osmocom.org/c/osmo-bsc/+/33324 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-bsc Gerrit-Branch: master Gerrit-Change-Id: I3301d1c84b3386e0a4e9c3f18f89aee62e9097d5 Gerrit-Change-Number: 33324 Gerrit-PatchSet: 1 Gerrit-Owner: daniel <dwillmann(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
[M] Change in libosmo-netif[master]: examples: Use new stream API in {ipa-,}stream-{client,server}
by daniel 15 Jun '23

15 Jun '23
daniel has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/33194 ) Change subject: examples: Use new stream API in {ipa-,}stream-{client,server} ...................................................................... examples: Use new stream API in {ipa-,}stream-{client,server} Change-Id: I97a9979199c816686b32080534627f6f033e009e --- M examples/ipa-stream-client.c M examples/ipa-stream-server.c M examples/stream-client.c M examples/stream-server.c 4 files changed, 29 insertions(+), 75 deletions(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, but someone else must approve laforge: Looks good to me, approved diff --git a/examples/ipa-stream-client.c b/examples/ipa-stream-client.c index 0c9c589..6cd212f 100644 --- a/examples/ipa-stream-client.c +++ b/examples/ipa-stream-client.c @@ -103,21 +103,10 @@ return 0; } -static int read_cb(struct osmo_stream_cli *conn) +static int read_cb(struct osmo_stream_cli *conn, struct msgb *msg) { - struct msgb *msg; + LOGP(DIPATEST, LOGL_DEBUG, "received message from stream (len=%d)\n", msgb_length(msg)); - LOGP(DIPATEST, LOGL_DEBUG, "received message from stream\n"); - - msg = osmo_ipa_msg_alloc(0); - if (msg == NULL) { - LOGP(DIPATEST, LOGL_ERROR, "cannot allocate message\n"); - return 0; - } - if (osmo_stream_cli_recv(conn, msg) <= 0) { - LOGP(DIPATEST, LOGL_ERROR, "cannot receive message\n"); - return 0; - } if (osmo_ipa_process_msg(msg) < 0) { LOGP(DIPATEST, LOGL_ERROR, "bad IPA message\n"); return 0; @@ -175,7 +164,7 @@ * initialize stream client. */ - conn = osmo_stream_cli_create(tall_test); + conn = osmo_stream_cli_create2(tall_test, "ipa_test_client"); if (conn == NULL) { fprintf(stderr, "cannot create client\n"); exit(EXIT_FAILURE); @@ -184,7 +173,7 @@ osmo_stream_cli_set_port(conn, 10000); osmo_stream_cli_set_connect_cb(conn, connect_cb); osmo_stream_cli_set_disconnect_cb(conn, disconnect_cb); - osmo_stream_cli_set_read_cb(conn, read_cb); + osmo_stream_cli_set_read_cb2(conn, read_cb); osmo_stream_cli_set_data(conn, &num_msgs); osmo_stream_cli_set_nodelay(conn, true); diff --git a/examples/ipa-stream-server.c b/examples/ipa-stream-server.c index 1ca1aaf..b84f2c9 100644 --- a/examples/ipa-stream-server.c +++ b/examples/ipa-stream-server.c @@ -47,23 +47,10 @@ exit(EXIT_SUCCESS); } -int read_cb(struct osmo_stream_srv *conn) +int read_cb(struct osmo_stream_srv *conn, struct msgb *msg) { - 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\n"); - - msg = osmo_ipa_msg_alloc(0); - if (msg == NULL) { - LOGP(DSTREAMTEST, LOGL_ERROR, "cannot allocate message\n"); - return 0; - } - if (osmo_stream_srv_recv(conn, msg) <= 0) { - LOGP(DSTREAMTEST, LOGL_ERROR, "cannot receive message\n"); - osmo_stream_srv_destroy(conn); - msgb_free(msg); - return -EBADF; - } if (osmo_ipa_process_msg(msg) < 0) { LOGP(DSTREAMTEST, LOGL_ERROR, "Bad IPA message\n"); msgb_free(msg); @@ -84,17 +71,18 @@ { if (conn != NULL) { LOGP(DSTREAMTEST, LOGL_ERROR, "Sorry, this example only " - "support one client simultaneously\n"); + "supports one client simultaneously\n"); return -1; } - conn = osmo_stream_srv_create(tall_test, srv, fd, - read_cb, close_cb, NULL); + conn = osmo_stream_srv_create2(tall_test, "ipa_srv", srv, fd, NULL); if (conn == NULL) { LOGP(DSTREAMTEST, LOGL_ERROR, "error while creating connection\n"); return -1; } + osmo_stream_srv_set_read_cb(conn, read_cb); + osmo_stream_srv_set_closed_cb(conn, close_cb); return 0; } diff --git a/examples/stream-client.c b/examples/stream-client.c index 428402e..93fbdd3 100644 --- a/examples/stream-client.c +++ b/examples/stream-client.c @@ -50,27 +50,11 @@ return 0; } -static int read_cb(struct osmo_stream_cli *conn) +static int read_cb(struct osmo_stream_cli *conn, struct msgb *msg) { - int bytes; - struct msgb *msg; - LOGP(DSTREAMTEST, LOGL_NOTICE, "receiving message from stream... "); - msg = msgb_alloc(1024, "STREAMCLIENT/test"); - if (msg == NULL) { - LOGPC(DSTREAMTEST, LOGL_ERROR, "cannot allocate message\n"); - return 0; - } - - bytes = osmo_stream_cli_recv(conn, msg); - - if (bytes < 0) { - LOGPC(DSTREAMTEST, LOGL_ERROR, "cannot receive message\n"); - return 0; - } - - LOGPC(DSTREAMTEST, LOGL_NOTICE, "got %d (%d) bytes: %s\n", bytes, msg->len, msgb_hexdump(msg)); + LOGPC(DSTREAMTEST, LOGL_NOTICE, "got %d bytes: %s\n", msg->len, msgb_hexdump(msg)); msgb_free(msg); return 0; @@ -120,7 +104,7 @@ * initialize stream cli. */ - conn = osmo_stream_cli_create(tall_test); + conn = osmo_stream_cli_create2(tall_test, "stream_client"); if (conn == NULL) { fprintf(stderr, "cannot create cli\n"); exit(EXIT_FAILURE); @@ -129,7 +113,7 @@ osmo_stream_cli_set_port(conn, 10000); osmo_stream_cli_set_connect_cb(conn, connect_cb); osmo_stream_cli_set_disconnect_cb(conn, disconnect_cb); - osmo_stream_cli_set_read_cb(conn, read_cb); + osmo_stream_cli_set_read_cb2(conn, read_cb); if (osmo_stream_cli_open(conn) < 0) { fprintf(stderr, "cannot open cli\n"); diff --git a/examples/stream-server.c b/examples/stream-server.c index e4ca480..9e077f0 100644 --- a/examples/stream-server.c +++ b/examples/stream-server.c @@ -42,29 +42,11 @@ exit(EXIT_SUCCESS); } -int read_cb(struct osmo_stream_srv *conn) +int read_cb(struct osmo_stream_srv *conn, struct msgb *msg) { - int bytes; - struct msgb *msg; - LOGP(DSTREAMTEST, LOGL_NOTICE, "receiving message from stream... "); - msg = msgb_alloc(1024, "STREAMSERVER/test"); - if (msg == NULL) { - LOGPC(DSTREAMTEST, LOGL_ERROR, "cannot allocate message\n"); - return 0; - } - - bytes = osmo_stream_srv_recv(conn, msg); - - if (bytes <= 0) { - if (bytes < 0) - LOGPC(DSTREAMTEST, LOGL_ERROR, "cannot receive message: %s\n", strerror(-bytes)); - else - LOGPC(DSTREAMTEST, LOGL_ERROR, "client closed connection\n"); - osmo_stream_srv_destroy(conn); - } else - LOGPC(DSTREAMTEST, LOGL_NOTICE, "got %d (%d) bytes: %s\n", bytes, msg->len, msgb_hexdump(msg)); + LOGPC(DSTREAMTEST, LOGL_NOTICE, "got %d bytes: %s\n", msg->len, msgb_hexdump(msg)); msgb_free(msg); return 0; @@ -72,6 +54,7 @@ static int close_cb(struct osmo_stream_srv *dummy) { + LOGPC(DSTREAMTEST, LOGL_ERROR, "client closed connection\n"); conn = NULL; return 0; } @@ -86,13 +69,14 @@ return -1; } - conn = osmo_stream_srv_create(tall_test, srv, fd, read_cb, - close_cb, NULL); + conn = osmo_stream_srv_create2(tall_test, "stream_server", srv, fd, NULL); if (conn == NULL) { LOGP(DSTREAMTEST, LOGL_ERROR, "error while creating connection\n"); return -1; } + osmo_stream_srv_set_read_cb(conn, read_cb); + osmo_stream_srv_set_closed_cb(conn, close_cb); osmo_sock_get_name_buf(buf, OSMO_SOCK_NAME_MAXLEN, fd); LOGP(DSTREAMTEST, LOGL_NOTICE, "accepted client: %s\n", buf); -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/33194 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I97a9979199c816686b32080534627f6f033e009e Gerrit-Change-Number: 33194 Gerrit-PatchSet: 14 Gerrit-Owner: arehbein <arehbein(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[L] Change in libosmo-netif[master]: Add osmo_io support to osmo_stream_cli and osmo_stream_srv
by daniel 15 Jun '23

15 Jun '23
daniel has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/33193 ) Change subject: Add osmo_io support to osmo_stream_cli and osmo_stream_srv ...................................................................... Add osmo_io support to osmo_stream_cli and osmo_stream_srv Change-Id: I2f52c7107c392b6f4b0bf2a84f8c873c084a200c --- M include/osmocom/netif/stream.h M src/stream.c 2 files changed, 334 insertions(+), 29 deletions(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, but someone else must approve laforge: Looks good to me, approved diff --git a/include/osmocom/netif/stream.h b/include/osmocom/netif/stream.h index b9a7c6d..b506142 100644 --- a/include/osmocom/netif/stream.h +++ b/include/osmocom/netif/stream.h @@ -45,6 +45,9 @@ struct osmo_stream_srv; struct osmo_stream_srv *osmo_stream_srv_create(void *ctx, struct osmo_stream_srv_link *link, int fd, int (*read_cb)(struct osmo_stream_srv *conn), int (*closed_cb)(struct osmo_stream_srv *conn), void *data); +struct osmo_stream_srv *osmo_stream_srv_create2(void *ctx, const char *name, struct osmo_stream_srv_link *link, int fd, void *data); +void osmo_stream_srv_set_read_cb(struct osmo_stream_srv *conn, int (*read_cb)(struct osmo_stream_srv *conn, struct msgb *msg)); +void osmo_stream_srv_set_closed_cb(struct osmo_stream_srv *conn, int (*closed_cb)(struct osmo_stream_srv *conn)); void *osmo_stream_srv_get_data(struct osmo_stream_srv *conn); struct osmo_stream_srv_link *osmo_stream_srv_get_master(struct osmo_stream_srv *conn); struct osmo_fd *osmo_stream_srv_get_ofd(struct osmo_stream_srv *srv); @@ -79,10 +82,12 @@ void osmo_stream_cli_set_connect_cb(struct osmo_stream_cli *cli, int (*connect_cb)(struct osmo_stream_cli *cli)); void osmo_stream_cli_set_disconnect_cb(struct osmo_stream_cli *cli, int (*disconnect_cb)(struct osmo_stream_cli *cli)); void osmo_stream_cli_set_read_cb(struct osmo_stream_cli *cli, int (*read_cb)(struct osmo_stream_cli *cli)); +void osmo_stream_cli_set_read_cb2(struct osmo_stream_cli *cli, int (*read_cb)(struct osmo_stream_cli *cli, struct msgb *msg)); void osmo_stream_cli_reconnect(struct osmo_stream_cli *cli); bool osmo_stream_cli_is_connected(struct osmo_stream_cli *cli); struct osmo_stream_cli *osmo_stream_cli_create(void *ctx); +struct osmo_stream_cli *osmo_stream_cli_create2(void *ctx, const char *name); void osmo_stream_cli_destroy(struct osmo_stream_cli *cli); int osmo_stream_cli_open(struct osmo_stream_cli *cli); diff --git a/src/stream.c b/src/stream.c index 23efe24..d52b7a0 100644 --- a/src/stream.c +++ b/src/stream.c @@ -37,6 +37,8 @@ #include <osmocom/core/utils.h> #include <osmocom/gsm/tlv.h> #include <osmocom/core/msgb.h> +#include <osmocom/core/osmo_io.h> +#include <osmocom/core/panic.h> #include <osmocom/core/logging.h> #include <osmocom/core/talloc.h> #include <osmocom/core/socket.h> @@ -247,8 +249,19 @@ #define OSMO_STREAM_MAX_ADDRS 1 #endif +enum osmo_stream_mode { + OSMO_STREAM_MODE_UNKNOWN, + OSMO_STREAM_MODE_OSMO_FD, + OSMO_STREAM_MODE_OSMO_IO, +}; + struct osmo_stream_cli { - struct osmo_fd ofd; + char *name; + enum osmo_stream_mode mode; + union { + struct osmo_fd ofd; + struct osmo_io_fd *iofd; + }; struct llist_head tx_queue; struct osmo_timer_list timer; enum osmo_stream_cli_state state; @@ -264,6 +277,7 @@ int (*connect_cb)(struct osmo_stream_cli *cli); int (*disconnect_cb)(struct osmo_stream_cli *cli); int (*read_cb)(struct osmo_stream_cli *cli); + int (*iofd_read_cb)(struct osmo_stream_cli *cli, struct msgb *msg); int (*write_cb)(struct osmo_stream_cli *cli); void *data; int flags; @@ -300,6 +314,23 @@ return cli->state == STREAM_CLI_STATE_CONNECTED; } +static void osmo_stream_cli_close_iofd(struct osmo_stream_cli *cli) +{ + if (!cli->iofd) + return; + + osmo_iofd_close(cli->iofd); +} + +static void osmo_stream_cli_close_ofd(struct osmo_stream_cli *cli) +{ + if (cli->ofd.fd == -1) + return; + osmo_fd_unregister(&cli->ofd); + close(cli->ofd.fd); + cli->ofd.fd = -1; +} + /*! \brief Close an Osmocom Stream Client * \param[in] cli Osmocom Stream Client to be closed * We unregister the socket fd from the osmocom select() loop @@ -314,9 +345,17 @@ return; } - osmo_fd_unregister(&cli->ofd); - close(cli->ofd.fd); - cli->ofd.fd = -1; + + switch (cli->mode) { + case OSMO_STREAM_MODE_OSMO_FD: + osmo_stream_cli_close_ofd(cli); + break; + case OSMO_STREAM_MODE_OSMO_IO: + osmo_stream_cli_close_iofd(cli); + break; + default: + OSMO_ASSERT(false); + } if (cli->state == STREAM_CLI_STATE_CONNECTED) { LOGSCLI(cli, LOGL_DEBUG, "connection closed\n"); @@ -329,7 +368,16 @@ static inline int osmo_stream_cli_fd(const struct osmo_stream_cli *cli) { - return cli->ofd.fd; + switch (cli->mode) { + case OSMO_STREAM_MODE_OSMO_FD: + return cli->ofd.fd; + case OSMO_STREAM_MODE_OSMO_IO: + if (cli->iofd) + return osmo_iofd_get_fd(cli->iofd); + default: + break; + } + return -EINVAL; } static void osmo_stream_cli_read(struct osmo_stream_cli *cli) @@ -445,7 +493,7 @@ /* If messages got enqueued while 'connecting', keep WRITE flag up to dispatch them upon next main loop step */ - if (llist_empty(&cli->tx_queue)) + if (cli->mode == OSMO_STREAM_MODE_OSMO_FD && llist_empty(&cli->tx_queue)) osmo_fd_write_disable(&cli->ofd); LOGSCLI(cli, LOGL_DEBUG, "connection established\n"); @@ -510,13 +558,79 @@ if (!cli) return NULL; + cli->name = ""; + cli->mode = OSMO_STREAM_MODE_UNKNOWN; cli->sk_domain = AF_UNSPEC; cli->sk_type = SOCK_STREAM; cli->proto = IPPROTO_TCP; - cli->ofd.fd = -1; - cli->ofd.priv_nr = 0; /* XXX */ - cli->ofd.cb = osmo_stream_cli_fd_cb; - cli->ofd.data = cli; + cli->state = STREAM_CLI_STATE_CLOSED; + osmo_timer_setup(&cli->timer, cli_timer_cb, cli); + cli->reconnect_timeout = 5; /* default is 5 seconds. */ + INIT_LLIST_HEAD(&cli->tx_queue); + + return cli; +} + +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); + + switch (cli->state) { + case STREAM_CLI_STATE_CONNECTING: + stream_cli_handle_connecting(cli, res); + break; + case STREAM_CLI_STATE_CONNECTED: + if (res == 0) + osmo_stream_cli_reconnect(cli); + else if (cli->iofd_read_cb) + cli->iofd_read_cb(cli, msg); + break; + default: + osmo_panic("osmo_stream_cli_write_cb() called with unexpected state %d\n", cli->state); + } +} + +static void stream_cli_iofd_write_cb(struct osmo_io_fd *iofd, int res, struct msgb *msg) +{ + struct osmo_stream_cli *cli = osmo_iofd_get_data(iofd); + + switch (cli->state) { + case STREAM_CLI_STATE_CONNECTING: + stream_cli_handle_connecting(cli, res); + break; + case STREAM_CLI_STATE_CONNECTED: + if (msg && res <= 0) { + osmo_stream_cli_reconnect(cli); + LOGSCLI(cli, LOGL_ERROR, "received error %d in response to send\n", res); + } + break; + default: + osmo_panic("osmo_stream_cli_write_cb() called with unexpected state %d\n", cli->state); + } +} + +static 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, +}; + + +struct osmo_stream_cli *osmo_stream_cli_create2(void *ctx, const char *name) +{ + struct osmo_stream_cli *cli; + + cli = talloc_zero(ctx, struct osmo_stream_cli); + if (!cli) + return NULL; + + cli->name = talloc_strdup(cli, name); + cli->mode = OSMO_STREAM_MODE_UNKNOWN; + cli->sk_domain = AF_UNSPEC; + cli->sk_type = SOCK_STREAM; + cli->proto = IPPROTO_TCP; + cli->state = STREAM_CLI_STATE_CLOSED; osmo_timer_setup(&cli->timer, cli_timer_cb, cli); cli->reconnect_timeout = 5; /* default is 5 seconds. */ @@ -712,6 +826,7 @@ struct osmo_fd * osmo_stream_cli_get_ofd(struct osmo_stream_cli *cli) { + OSMO_ASSERT(cli->mode == OSMO_STREAM_MODE_OSMO_FD); return &cli->ofd; } @@ -735,15 +850,35 @@ } /*! \brief Set the call-back function called to read from the stream client socket + * Only for osmo_stream_cli created with osmo_stream_cli_create() * \param[in] cli Stream Client to modify * \param[in] read_cb Call-back function to be called when we want to read */ void osmo_stream_cli_set_read_cb(struct osmo_stream_cli *cli, int (*read_cb)(struct osmo_stream_cli *cli)) { + OSMO_ASSERT(cli->mode != OSMO_STREAM_MODE_OSMO_IO); + cli->mode = OSMO_STREAM_MODE_OSMO_FD; + cli->ofd.fd = -1; + cli->ofd.priv_nr = 0; + cli->ofd.cb = osmo_stream_cli_fd_cb; + cli->ofd.data = cli; cli->read_cb = read_cb; } +/*! \brief Set the call-back function called to read from the stream client socket + * Only use this function for osmo_stream_cli created with osmo_stream_cli_create2() + * \param[in] cli Stream Client to modify + * \param[in] read_cb Call-back function to be called when data was read from the socket */ +void +osmo_stream_cli_set_read_cb2(struct osmo_stream_cli *cli, + int (*read_cb)(struct osmo_stream_cli *cli, struct msgb *msg)) +{ + OSMO_ASSERT(cli->mode != OSMO_STREAM_MODE_OSMO_FD); + cli->mode = OSMO_STREAM_MODE_OSMO_IO; + cli->iofd_read_cb = read_cb; +} + /*! \brief Destroy a Osmocom stream client (includes close) * \param[in] cli Stream Client to destroy */ void osmo_stream_cli_destroy(struct osmo_stream_cli *cli) @@ -882,17 +1017,33 @@ goto error_close_socket; } - osmo_fd_setup(&cli->ofd, fd, OSMO_FD_READ | OSMO_FD_WRITE, cli->ofd.cb, cli->ofd.data, cli->ofd.priv_nr); - if (osmo_fd_register(&cli->ofd) < 0) - goto error_close_socket; + switch (cli->mode) { + case OSMO_STREAM_MODE_OSMO_FD: + osmo_fd_setup(&cli->ofd, fd, OSMO_FD_READ | OSMO_FD_WRITE, cli->ofd.cb, cli->ofd.data, cli->ofd.priv_nr); + if (osmo_fd_register(&cli->ofd) < 0) + goto error_close_socket; + break; + case OSMO_STREAM_MODE_OSMO_IO: + if (!cli->iofd) + cli->iofd = osmo_iofd_setup(cli, fd, cli->name, OSMO_IO_FD_MODE_READ_WRITE, &osmo_stream_cli_ioops, cli); + if (!cli->iofd) + goto error_close_socket; + + if (osmo_iofd_register(cli->iofd, fd) < 0) + goto error_close_socket; + break; + default: + OSMO_ASSERT(false); + } cli->state = STREAM_CLI_STATE_CONNECTING; return 0; error_close_socket: cli->state = STREAM_CLI_STATE_CLOSED; - close(cli->ofd.fd); - cli->ofd.fd = -1; + close(fd); + if (cli->mode == OSMO_STREAM_MODE_OSMO_FD) + cli->ofd.fd = -1; return -EIO; } @@ -911,8 +1062,18 @@ { OSMO_ASSERT(cli); OSMO_ASSERT(msg); - msgb_enqueue(&cli->tx_queue, msg); - osmo_fd_write_enable(&cli->ofd); + + switch (cli->mode) { + case OSMO_STREAM_MODE_OSMO_FD: + msgb_enqueue(&cli->tx_queue, msg); + osmo_fd_write_enable(&cli->ofd); + break; + case OSMO_STREAM_MODE_OSMO_IO: + osmo_iofd_write_msgb(cli->iofd, msg); + break; + default: + OSMO_ASSERT(false); + } } /*! \brief Receive data via an Osmocom stream client @@ -944,11 +1105,20 @@ void osmo_stream_cli_clear_tx_queue(struct osmo_stream_cli *cli) { - msgb_queue_free(&cli->tx_queue); - /* If in state 'connecting', keep WRITE flag up to receive - * socket connection signal and then transition to STATE_CONNECTED: */ - if (cli->state == STREAM_CLI_STATE_CONNECTED) - osmo_fd_write_disable(&cli->ofd); + switch (cli->mode) { + case OSMO_STREAM_MODE_OSMO_FD: + msgb_queue_free(&cli->tx_queue); + /* If in state 'connecting', keep WRITE flag up to receive + * socket connection signal and then transition to STATE_CONNECTED: */ + if (cli->state == STREAM_CLI_STATE_CONNECTED) + osmo_fd_write_disable(&cli->ofd); + break; + case OSMO_STREAM_MODE_OSMO_IO: + osmo_iofd_txqueue_clear(cli->iofd); + break; + default: + OSMO_ASSERT(false); + } } /* @@ -1322,14 +1492,56 @@ struct osmo_stream_srv { struct osmo_stream_srv_link *srv; - struct osmo_fd ofd; + enum osmo_stream_mode mode; + union { + struct osmo_fd ofd; + struct osmo_io_fd *iofd; + }; struct llist_head tx_queue; int (*closed_cb)(struct osmo_stream_srv *peer); int (*read_cb)(struct osmo_stream_srv *peer); + int (*iofd_read_cb)(struct osmo_stream_srv *peer, struct msgb *msg); void *data; int flags; }; +static void stream_srv_iofd_read_cb(struct osmo_io_fd *iofd, int res, struct msgb *msg) +{ + struct osmo_stream_srv *conn = osmo_iofd_get_data(iofd); + LOGP(DLINP, LOGL_DEBUG, "message received (res=%d)\n", res); + + if (conn->flags & OSMO_STREAM_SRV_F_FLUSH_DESTROY) { + LOGP(DLINP, LOGL_INFO, "Connection is being flushed and closed; ignoring received message\n"); + msgb_free(msg); + return; + } + + if (res <= 0) { + osmo_stream_srv_set_flush_and_destroy(conn); + if (osmo_iofd_txqueue_len(iofd) == 0) + osmo_stream_srv_destroy(conn); + } else if (conn->iofd_read_cb) { + conn->iofd_read_cb(conn, msg); + } +} + +static void stream_srv_iofd_write_cb(struct osmo_io_fd *iofd, int res, struct msgb *msg) +{ + struct osmo_stream_srv *conn = osmo_iofd_get_data(iofd); + LOGP(DLINP, LOGL_DEBUG, "connected write\n"); + + if (res == -1) + LOGP(DLINP, LOGL_ERROR, "error to send: %s\n", strerror(errno)); + + if (osmo_iofd_txqueue_len(iofd) == 0) + if (conn->flags & OSMO_STREAM_SRV_F_FLUSH_DESTROY) + osmo_stream_srv_destroy(conn); +} + +static struct osmo_io_ops srv_ioops = { + .read_cb = stream_srv_iofd_read_cb, + .write_cb = stream_srv_iofd_write_cb, +}; static int osmo_stream_srv_read(struct osmo_stream_srv *conn) { int rc = 0; @@ -1429,6 +1641,10 @@ /*! \brief Create a Stream Server inside the specified link * \param[in] ctx talloc allocation context from which to allocate * \param[in] link Stream Server Link to which we belong + * \param[in] fd system file descriptor of the new connection + * \param[in] read_cb Call-back to call when the socket is readable + * \param[in] closed_cb Call-back to call when the connection is closed + * \param[in] data User data to save in the new Stream Server struct * \returns Stream Server in case of success; NULL on error */ struct osmo_stream_srv * osmo_stream_srv_create(void *ctx, struct osmo_stream_srv_link *link, @@ -1444,6 +1660,7 @@ if (conn == NULL) return NULL; + conn->mode = OSMO_STREAM_MODE_OSMO_FD; conn->srv = link; osmo_fd_setup(&conn->ofd, fd, OSMO_FD_READ, osmo_stream_srv_cb, conn, 0); conn->read_cb = read_cb; @@ -1459,6 +1676,62 @@ return conn; } +/*! \brief Create a Stream Server inside the specified link + * \param[in] ctx talloc allocation context from which to allocate + * \param[in] name name of the connection + * \param[in] link Stream Server Link to which we belong + * \param[in] fd system file descriptor of the new connection + * \param[in] data User data to save in the new Stream Server struct + * \returns Stream Server in case of success; NULL on error */ +struct osmo_stream_srv * +osmo_stream_srv_create2(void *ctx, const char *name, + struct osmo_stream_srv_link *link, int fd, void *data) +{ + struct osmo_stream_srv *conn; + + OSMO_ASSERT(link); + + conn = talloc_zero(ctx, struct osmo_stream_srv); + if (conn == NULL) + return NULL; + + conn->mode = OSMO_STREAM_MODE_OSMO_IO; + conn->srv = link; + conn->iofd = osmo_iofd_setup(conn, fd, name, OSMO_IO_FD_MODE_READ_WRITE, &srv_ioops, conn); + if (!conn->iofd) { + talloc_free(conn); + return NULL; + } + conn->data = data; + + if (osmo_iofd_register(conn->iofd, fd) < 0) { + LOGP(DLINP, LOGL_ERROR, "could not register FD %d\n", fd); + talloc_free(conn); + return NULL; + } + + return conn; +} + +/*! \brief Set the call-back function when data was read from the stream server socket + * Only for osmo_stream_srv created with osmo_stream_srv_create2() + * \param[in] conn Stream Server to modify + * \param[in] read_cb Call-back function to be called when data was read */ +void osmo_stream_srv_set_read_cb(struct osmo_stream_srv *conn, int (*read_cb)(struct osmo_stream_srv *conn, struct msgb *msg)) +{ + OSMO_ASSERT(conn && conn->mode == OSMO_STREAM_MODE_OSMO_IO); + conn->iofd_read_cb = read_cb; +} + +/*! \brief Set the call-back function called when the stream server socket was closed + * \param[in] conn Stream Server to modify + * \param[in] closed_cb Call-back function to be called when the connection was closed */ +void osmo_stream_srv_set_closed_cb(struct osmo_stream_srv *conn, int (*closed_cb)(struct osmo_stream_srv *conn)) +{ + OSMO_ASSERT(conn); + conn->closed_cb = closed_cb; +} + /*! \brief Prepare to send out all pending messages on the connection's Tx queue * and then automatically destroy the stream with osmo_stream_srv_destroy(). * This function disables queuing of new messages on the connection and also @@ -1512,12 +1785,21 @@ * \param[in] conn Stream Server to be destroyed */ void osmo_stream_srv_destroy(struct osmo_stream_srv *conn) { - osmo_fd_unregister(&conn->ofd); - close(conn->ofd.fd); - conn->ofd.fd = -1; + switch (conn->mode) { + case OSMO_STREAM_MODE_OSMO_FD: + osmo_fd_unregister(&conn->ofd); + close(conn->ofd.fd); + msgb_queue_free(&conn->tx_queue); + conn->ofd.fd = -1; + break; + case OSMO_STREAM_MODE_OSMO_IO: + osmo_iofd_free(conn->iofd); + break; + default: + OSMO_ASSERT(false); + } if (conn->closed_cb) conn->closed_cb(conn); - msgb_queue_free(&conn->tx_queue); talloc_free(conn); } @@ -1534,8 +1816,17 @@ return; } - msgb_enqueue(&conn->tx_queue, msg); - osmo_fd_write_enable(&conn->ofd); + switch (conn->mode) { + case OSMO_STREAM_MODE_OSMO_FD: + msgb_enqueue(&conn->tx_queue, msg); + osmo_fd_write_enable(&conn->ofd); + break; + case OSMO_STREAM_MODE_OSMO_IO: + osmo_iofd_write_msgb(conn->iofd, msg); + break; + default: + OSMO_ASSERT(false); + } } #ifdef HAVE_LIBSCTP -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/33193 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I2f52c7107c392b6f4b0bf2a84f8c873c084a200c Gerrit-Change-Number: 33193 Gerrit-PatchSet: 14 Gerrit-Owner: arehbein <arehbein(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[M] Change in osmo-mgw[master]: mgw: Allow auditing speciall 'null' endpoint
by pespin 15 Jun '23

15 Jun '23
Attention is currently required from: laforge, dexter. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/33312 ) Change subject: mgw: Allow auditing speciall 'null' endpoint ...................................................................... Patch Set 3: (1 comment) File src/libosmo-mgcp/mgcp_protocol.c: https://gerrit.osmocom.org/c/osmo-mgw/+/33312/comment/61ed9bf5_afa826c4 PS2, Line 473: > one option might be to turn the null endpoint into a real endpoint, one that just drops all data it […] The main discussion to start with would be: Do we still want the null endpoint to be per-trunk? That would mean it ends up like "rtpbridge/null@mgw", instead of "null@mgw" we have now. This means we would have a trunk pointer available in the handlers, which may be handy and maybe allow having less specific code paths. On the other hand, that means the user has to figure out which trunk to use. Regarding acceptance of any data: That would mean we need to still create a separate endpoint object internally in osmo-mgw. Since we don't really need that right now, I really preferred skipping it since it may take some effort, since special cases may need to be checked all along where "endp" objects are being used. -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/33312 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: Ia409b16e9211e6261e2e0f21288544289d6f3733 Gerrit-Change-Number: 33312 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Thu, 15 Jun 2023 15:25:52 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: laforge <laforge(a)osmocom.org> Comment-In-Reply-To: pespin <pespin(a)sysmocom.de> Comment-In-Reply-To: dexter <pmaier(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 109
  • 110
  • 111
  • 112
  • 113
  • 114
  • 115
  • ...
  • 248
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.