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

September 2022

  • 2 participants
  • 1860 discussions
Change in osmo-mgw[master]: vty: show per-connection Osmux VTY stats
by pespin 23 Sep '22

23 Sep '22
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/29471 ) Change subject: vty: show per-connection Osmux VTY stats ...................................................................... vty: show per-connection Osmux VTY stats Related: SYS#5987 Change-Id: Ieab6dcbd195c8e01a73a2a832bce78ee015ae1c3 --- M include/osmocom/mgcp/osmux.h M src/libosmo-mgcp/mgcp_osmux.c M src/libosmo-mgcp/mgcp_vty.c 3 files changed, 35 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/71/29471/1 diff --git a/include/osmocom/mgcp/osmux.h b/include/osmocom/mgcp/osmux.h index 1a99e6d..58d9095 100644 --- a/include/osmocom/mgcp/osmux.h +++ b/include/osmocom/mgcp/osmux.h @@ -34,6 +34,10 @@ OSMUX_STATE_ENABLED, /* Osmux was initialized by \ref osmux_enable_endpoint and can process frames */ }; +extern const struct value_string osmux_state_strs[]; +static inline const char *osmux_state_str(enum osmux_state val) +{ return get_value_string(osmux_state_strs, val); } + enum osmux_usage { OSMUX_USAGE_OFF = 0, OSMUX_USAGE_ON = 1, diff --git a/src/libosmo-mgcp/mgcp_osmux.c b/src/libosmo-mgcp/mgcp_osmux.c index 6ae0d8e..65783f3 100644 --- a/src/libosmo-mgcp/mgcp_osmux.c +++ b/src/libosmo-mgcp/mgcp_osmux.c @@ -41,6 +41,13 @@ int refcnt; }; +const struct value_string osmux_state_strs[] = { + { OSMUX_STATE_DISABLED, "disabled" }, + { OSMUX_STATE_ACTIVATING, "activating" }, + { OSMUX_STATE_ENABLED, "enabled" }, + { 0, NULL } +}; + static const struct rate_ctr_group_desc rate_ctr_group_osmux_desc = { .group_name_prefix = "conn_osmux", .group_description = "Osmux connection statistics", diff --git a/src/libosmo-mgcp/mgcp_vty.c b/src/libosmo-mgcp/mgcp_vty.c index 34c2d4b..1bf8789 100644 --- a/src/libosmo-mgcp/mgcp_vty.c +++ b/src/libosmo-mgcp/mgcp_vty.c @@ -197,6 +197,30 @@ VTY_NEWLINE, end->fmtp_extra, codec->audio_name, codec->subtype_name, VTY_NEWLINE, end->output_enabled, end->force_output_ptime, VTY_NEWLINE); + if (mgcp_conn_rtp_is_osmux(conn)) { + struct rate_ctr *rx_chunks, *rx_octets, *rtp_tx, *rtp_tx_dropped, *octets_tx; + rx_chunks = rate_ctr_group_get_ctr(conn->osmux.ctrg, OSMUX_CHUNKS_RX_CTR); + rx_octets = rate_ctr_group_get_ctr(conn->osmux.ctrg, OSMUX_OCTETS_RX_CTR); + rtp_tx = rate_ctr_group_get_ctr(conn->osmux.ctrg, OSMUX_RTP_PACKETS_TX_CTR); + rtp_tx_dropped = rate_ctr_group_get_ctr(conn->osmux.ctrg, OSMUX_RTP_PACKETS_TX_DROPPED_CTR); + octets_tx = rate_ctr_group_get_ctr(conn->osmux.ctrg, OSMUX_AMR_OCTETS_TX_CTR); + vty_out(vty, + " Osmux:%s" + " State: %s%s" + " Local CID: %d%s" + " Remote CID: %d%s" + " Chunks received: %" PRIu64 " (%" PRIu64 " bytes total)%s" + " RTP Packets encoded (Tx): %" PRIu64 " (%" PRIu64 " AMR octets total)%s" + " AMR payloads Dropped (Tx): %" PRIu64 "%s", + VTY_NEWLINE, osmux_state_str(conn->osmux.state), VTY_NEWLINE, + conn->osmux.local_cid_allocated ? conn->osmux.local_cid : -1, VTY_NEWLINE, + conn->osmux.remote_cid_present ? conn->osmux.remote_cid : -1, VTY_NEWLINE, + rx_chunks->current, rx_octets->current, VTY_NEWLINE, + rtp_tx->current, octets_tx->current, VTY_NEWLINE, + rtp_tx_dropped->current, VTY_NEWLINE + ); + + } } static void dump_endpoint(struct vty *vty, struct mgcp_endpoint *endp, -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29471 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: Ieab6dcbd195c8e01a73a2a832bce78ee015ae1c3 Gerrit-Change-Number: 29471 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in libosmo-netif[master]: osmux: osmux_xfrm_input(): Propagate error code to inform caller
by pespin 23 Sep '22

