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

October 2022

  • 2 participants
  • 2331 discussions
Change in osmo-e1d[master]: Add osmo-e1gen to .gitignore
by tnt 04 Oct '22

04 Oct '22
tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1d/+/29619 ) Change subject: Add osmo-e1gen to .gitignore ...................................................................... Add osmo-e1gen to .gitignore Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com> Change-Id: I488b7eb2be52b59750ea780e4480923e423a1a66 --- M .gitignore 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1d refs/changes/19/29619/1 diff --git a/.gitignore b/.gitignore index 04b03bd..a552a2c 100644 --- a/.gitignore +++ b/.gitignore @@ -32,6 +32,7 @@ src/osmo-e1d src/osmo-e1d-pipe +src/osmo-e1gen contrib/e1-prbs-test/e1-prbs-test contrib/e1-prbs-test/ice40-e1-prbs-check -- To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/29619 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1d Gerrit-Branch: master Gerrit-Change-Id: I488b7eb2be52b59750ea780e4480923e423a1a66 Gerrit-Change-Number: 29619 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt(a)246tNt.com> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-e1d[master]: usb: Add support for new GPSDO status field "Accumulated error"
by tnt 04 Oct '22

04 Oct '22
tnt has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-e1d/+/29618 ) Change subject: usb: Add support for new GPSDO status field "Accumulated error" ...................................................................... usb: Add support for new GPSDO status field "Accumulated error" Because we want to handle older firmwares too, we need to excepect we might get a smaller structure ! (We can't get a larger one since the wLength we send is limited to the structure we know) Signed-off-by: Sylvain Munaut <tnt(a)246tNt.com> Change-Id: I4222bf22267f8343abf1e97546111ceb1c299846 --- M src/e1d.h M src/ice1usb_proto.h M src/intf_line.c M src/usb.c 4 files changed, 12 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-e1d refs/changes/18/29618/1 diff --git a/src/e1d.h b/src/e1d.h index 42be1b4..ff34800 100644 --- a/src/e1d.h +++ b/src/e1d.h @@ -67,6 +67,7 @@ LINE_GPSDO_TUNE_COARSE, LINE_GPSDO_TUNE_FINE, LINE_GPSDO_FREQ_EST, + LINE_GPSDO_ERR_ACC, }; enum e1_ts_mode { diff --git a/src/ice1usb_proto.h b/src/ice1usb_proto.h index 3170d55..38cb23b 100644 --- a/src/ice1usb_proto.h +++ b/src/ice1usb_proto.h @@ -65,6 +65,7 @@ uint8_t mode; /*!< Current configured operating mode */ struct e1usb_gpsdo_tune tune; /*!< Current VCXO tuning values */ uint32_t freq_est; /*!< Latest frequency estimate measurement */ + int16_t err_acc; /*!< Accumulated error */ } __attribute__((packed)); diff --git a/src/intf_line.c b/src/intf_line.c index a645cd3..c6cb686 100644 --- a/src/intf_line.c +++ b/src/intf_line.c @@ -75,6 +75,7 @@ [LINE_GPSDO_TUNE_COARSE]= { "gpsdo:tune:coarse", "GSPDO Coarse Tuning" }, [LINE_GPSDO_TUNE_FINE] = { "gpsdo:tune:fine", "GSPDO Fine Tuning" }, [LINE_GPSDO_FREQ_EST] = { "gpsdo:freq_est", "GSPDO Frequency Estimate" }, + [LINE_GPSDO_ERR_ACC] = { "gpsdo:acc_err", "GPSDO Accumulated Error" }, }; static const struct osmo_stat_item_group_desc line_stats_desc = { diff --git a/src/usb.c b/src/usb.c index fa6ddee..49e8dbe 100644 --- a/src/usb.c +++ b/src/usb.c @@ -706,14 +706,18 @@ { struct e1_usb_intf_data *id = intf->drv_data; struct e1usb_gpsdo_status *last_st = &id->gpsdo.last_status; - const struct e1usb_gpsdo_status *st; + const struct e1usb_gpsdo_status _st, *st = &_st; struct e1_line *line; if (len < sizeof(*st)) { - LOGPIF(intf, DE1D, LOGL_ERROR, "GPSDO status %zu < %zu!\n", len, sizeof(*st)); - return; + LOGPIF(intf, DE1D, LOGL_NOTICE, + "GPSDO status %zu < %zu ! Firmware probably outdated. " + "Some values will be zeroed\n", + len, sizeof(*st)); } - st = (const struct e1usb_gpsdo_status *) data; + + memset(st, 0x00, sizeof(*st)); + memcpy(st, data, len); if (st->state != last_st->state) { LOGPIF(intf, DE1D, LOGL_NOTICE, "GPSDO state change: %s -> %s\n", @@ -750,6 +754,7 @@ line_stat_set(line, LINE_GPSDO_TUNE_COARSE, libusb_le16_to_cpu(st->tune.coarse)); line_stat_set(line, LINE_GPSDO_TUNE_FINE, libusb_le16_to_cpu(st->tune.fine)); line_stat_set(line, LINE_GPSDO_FREQ_EST, osmo_load32le(&st->freq_est)); + line_stat_set(line, LINE_GPSDO_ERR_ACC, (int16_t)libusb_le16_to_cpu(st->err_acc)); } /* update our state */ -- To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/29618 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1d Gerrit-Branch: master Gerrit-Change-Id: I4222bf22267f8343abf1e97546111ceb1c299846 Gerrit-Change-Number: 29618 Gerrit-PatchSet: 1 Gerrit-Owner: tnt <tnt(a)246tNt.com> Gerrit-MessageType: newchange
1 0
0 0
Change in osmo-ttcn3-hacks[master]: bts: Log unexpected RSL message
by fixeria 04 Oct '22

04 Oct '22
Attention is currently required from: pespin. fixeria has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/29582 ) Change subject: bts: Log unexpected RSL message ...................................................................... Patch Set 1: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/29582 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: I6cdc53ff038858211b09c0a8eeec19603107ffe4 Gerrit-Change-Number: 29582 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Tue, 04 Oct 2022 18:00:04 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmo-ttcn3-hacks[master]: mgw: Set osmux bind-ip(-v6) VTY configs
by pespin 04 Oct '22

04 Oct '22
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/29616 ) Change subject: mgw: Set osmux bind-ip(-v6) VTY configs ...................................................................... mgw: Set osmux bind-ip(-v6) VTY configs Until now we forgot to properly configure the osmux socket local ip, but that was fine because 0.0.0.0 was taken as a default. With addition of IPv6, this changed, and the socket is not bound unless an IP address is set (to allow conditional use of IPv4, IPv6 or both). Depends: osmo-mgw.git Change-Id I446cd7da217e9f4a74995d7784ae55dcc60a29b7 Change-Id: I4e0ea11ae7e55da600aec56bebf694f3ba0f7b72 --- M mgw/expected-results.xml M mgw/osmo-mgw.cfg 2 files changed, 6 insertions(+), 24 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved diff --git a/mgw/expected-results.xml b/mgw/expected-results.xml index 89d5bf0..8b17fb1 100644 --- a/mgw/expected-results.xml +++ b/mgw/expected-results.xml @@ -80,31 +80,11 @@ <testcase classname='MGCP_Test' name='TC_crcx_mdcx_ip6' time='MASKED'/> <testcase classname='MGCP_Test' name='TC_two_crcx_mdcx_and_rtp_ipv4_ipv6' time='MASKED'/> <testcase classname='MGCP_Test' name='TC_two_crcx_mdcx_and_rtp_ipv6' time='MASKED'/> - <testcase classname='MGCP_Test' name='TC_two_crcx_and_rtp_osmux_bidir_ipv6' time='MASKED'> - <failure type='fail-verdict'>Received unexpected type from Osmux - MGCP_Test.ttcn:MASKED MGCP_Test control part - MGCP_Test.ttcn:MASKED TC_two_crcx_and_rtp_osmux_bidir_ipv6 testcase - </failure> - </testcase> - <testcase classname='MGCP_Test' name='TC_two_crcx_and_rtp_osmux_bidir_ipv4_ipv6' time='MASKED'> - <failure type='fail-verdict'>Received unexpected type from Osmux - MGCP_Test.ttcn:MASKED MGCP_Test control part - MGCP_Test.ttcn:MASKED TC_two_crcx_and_rtp_osmux_bidir_ipv4_ipv6 testcase - </failure> - </testcase> + <testcase classname='MGCP_Test' name='TC_two_crcx_and_rtp_osmux_bidir_ipv6' time='MASKED' /> + <testcase classname='MGCP_Test' name='TC_two_crcx_and_rtp_osmux_bidir_ipv4_ipv6' time='MASKED' /> <testcase classname='MGCP_Test' name='TC_two_crcx_and_rtp_osmux_bidir_ipv6_ipv4' time='MASKED'/> - <testcase classname='MGCP_Test' name='TC_two_crcx_mdcx_and_rtp_osmux_ipv6' time='MASKED'> - <failure type='fail-verdict'>Received unexpected type from Osmux - MGCP_Test.ttcn:MASKED MGCP_Test control part - MGCP_Test.ttcn:MASKED TC_two_crcx_mdcx_and_rtp_osmux_ipv6 testcase - </failure> - </testcase> - <testcase classname='MGCP_Test' name='TC_two_crcx_mdcx_and_rtp_osmux_ipv4_ipv6' time='MASKED'> - <failure type='fail-verdict'>Received unexpected type from Osmux - MGCP_Test.ttcn:MASKED MGCP_Test control part - MGCP_Test.ttcn:MASKED TC_two_crcx_mdcx_and_rtp_osmux_ipv4_ipv6 testcase - </failure> - </testcase> + <testcase classname='MGCP_Test' name='TC_two_crcx_mdcx_and_rtp_osmux_ipv6' time='MASKED' /> + <testcase classname='MGCP_Test' name='TC_two_crcx_mdcx_and_rtp_osmux_ipv4_ipv6' time='MASKED' /> <testcase classname='MGCP_Test' name='TC_two_crcx_mdcx_and_rtp_osmux_ipv6_ipv4' time='MASKED'/> <testcase classname='MGCP_Test' name='TC_two_crcx_mdcx_and_iuup' time='MASKED'/> <testcase classname='MGCP_Test' name='TC_two_crcx_mdcx_and_iuup_rfci_unordered' time='MASKED'/> diff --git a/mgw/osmo-mgw.cfg b/mgw/osmo-mgw.cfg index 8428cd3..1c5cfce 100644 --- a/mgw/osmo-mgw.cfg +++ b/mgw/osmo-mgw.cfg @@ -47,3 +47,5 @@ number endpoints 31 allow-transcoding osmux off + osmux bind-ip 127.0.0.1 + osmux bind-ip-v6 ::1 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/29616 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: I4e0ea11ae7e55da600aec56bebf694f3ba0f7b72 Gerrit-Change-Number: 29616 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-mgw[master]: osmux: Use available API to check if remote end is known
by pespin 04 Oct '22