23 Sep '22
Attention is currently required from: pespin. Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/libosmo-netif/+/29468 to look at the new patch set (#2). Change subject: osmux: osmux_xfrm_input(): Propagate error code to inform caller ...................................................................... osmux: osmux_xfrm_input(): Propagate error code to inform caller This way the caller can log or make statistics based on the return code. All known implementations simply check the return code to be >0, so we are fine here. Change-Id: I981cc7e560cd9c792a8a2a219b3612f9834296ce --- M src/osmux.c 1 file changed, 8 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/68/29468/2 -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/29468 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I981cc7e560cd9c792a8a2a219b3612f9834296ce Gerrit-Change-Number: 29468 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newpatchset
1 0
0 0
Change in libosmo-netif[master]: osmux: osmux_xfrm_input(): Propagate error code to inform caller
by Jenkins Builder 23 Sep '22

23 Sep '22
Jenkins Builder has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/29468 ) Change subject: osmux: osmux_xfrm_input(): Propagate error code to inform caller ...................................................................... Patch Set 1: (1 comment) File src/osmux.c: Robot Comment from checkpatch (run ID jenkins-gerrit-libosmo-netif-lint-71): https://gerrit.osmocom.org/c/libosmo-netif/+/29468/comment/dd026f63_f1bacfac PS1, Line 759: * If negative value is returned, an error occured and the message has been 'occured' may be misspelled - perhaps 'occurred'? -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/29468 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I981cc7e560cd9c792a8a2a219b3612f9834296ce Gerrit-Change-Number: 29468 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-CC: Jenkins Builder Gerrit-Comment-Date: Fri, 23 Sep 2022 15:43:44 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
Change in libosmo-netif[master]: osmux: osmux_xfrm_input(): Propagate error code to inform caller
by pespin 23 Sep '22

23 Sep '22
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/29468 ) Change subject: osmux: osmux_xfrm_input(): Propagate error code to inform caller ...................................................................... osmux: osmux_xfrm_input(): Propagate error code to inform caller This way the caller can log or make statistics based on the return code. All known implementations simply check the return code to be >0, so we are fine here. Change-Id: I981cc7e560cd9c792a8a2a219b3612f9834296ce --- M src/osmux.c 1 file changed, 8 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/68/29468/1 diff --git a/src/osmux.c b/src/osmux.c index f54de7f..da826ad 100644 --- a/src/osmux.c +++ b/src/osmux.c @@ -754,9 +754,11 @@ * osmux_xfrm_input - add RTP message to OSmux batch * \param msg: RTP message that you want to batch into one OSmux message * - * If 0 is returned, this indicates that the message has been batched or that - * an error occured and we have skipped the message. If 1 is returned, you - * have to invoke osmux_xfrm_input_deliver and try again. + * If 0 is returned, this indicates that the message has been batched and the + * msgb is now owned by the osmux layer. + * If negative value is returned, an error occured and the message has been + * dropped (and freed). + * If 1 is returned, you have to invoke osmux_xfrm_input_deliver and try again. * * The function takes care of releasing the messages in case of error and * when building the batch. @@ -774,14 +776,14 @@ LOGP(DLMUX, LOGL_NOTICE, "RTP payload too big (%u) for configured batch size (%u)\n", msg->len, h->batch_size); msgb_free(msg); - return 0; + return -1; } rtph = osmo_rtp_get_hdr(msg); if (rtph == NULL) { LOGP(DLMUX, LOGL_NOTICE, "msg not containing an RTP header\n"); msgb_free(msg); - return 0; + return -1; } switch(rtph->payload_type) { @@ -805,7 +807,7 @@ */ LOGP(DLMUX, LOGL_DEBUG, "Dropping RTP packet instead of adding to batch\n"); msgb_free(msg); - return 0; + return ret; } h->stats.input_rtp_msgs++; -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/29468 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I981cc7e560cd9c792a8a2a219b3612f9834296ce Gerrit-Change-Number: 29468 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in libosmo-netif[master]: tests/osmo-pcap-test/osmux_test: Fix return condition check for osmux...
by pespin 23 Sep '22