04 Oct '22
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/29590 ) Change subject: osmux: Use available API to check if remote end is known ...................................................................... osmux: Use available API to check if remote end is known Since recently the port is guaranteed to be placed at CRCX/MDCX in the sockaddr, hence we can check it using the API instead of checking manually only for the address part. In osmux_send_dummy() we actually fix a bug where an in_addr was being compared against a struct sockaddr. Change-Id: I736e7f4c51e577d8eb0b96bc776f984f928b6d27 --- M src/libosmo-mgcp/mgcp_osmux.c 1 file changed, 2 insertions(+), 7 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved diff --git a/src/libosmo-mgcp/mgcp_osmux.c b/src/libosmo-mgcp/mgcp_osmux.c index 242f907..de0bc38 100644 --- a/src/libosmo-mgcp/mgcp_osmux.c +++ b/src/libosmo-mgcp/mgcp_osmux.c @@ -504,7 +504,6 @@ * overlapping RTP SSRC traveling to the BTSes behind the BSC, * similarly, for flows traveling to the MSC. */ - struct in6_addr addr_unset = {}; static const uint32_t rtp_ssrc_winlen = UINT32_MAX / (OSMUX_CID_MAX + 1); uint16_t osmux_dummy = endp->trunk->cfg->osmux_dummy; @@ -517,10 +516,7 @@ } /* Wait until we have the connection information from MDCX */ - if (memcmp(&conn->end.addr, &addr_unset, - conn->end.addr.u.sa.sa_family == AF_INET6 ? - sizeof(struct in6_addr) : - sizeof(struct in_addr)) == 0) { + if (!mgcp_rtp_end_remote_addr_available(&conn->end)) { LOGPCONN(conn->conn, DOSMUX, LOGL_INFO, "Osmux remote address/port still unknown\n"); return -1; @@ -622,7 +618,6 @@ char ipbuf[INET6_ADDRSTRLEN]; struct osmux_hdr *osmuxh; int buf_len; - struct in_addr addr_unset = {}; /*! The dummy packet will not be sent via the actual OSMUX connection, * instead it is sent out of band to port where the remote OSMUX @@ -634,7 +629,7 @@ * approach is simple though. */ /* Wait until we have the connection information from MDCX */ - if (memcmp(&conn->end.addr, &addr_unset, sizeof(addr_unset)) == 0) + if (!mgcp_rtp_end_remote_addr_available(&conn->end)) return 0; if (endp_osmux_state_check(endp, conn, true) < 0) -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29590 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I736e7f4c51e577d8eb0b96bc776f984f928b6d27 Gerrit-Change-Number: 29590 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-mgw[master]: Use new libosmocore API osmo_sockaddr_is_any()
by pespin 04 Oct '22

04 Oct '22
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/29587 ) Change subject: Use new libosmocore API osmo_sockaddr_is_any() ...................................................................... Use new libosmocore API osmo_sockaddr_is_any() Depends: libosmocore.git Change-Id I2810a889fc14052d0e0be6a2b500ad4e5088ffa9 Change-Id: Ib2ba708bdc834359de8a7cce302e2dc1f8c64954 --- M TODO-RELEASE M src/libosmo-mgcp/mgcp_network.c 2 files changed, 5 insertions(+), 15 deletions(-) Approvals: fixeria: Looks good to me, but someone else must approve laforge: Looks good to me, approved Jenkins Builder: Verified diff --git a/TODO-RELEASE b/TODO-RELEASE index 3e8b2ee..c480ba0 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -25,3 +25,4 @@ # #library what description / commit summary line libosmo-netif >1.2.0 OSMUX_DEFAULT_PORT, osmux_xfrm_output_*, osmux_xfrm_input_* +libosmocore >1.7.0 osmo_sockaddr_is_any() \ No newline at end of file diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c index 5246160..86a6330 100644 --- a/src/libosmo-mgcp/mgcp_network.c +++ b/src/libosmo-mgcp/mgcp_network.c @@ -72,20 +72,9 @@ static int rx_rtp(struct msgb *msg); -static bool addr_is_any(const struct osmo_sockaddr *osa) -{ - if (osa->u.sa.sa_family == AF_INET6) { - struct in6_addr ip6_any = IN6ADDR_ANY_INIT; - return memcmp(&osa->u.sin6.sin6_addr, - &ip6_any, sizeof(ip6_any)) == 0; - } else { - return osa->u.sin.sin_addr.s_addr == 0; - } -} - bool mgcp_rtp_end_remote_addr_available(const struct mgcp_rtp_end *rtp_end) { - return rtp_end->rtp_port && !addr_is_any(&rtp_end->addr); + return rtp_end->rtp_port && (osmo_sockaddr_is_any(&rtp_end->addr) == 0); } /*! Determine the local rtp bind IP-address. @@ -103,7 +92,7 @@ char ipbuf[INET6_ADDRSTRLEN]; int rc; endp = conn->conn->endp; - bool rem_addr_set = !addr_is_any(&conn->end.addr); + bool rem_addr_set = osmo_sockaddr_is_any(&conn->end.addr) == 0; char *bind_addr; /* Osmux: No smart IP addresses allocation is supported yet. Simply @@ -832,7 +821,7 @@ { char ipbuf[INET6_ADDRSTRLEN]; - if (addr_is_any(&conn->end.addr)) { + if (osmo_sockaddr_is_any(&conn->end.addr) != 0) { switch (conn->conn->mode) { case MGCP_CONN_LOOPBACK: /* HACK: for IuUP, we want to reply with an IuUP Initialization ACK upon the first RTP @@ -901,7 +890,7 @@ static int check_rtp_destin(struct mgcp_conn_rtp *conn) { char ipbuf[INET6_ADDRSTRLEN]; - bool ip_is_any = addr_is_any(&conn->end.addr); + bool ip_is_any = osmo_sockaddr_is_any(&conn->end.addr) != 0; /* Note: it is legal to create a connection but never setting a port * and IP-address for outgoing data. */ -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29587 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: Ib2ba708bdc834359de8a7cce302e2dc1f8c64954 Gerrit-Change-Number: 29587 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-mgw[master]: Get rid of separate rtp_port field
by pespin 04 Oct '22

04 Oct '22
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/29589 ) Change subject: Get rid of separate rtp_port field ...................................................................... Get rid of separate rtp_port field Let's use the port part of the struct mgcp_rtp_end->addr field instead of keeping it separate. This makes it easier passing around and using/checking the RTP remote address + port, and avoids confusion having to check stuff outside of the address, with its port part potentially unset. Change-Id: I294eb5d85fae79bf62d36eb9e818426e187d442c --- M include/osmocom/mgcp/mgcp.h M include/osmocom/mgcp/mgcp_network.h M src/libosmo-mgcp/mgcp_conn.c M src/libosmo-mgcp/mgcp_iuup.c M src/libosmo-mgcp/mgcp_network.c M src/libosmo-mgcp/mgcp_osmux.c M src/libosmo-mgcp/mgcp_protocol.c M src/libosmo-mgcp/mgcp_sdp.c M tests/mgcp/mgcp_test.c 9 files changed, 50 insertions(+), 70 deletions(-) Approvals: Jenkins Builder: Verified fixeria: Looks good to me, but someone else must approve laforge: Looks good to me, approved diff --git a/include/osmocom/mgcp/mgcp.h b/include/osmocom/mgcp/mgcp.h index a4d4e6f..4c541cb 100644 --- a/include/osmocom/mgcp/mgcp.h +++ b/include/osmocom/mgcp/mgcp.h @@ -208,4 +208,4 @@ int mgcp_create_bind(const char *source_addr, struct osmo_fd *fd, int port, uint8_t dscp, uint8_t prio); -int mgcp_udp_send(int fd, struct osmo_sockaddr *addr, int port, const char *buf, int len); +int mgcp_udp_send(int fd, const struct osmo_sockaddr *addr, const char *buf, int len); diff --git a/include/osmocom/mgcp/mgcp_network.h b/include/osmocom/mgcp/mgcp_network.h index 854c92d..349ff94 100644 --- a/include/osmocom/mgcp/mgcp_network.h +++ b/include/osmocom/mgcp/mgcp_network.h @@ -93,7 +93,7 @@ struct osmo_sockaddr addr; /* in network byte order */ - int rtp_port, rtcp_port; + int rtcp_port; /* currently selected audio codec */ struct mgcp_rtp_codec *codec; diff --git a/src/libosmo-mgcp/mgcp_conn.c b/src/libosmo-mgcp/mgcp_conn.c index cc309a3..08c9301 100644 --- a/src/libosmo-mgcp/mgcp_conn.c +++ b/src/libosmo-mgcp/mgcp_conn.c @@ -105,7 +105,8 @@ end->rtp.fd = -1; end->rtcp.fd = -1; - end->rtp_port = end->rtcp_port = 0; + memset(&end->addr, 0, sizeof(end->addr)); + end->rtcp_port = 0; talloc_free(end->fmtp_extra); end->fmtp_extra = NULL; @@ -368,7 +369,7 @@ conn->name, conn->id, osmo_sockaddr_ntop(&conn->u.rtp.end.addr.u.sa, ipbuf), - ntohs(conn->u.rtp.end.rtp_port), + osmo_sockaddr_port(&conn->u.rtp.end.addr.u.sa), ntohs(conn->u.rtp.end.rtcp_port)); break; diff --git a/src/libosmo-mgcp/mgcp_iuup.c b/src/libosmo-mgcp/mgcp_iuup.c index 48e4ce7..90021f3 100644 --- a/src/libosmo-mgcp/mgcp_iuup.c +++ b/src/libosmo-mgcp/mgcp_iuup.c @@ -489,7 +489,7 @@ "rtp_port:%u rtcp_port:%u\n", dest_name, osmo_sockaddr_ntop(&rtp_end->addr.u.sa, ipbuf), - ntohs(rtp_end->rtp_port), ntohs(rtp_end->rtcp_port) + osmo_sockaddr_port(&rtp_end->addr.u.sa), ntohs(rtp_end->rtcp_port) ); return 0; } @@ -505,14 +505,13 @@ LOGPENDP(endp, DRTP, LOGL_DEBUG, "process/send IuUP to %s %s rtp_port:%u rtcp_port:%u\n", dest_name, osmo_sockaddr_ntop(&rtp_end->addr.u.sa, ipbuf), - ntohs(rtp_end->rtp_port), ntohs(rtp_end->rtcp_port)); + osmo_sockaddr_port(&rtp_end->addr.u.sa), ntohs(rtp_end->rtcp_port)); /* Forward a copy of the RTP data to a debug ip/port */ forward_data_tap(rtp_end->rtp.fd, &conn_src->tap_out, msg); - len = mgcp_udp_send(rtp_end->rtp.fd, &rtp_end->addr, rtp_end->rtp_port, - (char *)hdr, buflen); + len = mgcp_udp_send(rtp_end->rtp.fd, &rtp_end->addr, (char *)hdr, buflen); if (len <= 0) return len; @@ -617,9 +616,8 @@ force_output_enabled = true; /* Fill in the peer address so that we can send Init-ACK back: */ prev_rem_addr = conn_rtp_src->end.addr; - prev_rem_rtp_port = conn_rtp_src->end.rtp_port; + prev_rem_rtp_port = osmo_sockaddr_port(&conn_rtp_src->end.addr.u.sa); conn_rtp_src->end.addr = *mc->from_addr; - conn_rtp_src->end.rtp_port = htons(osmo_sockaddr_port(&mc->from_addr->u.sa)); } rc = _conn_iuup_rtp_pl_up(conn_rtp_src, msg); @@ -627,7 +625,7 @@ if (force_output_enabled) { conn_rtp_src->end.output_enabled = prev_output_enabled; conn_rtp_src->end.addr = prev_rem_addr; - conn_rtp_src->end.rtp_port = prev_rem_rtp_port; + osmo_sockaddr_set_port(&conn_rtp_src->end.addr.u.sa, prev_rem_rtp_port); } return rc; diff --git a/src/libosmo-mgcp/mgcp_network.c b/src/libosmo-mgcp/mgcp_network.c index 86a6330..401bb09 100644 --- a/src/libosmo-mgcp/mgcp_network.c +++ b/src/libosmo-mgcp/mgcp_network.c @@ -74,7 +74,8 @@ bool mgcp_rtp_end_remote_addr_available(const struct mgcp_rtp_end *rtp_end) { - return rtp_end->rtp_port && (osmo_sockaddr_is_any(&rtp_end->addr) == 0); + return (osmo_sockaddr_port(&rtp_end->addr.u.sa) != 0) && + (osmo_sockaddr_is_any(&rtp_end->addr) == 0); } /*! Determine the local rtp bind IP-address. @@ -870,14 +871,14 @@ * the same as the remote port where we transmit outgoing RTP traffic * to (set by MDCX). We use this to check the origin of the data for * plausibility. */ - if (ntohs(conn->end.rtp_port) != osmo_sockaddr_port(&addr->u.sa) && + if (osmo_sockaddr_port(&conn->end.addr.u.sa) != osmo_sockaddr_port(&addr->u.sa) && ntohs(conn->end.rtcp_port) != osmo_sockaddr_port(&addr->u.sa)) { LOGPCONN(conn->conn, DRTP, LOGL_ERROR, "data from wrong source port: %d, ", osmo_sockaddr_port(&addr->u.sa)); LOGPC(DRTP, LOGL_ERROR, "expected: %d for RTP or %d for RTCP\n", - ntohs(conn->end.rtp_port), ntohs(conn->end.rtcp_port)); + osmo_sockaddr_port(&conn->end.addr.u.sa), ntohs(conn->end.rtcp_port)); LOGPCONN(conn->conn, DRTP, LOGL_ERROR, "packet tossed\n"); return -1; } @@ -891,27 +892,28 @@ { char ipbuf[INET6_ADDRSTRLEN]; bool ip_is_any = osmo_sockaddr_is_any(&conn->end.addr) != 0; + uint16_t port = osmo_sockaddr_port(&conn->end.addr.u.sa); /* Note: it is legal to create a connection but never setting a port * and IP-address for outgoing data. */ - if (ip_is_any && conn->end.rtp_port == 0) { + if (ip_is_any && port == 0) { LOGPCONN(conn->conn, DRTP, LOGL_DEBUG, "destination IP-address and rtp port is not (yet) known (%s:%u)\n", - osmo_sockaddr_ntop(&conn->end.addr.u.sa, ipbuf), conn->end.rtp_port); + osmo_sockaddr_ntop(&conn->end.addr.u.sa, ipbuf), port); return -1; } if (ip_is_any) { LOGPCONN(conn->conn, DRTP, LOGL_ERROR, "destination IP-address is invalid (%s:%u)\n", - osmo_sockaddr_ntop(&conn->end.addr.u.sa, ipbuf), conn->end.rtp_port); + osmo_sockaddr_ntop(&conn->end.addr.u.sa, ipbuf), port); return -1; } - if (conn->end.rtp_port == 0) { + if (port == 0) { LOGPCONN(conn->conn, DRTP, LOGL_ERROR, "destination rtp port is invalid (%s:%u)\n", - osmo_sockaddr_ntop(&conn->end.addr.u.sa, ipbuf), conn->end.rtp_port); + osmo_sockaddr_ntop(&conn->end.addr.u.sa, ipbuf), port); return -1; } @@ -1033,26 +1035,22 @@ /*! send udp packet. * \param[in] fd associated file descriptor. * \param[in] addr destination ip-address. - * \param[in] port destination UDP port (network byte order). * \param[in] buf buffer that holds the data to be send. * \param[in] len length of the data to be sent. * \returns bytes sent, -1 on error. */ -int mgcp_udp_send(int fd, struct osmo_sockaddr *addr, int port, const char *buf, int len) +int mgcp_udp_send(int fd, const struct osmo_sockaddr *addr, const char *buf, int len) { char ipbuf[INET6_ADDRSTRLEN]; size_t addr_len; - bool is_ipv6 = addr->u.sa.sa_family == AF_INET6; LOGP(DRTP, LOGL_DEBUG, "sending %i bytes length packet to %s:%u ...\n", len, osmo_sockaddr_ntop(&addr->u.sa, ipbuf), - ntohs(port)); + osmo_sockaddr_port(&addr->u.sa)); - if (is_ipv6) { - addr->u.sin6.sin6_port = port; + if (addr->u.sa.sa_family == AF_INET6) { addr_len = sizeof(addr->u.sin6); } else { - addr->u.sin.sin_port = port; addr_len = sizeof(addr->u.sin); } @@ -1067,6 +1065,7 @@ { int rc; int was_rtcp = 0; + struct osmo_sockaddr rtcp_addr; OSMO_ASSERT(endp); OSMO_ASSERT(conn); @@ -1083,7 +1082,7 @@ if (mgcp_conn_rtp_is_iuup(conn)) rc = mgcp_conn_iuup_send_dummy(conn); else - rc = mgcp_udp_send(conn->end.rtp.fd, &conn->end.addr, conn->end.rtp_port, + rc = mgcp_udp_send(conn->end.rtp.fd, &conn->end.addr, rtp_dummy_payload, sizeof(rtp_dummy_payload)); if (rc == -1) @@ -1093,8 +1092,10 @@ return rc; was_rtcp = 1; - rc = mgcp_udp_send(conn->end.rtcp.fd, &conn->end.addr, - conn->end.rtcp_port, rtp_dummy_payload, sizeof(rtp_dummy_payload)); + rtcp_addr = conn->end.addr; + osmo_sockaddr_set_port(&rtcp_addr.u.sa, ntohs(conn->end.rtcp_port)); + rc = mgcp_udp_send(conn->end.rtcp.fd, &rtcp_addr, + rtp_dummy_payload, sizeof(rtp_dummy_payload)); if (rc >= 0) return rc; @@ -1174,7 +1175,7 @@ "rtp_port:%u rtcp_port:%u\n", dest_name, osmo_sockaddr_ntop(&rtp_end->addr.u.sa, ipbuf), - ntohs(rtp_end->rtp_port), ntohs(rtp_end->rtcp_port) + osmo_sockaddr_port(&rtp_end->addr.u.sa), ntohs(rtp_end->rtcp_port) ); } else if (is_rtp) { int cont; @@ -1219,14 +1220,14 @@ "rtp_port:%u rtcp_port:%u\n", dest_name, osmo_sockaddr_ntop(&rtp_end->addr.u.sa, ipbuf), - ntohs(rtp_end->rtp_port), ntohs(rtp_end->rtcp_port) + osmo_sockaddr_port(&rtp_end->addr.u.sa), ntohs(rtp_end->rtcp_port) ); /* Forward a copy of the RTP data to a debug ip/port */ forward_data_tap(rtp_end->rtp.fd, &conn_src->tap_out, msg); - len = mgcp_udp_send(rtp_end->rtp.fd, &rtp_end->addr, rtp_end->rtp_port, + len = mgcp_udp_send(rtp_end->rtp.fd, &rtp_end->addr, (char *)msgb_data(msg), msgb_length(msg)); if (len <= 0) @@ -1241,15 +1242,17 @@ } while (buflen > 0); return nbytes; } else if (!trunk->omit_rtcp) { + struct osmo_sockaddr rtcp_addr = rtp_end->addr; + osmo_sockaddr_set_port(&rtcp_addr.u.sa, rtp_end->rtcp_port); LOGPENDP(endp, DRTP, LOGL_DEBUG, "send to %s %s rtp_port:%u rtcp_port:%u\n", - dest_name, osmo_sockaddr_ntop(&rtp_end->addr.u.sa, ipbuf), - ntohs(rtp_end->rtp_port), ntohs(rtp_end->rtcp_port) + dest_name, osmo_sockaddr_ntop(&rtcp_addr.u.sa, ipbuf), + osmo_sockaddr_port(&rtp_end->addr.u.sa), + osmo_sockaddr_port(&rtcp_addr.u.sa) ); - len = mgcp_udp_send(rtp_end->rtcp.fd, - &rtp_end->addr, - rtp_end->rtcp_port, (char *)msgb_data(msg), msgb_length(msg)); + len = mgcp_udp_send(rtp_end->rtcp.fd, &rtcp_addr, + (char *)msgb_data(msg), msgb_length(msg)); rtpconn_rate_ctr_inc(conn_dst, endp, RTP_PACKETS_TX_CTR); rtpconn_rate_ctr_add(conn_dst, endp, RTP_OCTETS_TX_CTR, len); @@ -1295,23 +1298,13 @@ * packets back to their origin. We will use the originating * address data from the UDP packet header to patch the * outgoing address in connection on the fly */ - if (conn->u.rtp.end.rtp_port == 0) { + if (osmo_sockaddr_port(&conn->u.rtp.end.addr.u.sa) == 0) { memcpy(&conn->u.rtp.end.addr, from_addr, sizeof(conn->u.rtp.end.addr)); - switch (from_addr->u.sa.sa_family) { - case AF_INET: - conn->u.rtp.end.rtp_port = from_addr->u.sin.sin_port; - break; - case AF_INET6: - conn->u.rtp.end.rtp_port = from_addr->u.sin6.sin6_port; - break; - default: - OSMO_ASSERT(false); - } LOG_CONN_RTP(conn_src, LOGL_NOTICE, "loopback mode: implicitly using source address (%s:%u) as destination address\n", osmo_sockaddr_ntop(&from_addr->u.sa, ipbuf), - conn->u.rtp.end.rtp_port); + osmo_sockaddr_port(&conn->u.rtp.end.addr.u.sa)); } return mgcp_send_rtp(conn_src, msg); } @@ -1370,23 +1363,13 @@ * packets back to their origin. We will use the originating * address data from the UDP packet header to patch the * outgoing address in connection on the fly */ - if (conn->u.rtp.end.rtp_port == 0) { + if (osmo_sockaddr_port(&conn->u.rtp.end.addr.u.sa) == 0) { memcpy(&conn->u.rtp.end.addr, from_addr, sizeof(conn->u.rtp.end.addr)); - switch (from_addr->u.sa.sa_family) { - case AF_INET: - conn->u.rtp.end.rtp_port = from_addr->u.sin.sin_port; - break; - case AF_INET6: - conn->u.rtp.end.rtp_port = from_addr->u.sin6.sin6_port; - break; - default: - OSMO_ASSERT(false); - } LOG_CONN_RTP(conn_src, LOGL_NOTICE, "loopback mode: implicitly using source address (%s:%u) as destination address\n", osmo_sockaddr_ntop(&from_addr->u.sa, ipbuf), - conn->u.rtp.end.rtp_port); + osmo_sockaddr_port(&conn->u.rtp.end.addr.u.sa)); } return mgcp_send_rtp(conn_src, msg); } diff --git a/src/libosmo-mgcp/mgcp_osmux.c b/src/libosmo-mgcp/mgcp_osmux.c index 23e4dad..242f907 100644 --- a/src/libosmo-mgcp/mgcp_osmux.c +++ b/src/libosmo-mgcp/mgcp_osmux.c @@ -338,7 +338,6 @@ switch(conn->osmux.state) { case OSMUX_STATE_ACTIVATING: rem_addr = conn->end.addr; - osmo_sockaddr_set_port(&rem_addr.u.sa, ntohs(conn->end.rtp_port)); if (osmux_enable_conn(endp, conn, &rem_addr) < 0) { LOGPCONN(conn->conn, DOSMUX, LOGL_ERROR, "Could not enable osmux for conn on %s: %s\n", @@ -651,10 +650,9 @@ 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.remote_cid); + osmo_sockaddr_port(&conn->end.addr.u.sa), conn->osmux.remote_cid); - return mgcp_udp_send(osmux_fd.fd, &conn->end.addr, - conn->end.rtp_port, (char*)osmuxh, buf_len); + return mgcp_udp_send(osmux_fd.fd, &conn->end.addr, (char *)osmuxh, buf_len); } /* bsc-nat allocates/releases the Osmux circuit ID. +7 to round up to 8 bit boundary. */ diff --git a/src/libosmo-mgcp/mgcp_protocol.c b/src/libosmo-mgcp/mgcp_protocol.c index 5493917..a257ffe 100644 --- a/src/libosmo-mgcp/mgcp_protocol.c +++ b/src/libosmo-mgcp/mgcp_protocol.c @@ -708,7 +708,7 @@ LOGPENDP(endp, DLMGCP, LOGL_DEBUG, "Configuring RTP endpoint: local port %d%s%s\n", - ntohs(rtp->rtp_port), + osmo_sockaddr_port(&rtp->addr.u.sa), rtp->force_aligned_timing ? ", force constant timing" : "", rtp->force_constant_ssrc ? ", force constant ssrc" : ""); } @@ -1057,7 +1057,7 @@ /* check connection mode setting */ if (conn->conn->mode != MGCP_CONN_LOOPBACK && conn->conn->mode != MGCP_CONN_RECV_ONLY - && conn->end.rtp_port == 0) { + && osmo_sockaddr_port(&conn->end.addr.u.sa) == 0) { LOGPCONN(_conn, DLMGCP, LOGL_ERROR, "CRCX: selected connection mode type requires an opposite end!\n"); error_code = 527; diff --git a/src/libosmo-mgcp/mgcp_sdp.c b/src/libosmo-mgcp/mgcp_sdp.c index 98b3099..1414cf9 100644 --- a/src/libosmo-mgcp/mgcp_sdp.c +++ b/src/libosmo-mgcp/mgcp_sdp.c @@ -384,7 +384,7 @@ case 'm': rc = sscanf(line, "m=audio %d RTP/AVP", &port); if (rc == 1) { - rtp->rtp_port = htons(port); + osmo_sockaddr_set_port(&rtp->addr.u.sa, port); rtp->rtcp_port = htons(port + 1); } @@ -432,7 +432,7 @@ LOGPCONN(conn->conn, DLMGCP, LOGL_NOTICE, "Got media info via SDP: port:%d, addr:%s, duration:%d, payload-types:", - ntohs(rtp->rtp_port), osmo_sockaddr_ntop(&rtp->addr.u.sa, ipbuf), + osmo_sockaddr_port(&rtp->addr.u.sa), osmo_sockaddr_ntop(&rtp->addr.u.sa, ipbuf), rtp->packet_duration_ms); if (codecs_used == 0) LOGPC(DLMGCP, LOGL_NOTICE, "none"); diff --git a/tests/mgcp/mgcp_test.c b/tests/mgcp/mgcp_test.c index e28a574..d843d10 100644 --- a/tests/mgcp/mgcp_test.c +++ b/tests/mgcp/mgcp_test.c @@ -1492,7 +1492,7 @@ conn = mgcp_conn_get_rtp(endp, conn_id); OSMO_ASSERT(conn); OSMO_ASSERT(conn->end.codec->payload_type == 3); - OSMO_ASSERT(conn->end.rtp_port == htons(16434)); + OSMO_ASSERT(osmo_sockaddr_port(&conn->end.addr.u.sa) == 16434); memset(&addr, 0, sizeof(addr)); inet_aton("8.8.8.8", &addr); OSMO_ASSERT(conn->end.addr.u.sa.sa_family == AF_INET); -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29589 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I294eb5d85fae79bf62d36eb9e818426e187d442c Gerrit-Change-Number: 29589 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: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
Change in osmo-e1-hardware[master]: icE1usb fw: Add Notify PPS on Carrier Detect option
by tnt 04 Oct '22