23 Sep '22
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/29466 ) Change subject: tests/osmo-pcap-test/osmux_test: Fix return condition check for osmux_xfrm_input() ...................................................................... tests/osmo-pcap-test/osmux_test: Fix return condition check for osmux_xfrm_input() According to API doc and implementation, it never returns >1. Do as done in all other places where this API is used, that this check for >0. Change-Id: If23dfecb566f590b7a898356469df6e322f57653 --- M tests/osmo-pcap-test/osmux_test.c 1 file changed, 1 insertion(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/66/29466/1 diff --git a/tests/osmo-pcap-test/osmux_test.c b/tests/osmo-pcap-test/osmux_test.c index e6bbeb1..a1aa199 100644 --- a/tests/osmo-pcap-test/osmux_test.c +++ b/tests/osmo-pcap-test/osmux_test.c @@ -124,7 +124,7 @@ if (ccid < 0) register_ccid(rtph->ssrc); - while ((ret = osmux_xfrm_input(&h_input, msg, ccid)) > 1) { + while ((ret = osmux_xfrm_input(&h_input, msg, ccid)) > 0) { /* batch full, deliver it */ osmux_xfrm_input_deliver(&h_input); } -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/29466 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: If23dfecb566f590b7a898356469df6e322f57653 Gerrit-Change-Number: 29466 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in libosmo-netif[master]: osmux: Improve logging non-usual conditions
by pespin 23 Sep '22

23 Sep '22
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-netif/+/29467 ) Change subject: osmux: Improve logging non-usual conditions ...................................................................... osmux: Improve logging non-usual conditions Change-Id: I854b0ae78e7e701ec3cb0525063f7292185d05a3 --- M src/osmux.c 1 file changed, 8 insertions(+), 1 deletion(-) git pull ssh://gerrit.osmocom.org:29418/libosmo-netif refs/changes/67/29467/1 diff --git a/src/osmux.c b/src/osmux.c index 5515e88..f54de7f 100644 --- a/src/osmux.c +++ b/src/osmux.c @@ -686,8 +686,10 @@ batch->ndummy--; } amr_payload_len = osmux_rtp_amr_payload_len(msg, rtph); - if (amr_payload_len < 0) + if (amr_payload_len < 0) { + LOGP(DLMUX, LOGL_NOTICE, "AMR payload invalid\n"); return -1; + } /* First check if there is room for this message in the batch */ bytes += amr_payload_len; @@ -769,18 +771,22 @@ * to avoid a possible forever loop in the caller. */ if (msg->len > h->batch_size - sizeof(struct osmux_hdr)) { + LOGP(DLMUX, LOGL_NOTICE, "RTP payload too big (%u) for configured batch size (%u)\n", + msg->len, h->batch_size); msgb_free(msg); return 0; } rtph = osmo_rtp_get_hdr(msg); if (rtph == NULL) { + LOGP(DLMUX, LOGL_NOTICE, "msg not containing an RTP header\n"); msgb_free(msg); return 0; } switch(rtph->payload_type) { case RTP_PT_RTCP: + LOGP(DLMUX, LOGL_INFO, "Dropping RTCP packet\n"); msgb_free(msg); return 0; default: @@ -797,6 +803,7 @@ * Malformed, duplicated, OOM. Drop it and tell * the upper layer that we have digest it. */ + LOGP(DLMUX, LOGL_DEBUG, "Dropping RTP packet instead of adding to batch\n"); msgb_free(msg); return 0; } -- To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/29467 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-netif Gerrit-Branch: master Gerrit-Change-Id: I854b0ae78e7e701ec3cb0525063f7292185d05a3 Gerrit-Change-Number: 29467 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-ci[master]: scripts/obs: make shallow git clones
by pespin 23 Sep '22

23 Sep '22
Attention is currently required from: msuraev. pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ci/+/29464 ) Change subject: scripts/obs: make shallow git clones ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/29464 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: I71629c244d2c29728a88871e83b20493341321c8 Gerrit-Change-Number: 29464 Gerrit-PatchSet: 1 Gerrit-Owner: msuraev <msuraev(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: msuraev <msuraev(a)sysmocom.de> Gerrit-Comment-Date: Fri, 23 Sep 2022 15:10:51 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmo-ci[master]: scripts/obs: make shallow git clones
by osmith 23 Sep '22

23 Sep '22
Attention is currently required from: msuraev. osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ci/+/29464 ) Change subject: scripts/obs: make shallow git clones ...................................................................... Patch Set 1: Code-Review+1 (1 comment) Patchset: PS1: nice! I considered this as well but thought it would run into problems when building the latest tag instead of nightly. But with --no-single-branch this still works as expected. $ ./build_srcpkg.py -f latest libosmocore libosmocore: cloning https://gerrit.osmocom.org/libosmocore libosmocore: 'git clean -ffxd' libosmocore: 'git checkout -f 1.7.0' libosmocore: 'git reset --hard 1.7.0' libosmocore: building source package 1.7.0 libosmocore: building debian source package libosmocore: generating rpm spec file -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/29464 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: I71629c244d2c29728a88871e83b20493341321c8 Gerrit-Change-Number: 29464 Gerrit-PatchSet: 1 Gerrit-Owner: msuraev <msuraev(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: msuraev <msuraev(a)sysmocom.de> Gerrit-Comment-Date: Fri, 23 Sep 2022 15:09:02 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmo-mgw[master]: osmux: Support local CID != remote CID
by pespin 23 Sep '22

23 Sep '22
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/29465 ) Change subject: osmux: Support local CID != remote CID ...................................................................... osmux: Support local CID != remote CID So far the implementation only allowed the remote CID being the same as the one dynamically implemented internally. Related: SYS#6138 Change-Id: I6b03eabc0305580c9788c529bec7dda9044a008f --- M include/osmocom/mgcp/mgcp_conn.h M include/osmocom/mgcp/osmux.h M src/libosmo-mgcp/mgcp_conn.c M src/libosmo-mgcp/mgcp_osmux.c M src/libosmo-mgcp/mgcp_protocol.c 5 files changed, 66 insertions(+), 63 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/65/29465/1 diff --git a/include/osmocom/mgcp/mgcp_conn.h b/include/osmocom/mgcp/mgcp_conn.h index 14ddfbb..9ffa7dc 100644 --- a/include/osmocom/mgcp/mgcp_conn.h +++ b/include/osmocom/mgcp/mgcp_conn.h @@ -80,10 +80,14 @@ struct { /* Osmux state: disabled, activating, active */ enum osmux_state state; - /* Is cid holding valid data? is it allocated from pool? */ - bool cid_allocated; - /* Allocated Osmux circuit ID for this conn */ - uint8_t cid; + /* Is local_cid holding valid data? is it allocated from pool? */ + bool local_cid_allocated; + /* Allocated local Osmux circuit ID for this conn */ + uint8_t local_cid; + /* Is remote_cid holding valid data? was it already received from client? */ + bool remote_cid_present; + /* Received remote Osmux circuit ID for this conn */ + uint8_t remote_cid; /* handle to batch messages, shared (refcounted) among several conns */ struct osmux_in_handle *in; /* handle to unbatch messages, one allocated and owned per conn */ diff --git a/include/osmocom/mgcp/osmux.h b/include/osmocom/mgcp/osmux.h index 26c1bdf..1a99e6d 100644 --- a/include/osmocom/mgcp/osmux.h +++ b/include/osmocom/mgcp/osmux.h @@ -17,8 +17,8 @@ int osmux_enable_conn(struct mgcp_endpoint *endp, struct mgcp_conn_rtp *conn, const struct osmo_sockaddr *addr); void conn_osmux_disable(struct mgcp_conn_rtp *conn); -int conn_osmux_allocate_cid(struct mgcp_conn_rtp *conn, int osmux_cid); -void conn_osmux_release_cid(struct mgcp_conn_rtp *conn); +int conn_osmux_allocate_local_cid(struct mgcp_conn_rtp *conn); +void conn_osmux_release_local_cid(struct mgcp_conn_rtp *conn); int osmux_xfrm_to_osmux(char *buf, int buf_len, struct mgcp_conn_rtp *conn); int osmux_send_dummy(struct mgcp_endpoint *endp, struct mgcp_conn_rtp *conn); diff --git a/src/libosmo-mgcp/mgcp_conn.c b/src/libosmo-mgcp/mgcp_conn.c index d963a56..cc309a3 100644 --- a/src/libosmo-mgcp/mgcp_conn.c +++ b/src/libosmo-mgcp/mgcp_conn.c @@ -95,8 +95,10 @@ static atomic_uint rate_ctr_index = 0; conn_rtp->type = MGCP_RTP_DEFAULT; - conn_rtp->osmux.cid_allocated = false; - conn_rtp->osmux.cid = 0; + conn_rtp->osmux.local_cid_allocated = false; + conn_rtp->osmux.local_cid = 0; + conn_rtp->osmux.remote_cid_present = false; + conn_rtp->osmux.remote_cid = 0; /* backpointer to the generic part of the connection */ conn->u.rtp.conn = conn; diff --git a/src/libosmo-mgcp/mgcp_osmux.c b/src/libosmo-mgcp/mgcp_osmux.c index 83a96fe..72152c7 100644 --- a/src/libosmo-mgcp/mgcp_osmux.c +++ b/src/libosmo-mgcp/mgcp_osmux.c @@ -210,7 +210,7 @@ if (conn->osmux.state != OSMUX_STATE_ENABLED) { LOGPCONN(conn->conn, DOSMUX, LOGL_INFO, "forwarding RTP to Osmux conn not yet enabled, dropping (cid=%d)\n", - conn->osmux.cid); + conn->osmux.remote_cid); rtpconn_rate_ctr_inc(conn, conn->conn->endp, OSMUX_DROPPED_AMR_PAYLOADS_CTR); return -1; } @@ -222,7 +222,7 @@ memcpy(msg->data, buf, buf_len); msgb_put(msg, buf_len); - while ((ret = osmux_xfrm_input(conn->osmux.in, msg, conn->osmux.cid)) > 0) { + while ((ret = osmux_xfrm_input(conn->osmux.in, msg, conn->osmux.remote_cid)) > 0) { /* batch full, build and deliver it */ osmux_xfrm_input_deliver(conn->osmux.in); } @@ -231,7 +231,7 @@ /* Lookup the endpoint that corresponds to the specified address (port) */ static struct mgcp_conn_rtp* -osmux_conn_lookup(struct mgcp_trunk *trunk, uint8_t cid, const struct osmo_sockaddr *rem_addr) +osmux_conn_lookup(struct mgcp_trunk *trunk, uint8_t local_cid, const struct osmo_sockaddr *rem_addr) { struct mgcp_endpoint *endp; struct mgcp_conn *conn = NULL; @@ -252,13 +252,13 @@ /* FIXME: Match remote address! */ - if (conn_rtp->osmux.cid == cid) + if (conn_rtp->osmux.local_cid == local_cid) return conn_rtp; } } - LOGP(DOSMUX, LOGL_ERROR, "Cannot find osmux conn with rem_addr=%s cid=%d\n", - osmo_sockaddr_to_str(rem_addr), cid); + LOGP(DOSMUX, LOGL_ERROR, "Cannot find osmux conn with rem_addr=%s local_cid=%d\n", + osmo_sockaddr_to_str(rem_addr), local_cid); return NULL; } @@ -327,7 +327,8 @@ LOGPCONN(conn->conn, DOSMUX, LOGL_INFO, "Osmux %s CID %u towards %s is now enabled\n", sending ? "sent" : "received", - conn->osmux.cid, osmo_sockaddr_to_str(&rem_addr)); + sending ? conn->osmux.remote_cid : conn->osmux.local_cid, + osmo_sockaddr_to_str(&rem_addr)); return 0; case OSMUX_STATE_ENABLED: return 0; @@ -517,16 +518,16 @@ mgcp_conn_dump(conn->conn)); return -1; } - if (osmux_xfrm_input_open_circuit(conn->osmux.in, conn->osmux.cid, osmux_dummy) < 0) { + if (osmux_xfrm_input_open_circuit(conn->osmux.in, conn->osmux.remote_cid, osmux_dummy) < 0) { LOGPCONN(conn->conn, DOSMUX, LOGL_ERROR, "Cannot open osmux circuit %u for conn:%s\n", - conn->osmux.cid, mgcp_conn_dump(conn->conn)); + conn->osmux.remote_cid, mgcp_conn_dump(conn->conn)); return -1; } conn->osmux.out = osmux_xfrm_output_alloc(conn->conn); osmux_xfrm_output_set_rtp_ssrc(conn->osmux.out, - (conn->osmux.cid * rtp_ssrc_winlen) + + (conn->osmux.remote_cid * rtp_ssrc_winlen) + (random() % rtp_ssrc_winlen)); osmux_xfrm_output_set_rtp_pl_type(conn->osmux.out, conn->end.codec->payload_type); osmux_xfrm_output_set_tx_cb(conn->osmux.out, @@ -547,7 +548,7 @@ OSMO_ASSERT(conn->osmux.state != OSMUX_STATE_DISABLED); LOGPCONN(conn->conn, DOSMUX, LOGL_INFO, - "Releasing connection using Osmux CID %u\n", conn->osmux.cid); + "Releasing connection using local Osmux CID %u\n", conn->osmux.local_cid); struct rate_ctr_group *all_osmux_stats = conn->conn->endp->trunk->ratectr.all_osmux_conn_stats; rate_ctr_inc(rate_ctr_group_get_ctr(all_osmux_stats, OSMUX_NUM_CONNECTIONS)); @@ -557,53 +558,44 @@ osmux_xfrm_output_set_tx_cb(conn->osmux.out, NULL, NULL); TALLOC_FREE(conn->osmux.out); - osmux_xfrm_input_close_circuit(conn->osmux.in, conn->osmux.cid); + osmux_xfrm_input_close_circuit(conn->osmux.in, conn->osmux.remote_cid); conn->osmux.state = OSMUX_STATE_DISABLED; osmux_handle_put(conn->osmux.in); + conn->osmux.remote_cid = 0; + conn->osmux.remote_cid_present = false; rate_ctr_group_free(conn->osmux.ctrg); conn->osmux.ctrg = NULL; } - conn_osmux_release_cid(conn); + conn_osmux_release_local_cid(conn); } /*! relase OSXMUX cid, that had been allocated to this connection. * \param[in] conn connection with OSMUX cid to release */ -void conn_osmux_release_cid(struct mgcp_conn_rtp *conn) +void conn_osmux_release_local_cid(struct mgcp_conn_rtp *conn) { - if (conn->osmux.cid_allocated) - osmux_cid_pool_put(conn->osmux.cid); - conn->osmux.cid = 0; - conn->osmux.cid_allocated = false; + if (conn->osmux.local_cid_allocated) + osmux_cid_pool_put(conn->osmux.local_cid); + conn->osmux.local_cid = 0; + conn->osmux.local_cid_allocated = false; } -/*! allocate OSXMUX cid to connection. - * \param[in] conn connection for which we allocate the OSMUX cid - * \param[in] osmux_cid OSMUX cid to allocate. -1 Means take next available one. - * \returns Allocated OSMUX cid, -1 on error (no free cids avail, or selected one is already taken). +/*! allocate local OSMUX cid to connection. + * \param[in] conn connection for which we allocate the local OSMUX cid + * \returns Allocated OSMUX cid, -1 on error (no free CIDs avail). */ -int conn_osmux_allocate_cid(struct mgcp_conn_rtp *conn, int osmux_cid) +int conn_osmux_allocate_local_cid(struct mgcp_conn_rtp *conn) { - if (osmux_cid != -1 && osmux_cid_pool_allocated((uint8_t) osmux_cid)) { + OSMO_ASSERT(conn->osmux.local_cid_allocated == false); + int osmux_cid = osmux_cid_pool_get_next(); + if (osmux_cid == -1) { LOGPCONN(conn->conn, DOSMUX, LOGL_INFO, - "Osmux CID %d already allocated!\n", - osmux_cid); + "no available local Osmux CID to allocate!\n"); return -1; } - if (osmux_cid == -1) { - osmux_cid = osmux_cid_pool_get_next(); - if (osmux_cid == -1) { - LOGPCONN(conn->conn, DOSMUX, LOGL_INFO, - "no available Osmux CID to allocate!\n"); - return -1; - } - } else { - osmux_cid_pool_get(osmux_cid); - } - - conn->osmux.cid = (uint8_t) osmux_cid; - conn->osmux.cid_allocated = true; + conn->osmux.local_cid = (uint8_t) osmux_cid; + conn->osmux.local_cid_allocated = true; conn->type = MGCP_OSMUX_BSC; return osmux_cid; } @@ -640,12 +632,12 @@ memset(osmuxh, 0, buf_len); osmuxh->ft = OSMUX_FT_DUMMY; osmuxh->amr_ft = AMR_FT_0; - osmuxh->circuit_id = conn->osmux.cid; + osmuxh->circuit_id = conn->osmux.remote_cid; LOGPCONN(conn->conn, DOSMUX, LOGL_DEBUG, "sending OSMUX dummy load to %s:%u CID %u\n", osmo_sockaddr_ntop(&conn->end.addr.u.sa, ipbuf), - ntohs(conn->end.rtp_port), conn->osmux.cid); + ntohs(conn->end.rtp_port), conn->osmux.remote_cid); return mgcp_udp_send(osmux_fd.fd, &conn->end.addr, conn->end.rtp_port, (char*)osmuxh, buf_len); diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index 7f31cfd..506de34 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -301,7 +301,7 @@ /* Attach optional OSMUX parameters */ if (mgcp_conn_rtp_is_osmux(conn)) { - rc = msgb_printf(sdp, MGCP_X_OSMO_OSMUX_HEADER " %u\r\n", conn->osmux.cid); + rc = msgb_printf(sdp, MGCP_X_OSMO_OSMUX_HEADER " %u\r\n", conn->osmux.local_cid); if (rc < 0) goto error; } @@ -846,7 +846,7 @@ const char *callid = NULL; const char *mode = NULL; char *line; - int have_sdp = 0, osmux_cid = -2; + int have_sdp = 0, remote_osmux_cid = -2; struct mgcp_conn_rtp *conn = NULL; struct mgcp_conn *_conn = NULL; char conn_name[512]; @@ -895,7 +895,7 @@ /* If osmux is disabled, just skip setting it up */ if (rq->endp->trunk->cfg->osmux_use == OSMUX_USAGE_OFF) break; - osmux_cid = mgcp_osmux_setup(endp, line); + remote_osmux_cid = mgcp_osmux_setup(endp, line); break; } @@ -1001,12 +1001,17 @@ /* Annotate Osmux circuit ID and set it to negotiating state until this * is fully set up from the dummy load. */ conn->osmux.state = OSMUX_STATE_DISABLED; - if (osmux_cid >= -1) { /* -1 is wilcard, alloc next avail CID */ + /* If X-Osmux (remote CID) was received (-1 is wilcard), alloc next avail CID as local CID */ + if (remote_osmux_cid >= -1) { conn->osmux.state = OSMUX_STATE_ACTIVATING; - if (conn_osmux_allocate_cid(conn, osmux_cid) == -1) { + if (conn_osmux_allocate_local_cid(conn) == -1) { rate_ctr_inc(rate_ctr_group_get_ctr(rate_ctrs, MGCP_CRCX_FAIL_NO_OSMUX)); goto error2; } + if (remote_osmux_cid >= 0) { + conn->osmux.remote_cid_present = true; + conn->osmux.remote_cid = remote_osmux_cid; + } } else if (endp->trunk->cfg->osmux_use == OSMUX_USAGE_ONLY) { LOGPCONN(_conn, DLMGCP, LOGL_ERROR, "CRCX: osmux only and no osmux offered\n"); @@ -1118,7 +1123,7 @@ const char *mode = NULL; struct mgcp_conn_rtp *conn = NULL; const char *conn_id = NULL; - int osmux_cid = -2; + int remote_osmux_cid = -2; int rc; LOGPENDP(endp, DLMGCP, LOGL_NOTICE, "MDCX: modifying existing connection ...\n"); @@ -1176,7 +1181,7 @@ /* If osmux is disabled, just skip setting it up */ if (endp->trunk->cfg->osmux_use == OSMUX_USAGE_OFF) break; - osmux_cid = mgcp_osmux_setup(endp, line); + remote_osmux_cid = mgcp_osmux_setup(endp, line); break; } /* Ignore unknown X-headers */ @@ -1253,23 +1258,23 @@ } if (mgcp_conn_rtp_is_osmux(conn)) { - OSMO_ASSERT(conn->osmux.cid_allocated); - if (osmux_cid < -1) { + OSMO_ASSERT(conn->osmux.local_cid_allocated); + if (remote_osmux_cid < -1) { LOGPCONN(conn->conn, DLMGCP, LOGL_ERROR, "MDCX: Failed to parse Osmux CID!\n"); goto error3; - } else if (osmux_cid == -1) { + } else if (remote_osmux_cid == -1) { LOGPCONN(conn->conn, DLMGCP, LOGL_ERROR, "MDCX: wilcard in MDCX is not supported!\n"); goto error3; - } else if (osmux_cid != (int) conn->osmux.cid) { + } else if (conn->osmux.remote_cid_present && + remote_osmux_cid != (int) conn->osmux.remote_cid) { LOGPCONN(conn->conn, DLMGCP, LOGL_ERROR, "MDCX: changing already allocated CID is not supported!\n"); goto error3; } - /* TODO: In the future (when we have recvCID!=sendCID), we need to - tell Osmux code that osmux_cid is to be used as sendCID for - that conn. */ + conn->osmux.remote_cid_present = true; + conn->osmux.remote_cid = remote_osmux_cid; } /* MDCX may have provided a new remote address, which means we may need -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29465 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I6b03eabc0305580c9788c529bec7dda9044a008f Gerrit-Change-Number: 29465 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-ci[master]: scripts/obs: make shallow git clones
by msuraev 23 Sep '22

23 Sep '22
msuraev has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ci/+/29464 ) Change subject: scripts/obs: make shallow git clones ...................................................................... Set Ready For Review -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/29464 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: I71629c244d2c29728a88871e83b20493341321c8 Gerrit-Change-Number: 29464 Gerrit-PatchSet: 1 Gerrit-Owner: msuraev <msuraev(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Comment-Date: Fri, 23 Sep 2022 14:41:12 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: No Gerrit-MessageType: comment
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 43
  • 44
  • 45
  • 46
  • 47
  • 48
  • 49
  • ...
  • 186
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.