04 Oct '22
tnt has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-e1-hardware/+/29611 ) Change subject: icE1usb fw: Add Notify PPS on Carrier Detect option ...................................................................... Patch Set 2: (2 comments) Commit Message: https://gerrit.osmocom.org/c/osmo-e1-hardware/+/29611/comment/975b57c4_7e1d… PS2, Line 10: actually support PPS on CD for USB-CDC devices :( > I guess this is due to the fact that one generally assumes USB devices with no real CPU interrupt (j […] No, because it's supported on FTDI or PL2023 USB->Serial for instance. It's just that no one bother to implement it for USB CDC ACM devices. (And yes, the jitter / precision isn't great, but over long periods it's not all that bad) Patchset: PS2: > well, it is the kernel coding style to have "} else {". […] Yeah I know and in general I agree, but some times depending on surrounding code, it just doesn't "look" nice and makes it harder to read and so I don't adhere strictly. Just my 2ct anyway. -- To view, visit https://gerrit.osmocom.org/c/osmo-e1-hardware/+/29611 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1-hardware Gerrit-Branch: master Gerrit-Change-Id: Ie5d163434323a23912228003add9870fafefedf9 Gerrit-Change-Number: 29611 Gerrit-PatchSet: 2 Gerrit-Owner: tnt <tnt(a)246tNt.com> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Tue, 04 Oct 2022 17:23:59 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: laforge <laforge(a)osmocom.org> Comment-In-Reply-To: tnt <tnt(a)246tNt.com> Gerrit-MessageType: comment
1 0
0 0
Change in osmo-mgw[master]: Add Osmux IPv6 support
by laforge 04 Oct '22

04 Oct '22
Attention is currently required from: pespin. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/29614 ) Change subject: Add Osmux IPv6 support ...................................................................... Patch Set 2: Code-Review+1 -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29614 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I446cd7da217e9f4a74995d7784ae55dcc60a29b7 Gerrit-Change-Number: 29614 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Tue, 04 Oct 2022 17:17:56 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
Change in osmo-mgw[master]: osmux: Use available API to check if remote end is known
by laforge 04 Oct '22

04 Oct '22
Attention is currently required from: pespin. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/29590 ) Change subject: osmux: Use available API to check if remote end is known ...................................................................... Patch Set 3: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/29590 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-mgw Gerrit-Branch: master Gerrit-Change-Id: I736e7f4c51e577d8eb0b96bc776f984f928b6d27 Gerrit-Change-Number: 29590 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Comment-Date: Tue, 04 Oct 2022 17:17:32 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 197
  • 198
  • 199
  • 200
  • 201
  • 202
  • 203
  • ...
  • 234
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.