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 -----
  • December
  • 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

August 2023

  • 1 participants
  • 1514 discussions
[M] Change in libosmo-sccp[master]: ss7: Use libosmo-netif's osmo_stream_{cli,srv}_recv() APIs
by laforge 21 Aug '23

21 Aug '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/34089 ) Change subject: ss7: Use libosmo-netif's osmo_stream_{cli,srv}_recv() APIs ...................................................................... ss7: Use libosmo-netif's osmo_stream_{cli,srv}_recv() APIs Since libosmo-netif.git Change-Id I4cb94d264109f1b763cccd44c6ba049cc7509319, we receive SCTP notifications in both client and srv, so there's no real need to use sctp_recvmsg() directly. Change-Id: If3d78b636e8e224aa9c8597d0b242e29d3e3c84e --- M TODO-RELEASE M src/osmo_ss7.c 2 files changed, 58 insertions(+), 59 deletions(-) Approvals: Jenkins Builder: Verified osmith: Looks good to me, but someone else must approve laforge: Looks good to me, approved diff --git a/TODO-RELEASE b/TODO-RELEASE index 000f9f3..753e24a 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -10,4 +10,5 @@ libosmocore >1.8.0 uses new osmo_prim_operation_name() libosmo-netif > 1.3.0 uses osmo_stream_*_set_name() libosmo-sccp add API osmo_ss7_asp_get_name(), osmo_ss7_asp_get_proto() -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 +osmo_sccp_simple_client_on_ss7_id() behavior change: ASPs asp-clnt-* defined through VTY must explicitly configure "role" and "sctp-role" +libosmo-netif > 1.3.0 flag OSMO_STREAM_SCTP_MSG_FLAGS_NOTIFICATION set by osmo_stream_cli_recv() diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c index 22139b9..5befdee 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -1781,22 +1781,43 @@ /* netif code tells us we can read something from the socket */ static int xua_srv_conn_cb(struct osmo_stream_srv *conn) { - struct osmo_fd *ofd = osmo_stream_srv_get_ofd(conn); struct osmo_ss7_asp *asp = osmo_stream_srv_get_data(conn); struct msgb *msg = m3ua_msgb_alloc("xUA Server Rx"); - struct sctp_sndrcvinfo sinfo; unsigned int ppid; - int flags = 0; + int flags; int rc; if (!msg) return -ENOMEM; /* read xUA message from socket and process it */ - rc = sctp_recvmsg(ofd->fd, msgb_data(msg), msgb_tailroom(msg), - NULL, NULL, &sinfo, &flags); + rc = osmo_stream_srv_recv(conn, msg); + flags = msgb_sctp_msg_flags(msg); + LOGPASP(asp, DLSS7, LOGL_DEBUG, "%s(): sctp_recvmsg() returned %d (flags=0x%x)\n", __func__, rc, flags); + + if (flags & OSMO_STREAM_SCTP_MSG_FLAGS_NOTIFICATION) { + union sctp_notification *notif = (union sctp_notification *) msgb_data(msg); + log_sctp_notification(asp, "xUA CLNT", notif); + + switch (notif->sn_header.sn_type) { + case SCTP_ASSOC_CHANGE: + if (notif->sn_assoc_change.sac_state == SCTP_RESTART) + xua_asp_send_xlm_prim_simple(asp, OSMO_XLM_PRIM_M_SCTP_RESTART, + PRIM_OP_INDICATION); + default: + break; + } + + if (rc == 0) { + osmo_stream_srv_destroy(conn); + rc = -EBADF; + } else { + rc = 0; + } + goto out; + } if (rc < 0) { osmo_stream_srv_destroy(conn); rc = -EBADF; @@ -1805,38 +1826,10 @@ osmo_stream_srv_destroy(conn); rc = -EBADF; goto out; - } else { - msgb_put(msg, rc); } - if (flags & MSG_NOTIFICATION) { - union sctp_notification *notif = (union sctp_notification *) msgb_data(msg); - - log_sctp_notification(asp, "xUA SRV", notif); - - switch (notif->sn_header.sn_type) { - case SCTP_SHUTDOWN_EVENT: - osmo_stream_srv_destroy(conn); - rc = -EBADF; - break; - case SCTP_ASSOC_CHANGE: - if (notif->sn_assoc_change.sac_state == SCTP_RESTART) - xua_asp_send_xlm_prim_simple(asp, OSMO_XLM_PRIM_M_SCTP_RESTART, - PRIM_OP_INDICATION); - rc = 0; - break; - default: - rc = 0; - break; - } - goto out; - } - - ppid = ntohl(sinfo.sinfo_ppid); - msgb_sctp_ppid(msg) = ppid; - msgb_sctp_stream(msg) = sinfo.sinfo_stream; + ppid = msgb_sctp_ppid(msg); msg->dst = asp; - rate_ctr_inc2(asp->ctrg, SS7_ASP_CTR_PKT_RX_TOTAL); if (ppid == SUA_PPID && asp->cfg.proto == OSMO_SS7_ASP_PROT_SUA) @@ -1924,40 +1917,27 @@ static int xua_cli_read_cb(struct osmo_stream_cli *conn) { - struct osmo_fd *ofd = osmo_stream_cli_get_ofd(conn); struct osmo_ss7_asp *asp = osmo_stream_cli_get_data(conn); struct msgb *msg = m3ua_msgb_alloc("xUA Client Rx"); - struct sctp_sndrcvinfo sinfo; unsigned int ppid; - int flags = 0; + int flags; int rc; if (!msg) return -ENOMEM; /* read xUA message from socket and process it */ - rc = sctp_recvmsg(ofd->fd, msgb_data(msg), msgb_tailroom(msg), - NULL, NULL, &sinfo, &flags); + rc = osmo_stream_cli_recv(conn, msg); + flags = msgb_sctp_msg_flags(msg); + LOGPASP(asp, DLSS7, LOGL_DEBUG, "%s(): sctp_recvmsg() returned %d (flags=0x%x)\n", __func__, rc, flags); - if (rc < 0) { - xua_cli_close_and_reconnect(conn); - goto out; - } else if (rc == 0) { - xua_cli_close_and_reconnect(conn); - } else { - msgb_put(msg, rc); - } - if (flags & MSG_NOTIFICATION) { + if (flags & OSMO_STREAM_SCTP_MSG_FLAGS_NOTIFICATION) { union sctp_notification *notif = (union sctp_notification *) msgb_data(msg); - log_sctp_notification(asp, "xUA CLNT", notif); switch (notif->sn_header.sn_type) { - case SCTP_SHUTDOWN_EVENT: - xua_cli_close_and_reconnect(conn); - break; case SCTP_ASSOC_CHANGE: if (notif->sn_assoc_change.sac_state == SCTP_RESTART) xua_asp_send_xlm_prim_simple(asp, OSMO_XLM_PRIM_M_SCTP_RESTART, @@ -1965,18 +1945,22 @@ default: break; } + + if (rc == 0) + xua_cli_close_and_reconnect(conn); rc = 0; goto out; } - - if (rc == 0) + if (rc < 0) { + xua_cli_close_and_reconnect(conn); goto out; + } else if (rc == 0) { + xua_cli_close_and_reconnect(conn); + goto out; + } - ppid = ntohl(sinfo.sinfo_ppid); - msgb_sctp_ppid(msg) = ppid; - msgb_sctp_stream(msg) = sinfo.sinfo_stream; + ppid = msgb_sctp_ppid(msg); msg->dst = asp; - rate_ctr_inc2(asp->ctrg, SS7_ASP_CTR_PKT_RX_TOTAL); if (ppid == SUA_PPID && asp->cfg.proto == OSMO_SS7_ASP_PROT_SUA) -- To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/34089 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Change-Id: If3d78b636e8e224aa9c8597d0b242e29d3e3c84e Gerrit-Change-Number: 34089 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-MessageType: merged
1 0
0 0
[L] Change in libosmo-sccp[master]: asp: Allow setting IP address as SCTP primary upon conn establishment
by laforge 21 Aug '23

21 Aug '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/34111 ) Change subject: asp: Allow setting IP address as SCTP primary upon conn establishment ...................................................................... asp: Allow setting IP address as SCTP primary upon conn establishment This is an initial implementation to set the local SCTP Primary address as well as the peer's Primary Address (through SCTP ASCONF messages). The Primary address is only set upon conn establishment (after connect() for clients, or accept() for severs), which means no logic is introduced to make sure that primary address is kept during the entire operation of the SCTP association (for instance if the Primary address becomes unavailable and the stack changes the primary, and later on that address becomes available again, the primary addres won't be set back to the initially configured one). Related: OS#6076 Change-Id: I4a9fc1a4ad82ed20ece328bc53fca58299d744ca --- M TODO-RELEASE M include/osmocom/sigtran/osmo_ss7.h M src/osmo_ss7.c M src/osmo_ss7_vty.c M tests/vty/ss7_asp_test.vty 5 files changed, 318 insertions(+), 32 deletions(-) Approvals: Jenkins Builder: Verified osmith: Looks good to me, approved diff --git a/TODO-RELEASE b/TODO-RELEASE index 753e24a..306eed9 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -12,3 +12,4 @@ libosmo-sccp add API osmo_ss7_asp_get_name(), osmo_ss7_asp_get_proto() osmo_sccp_simple_client_on_ss7_id() behavior change: ASPs asp-clnt-* defined through VTY must explicitly configure "role" and "sctp-role" libosmo-netif > 1.3.0 flag OSMO_STREAM_SCTP_MSG_FLAGS_NOTIFICATION set by osmo_stream_cli_recv() +libosmo-sccp add API osmo_ss7_asp_peer_init(), osmo_ss7_asp_peer_set_hosts2(), osmo_ss7_asp_peer_add_host2() diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h index 1197ddf..ed3d409 100644 --- a/include/osmocom/sigtran/osmo_ss7.h +++ b/include/osmocom/sigtran/osmo_ss7.h @@ -366,6 +366,8 @@ char *host[OSMO_SOCK_MAX_ADDRS]; size_t host_cnt; uint16_t port; + /* index in "hosts" array marking the SCTP Primary Address, -1 if no explicit Primary Address set */ + int idx_primary; }; enum osmo_ss7_asp_admin_state { @@ -451,9 +453,13 @@ #define OSMO_SS7_ASP_QUIRK_SNM_INACTIVE 0x00000004 int osmo_ss7_asp_peer_snprintf(char* buf, size_t buf_len, struct osmo_ss7_asp_peer *peer); +void osmo_ss7_asp_peer_init(struct osmo_ss7_asp_peer *peer); int osmo_ss7_asp_peer_set_hosts(struct osmo_ss7_asp_peer *peer, void *talloc_ctx, const char *const*hosts, size_t host_cnt); +int osmo_ss7_asp_peer_set_hosts2(struct osmo_ss7_asp_peer *peer, void *talloc_ctx, + const char *const*hosts, size_t host_cnt, int idx_primary); int osmo_ss7_asp_peer_add_host(struct osmo_ss7_asp_peer *peer, void *talloc_ctx, const char *host); +int osmo_ss7_asp_peer_add_host2(struct osmo_ss7_asp_peer *peer, void *talloc_ctx, const char *host, bool is_primary_addr); struct osmo_ss7_asp * osmo_ss7_asp_find_by_name(struct osmo_ss7_instance *inst, const char *name); diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c index 5befdee..7882bc2 100644 --- a/src/osmo_ss7.c +++ b/src/osmo_ss7.c @@ -125,6 +125,59 @@ return -1; } +static int _setsockopt_peer_primary_addr(int fd, const struct osmo_sockaddr *saddr) +{ + int rc; + + struct sctp_setpeerprim so_sctp_setpeerprim = {0}; + + /* rfc6458 sec 8: "For the one-to-one style sockets and branched-off one-to-many + * style sockets (see Section 9.2), this association ID parameter is ignored" + */ + + /* NOTE: Requires setting: + * - sysctl net.sctp.addip_enable = 1, otherwise EPERM is returned + * - sysctl net.sctp.auth_enable = 1, RFC 5061 4.2.7 "An implementation supporting this + * extension MUST list the ASCONF,the ASCONF-ACK, and the AUTH chunks in + * its INIT and INIT-ACK parameters." + */ + + so_sctp_setpeerprim.sspp_addr = saddr->u.sas; + rc = setsockopt(fd, IPPROTO_SCTP, SCTP_SET_PEER_PRIMARY_ADDR, + &so_sctp_setpeerprim, sizeof(so_sctp_setpeerprim)); + if (rc < 0) { + char buf[128]; + int err = errno; + strerror_r(err, (char *)buf, sizeof(buf)); + LOGP(DLSS7, LOGL_ERROR, "setsockopt(SCTP_SET_PEER_PRIMARY_ADDR, %s) failed: %s%s\n", + osmo_sockaddr_to_str(saddr), buf, + err == EPERM ? " (EPERM: Make sure you have sysctl 'net.sctp.auth_enable' " + "and 'net.sctp.addip_enable' set to 1)" : ""); + } + return rc; +} + +static int _setsockopt_primary_addr(int fd, const struct osmo_sockaddr *saddr) +{ + int rc; + + struct sctp_prim so_sctp_prim = {0}; + + /* rfc6458 sec 8: "For the one-to-one style sockets and branched-off one-to-many + * style sockets (see Section 9.2), this association ID parameter is ignored" + */ + + so_sctp_prim.ssp_addr = saddr->u.sas; + rc = setsockopt(fd, IPPROTO_SCTP, SCTP_PRIMARY_ADDR, + &so_sctp_prim, sizeof(so_sctp_prim)); + if (rc < 0) { + char buf[128]; + strerror_r(errno, (char *)buf, sizeof(buf)); + LOGP(DLSS7, LOGL_ERROR, "setsockopt(SCTP_PRIMARY_ADDR, %s) failed: %s\n", + osmo_sockaddr_to_str(saddr), buf); + } + return rc; +} /*********************************************************************** * SS7 Point Code Parsing / Printing @@ -1179,11 +1232,18 @@ }; static unsigned int g_ss7_asp_rcg_idx; +void osmo_ss7_asp_peer_init(struct osmo_ss7_asp_peer *peer) +{ + memset(peer, 0, sizeof(*peer)); + peer->idx_primary = -1; +} + int osmo_ss7_asp_peer_snprintf(char* buf, size_t buf_len, struct osmo_ss7_asp_peer *peer) { int len = 0, offset = 0, rem = buf_len; int ret, i; char *after; + char *primary; if (buf_len < 3) return -EINVAL; @@ -1195,11 +1255,12 @@ OSMO_SNPRINTF_RET(ret, rem, offset, len); } for (i = 0; i < peer->host_cnt; i++) { + primary = (peer->idx_primary == i) ? "*" : ""; if (peer->host_cnt == 1) after = ""; else after = (i == (peer->host_cnt - 1)) ? ")" : "|"; - ret = snprintf(buf + offset, rem, "%s%s", peer->host[i] ? : "0.0.0.0", after); + ret = snprintf(buf + offset, rem, "%s%s%s", peer->host[i] ? : "0.0.0.0", primary, after); OSMO_SNPRINTF_RET(ret, rem, offset, len); } ret = snprintf(buf + offset, rem, ":%u", peer->port); @@ -1215,11 +1276,15 @@ * \param[in] talloc_ctx talloc context used to allocate new addresses. * \param[in] hosts Array of strings containing IP addresses. * \param[in] host_cnt Number of strings in hosts + * \param[in] idx_primary Index in "hosts" array marking the SCTP Primary Address, -1 if no explicit Primary Address set * \returns 0 on success; negative otherwise */ -int osmo_ss7_asp_peer_set_hosts(struct osmo_ss7_asp_peer *peer, void *talloc_ctx, const char *const*hosts, size_t host_cnt) +int osmo_ss7_asp_peer_set_hosts2(struct osmo_ss7_asp_peer *peer, void *talloc_ctx, const char *const*hosts, size_t host_cnt, int idx_primary) { int i = 0; + if (idx_primary >= (int)host_cnt || idx_primary < -1) + return -EINVAL; + if (host_cnt > ARRAY_SIZE(peer->host)) return -EINVAL; @@ -1231,9 +1296,21 @@ } peer->host_cnt = host_cnt; + peer->idx_primary = idx_primary; return 0; } +/*! \brief Set (copy) addresses for a given ASP peer. Previous addresses are freed. + * \param[in] peer Application Server Process peer whose addresses are to be set. + * \param[in] talloc_ctx talloc context used to allocate new addresses. + * \param[in] hosts Array of strings containing IP addresses. + * \param[in] host_cnt Number of strings in hosts + * \returns 0 on success; negative otherwise */ +int osmo_ss7_asp_peer_set_hosts(struct osmo_ss7_asp_peer *peer, void *talloc_ctx, const char *const*hosts, size_t host_cnt) +{ + return osmo_ss7_asp_peer_set_hosts2(peer, talloc_ctx, hosts, host_cnt, -1); +} + /* Is string formatted IPv4/v6 addr considered IN(6)ADDR_ANY? */ static inline bool host_is_ip_anyaddr(const char *host, bool is_v6) { @@ -1247,38 +1324,160 @@ /*! \brief Append (copy) address to a given ASP peer. Previous addresses are kept. * \param[in] peer Application Server Process peer the address is appended to. * \param[in] talloc_ctx talloc context used to allocate new address. - * \param[in] host string containing an IP addresses. + * \param[in] host string containing an IP address. + * \param[in] is_primary_addr whether this IP address is to be added as SCTP Primary Address * \returns 0 on success; negative otherwise */ -int osmo_ss7_asp_peer_add_host(struct osmo_ss7_asp_peer *peer, void *talloc_ctx, const char *host) +int osmo_ss7_asp_peer_add_host2(struct osmo_ss7_asp_peer *peer, void *talloc_ctx, + const char *host, bool is_primary_addr) { int i; bool new_is_v6 = osmo_ip_str_type(host) == AF_INET6; bool new_is_any = host_is_ip_anyaddr(host, new_is_v6); - bool iter_is_v6; + struct osmo_sockaddr_str addr_str; + + if (osmo_sockaddr_str_from_str(&addr_str, host, 0) < 0) + return -EINVAL; + + if (new_is_any) { + /* Makes no sense to have INET(6)_ANY many times, or INET(6)_ANY + * together with specific addresses, be it of same or different + * IP version: */ + if (peer->host_cnt != 0) + return -EINVAL; + + /* Makes no sense to have INET(6)_ANY as primary: */ + if (is_primary_addr) + return -EINVAL; + + if (peer->host_cnt >= ARRAY_SIZE(peer->host)) + return -EINVAL; + osmo_talloc_replace_string(talloc_ctx, &peer->host[peer->host_cnt], host); + peer->host_cnt++; + return 0; + } + + /* Makes no sense to add specific address to set if INET(6)_ANY + * is already set, be it from same or different IP version: */ + for (i = 0; i < peer->host_cnt; i++) { + bool iter_is_v6 = osmo_ip_str_type(peer->host[i]) == AF_INET6; + if (host_is_ip_anyaddr(peer->host[i], iter_is_v6)) + return -EINVAL; + } + /* Reached this point, no INET(6)_ANY address is set nor we are adding an INET(6)_ANY address. */ + + /* Check if address already exists, and then if primary flags need to be changed: */ + for (i = 0; i < peer->host_cnt; i++) { + struct osmo_sockaddr_str it_addr_str; + bool it_is_primary; + osmo_sockaddr_str_from_str(&it_addr_str, peer->host[i], 0); + + if (osmo_sockaddr_str_cmp(&addr_str, &it_addr_str) != 0) + continue; + it_is_primary = (peer->idx_primary == i); + if (is_primary_addr == it_is_primary) { + /* Nothing to do, return below */ + } else if (is_primary_addr && !it_is_primary) { + /* Mark it as primary: */ + peer->idx_primary = i; + } else { /* if (!is_primary_addr && it_is_primary) { */ + /* mark it as non-primary: */ + peer->idx_primary = -1; + } + return 0; + } if (peer->host_cnt >= ARRAY_SIZE(peer->host)) return -EINVAL; - /* Makes no sense to have INET(6)_ANY many times, or INET(6)_ANY - together with specific addresses, be it of same or different - IP version:*/ - if (new_is_any && peer->host_cnt != 0) - return -EINVAL; - - if (!new_is_any) { - /* Makes no sense to add specific address to set if INET(6)_ANY - is already set, be it from same or different IP version: */ - for (i = 0; i < peer->host_cnt; i++) { - iter_is_v6 = osmo_ip_str_type(peer->host[i]) == AF_INET6; - if (host_is_ip_anyaddr(peer->host[i], iter_is_v6)) - return -EINVAL; - } - } osmo_talloc_replace_string(talloc_ctx, &peer->host[peer->host_cnt], host); + if (is_primary_addr) + peer->idx_primary = peer->host_cnt; peer->host_cnt++; return 0; } +/*! \brief Append (copy) address to a given ASP peer. Previous addresses are kept. + * \param[in] peer Application Server Process peer the address is appended to. + * \param[in] talloc_ctx talloc context used to allocate new address. + * \param[in] host string containing an IP address. + * \returns 0 on success; negative otherwise */ +int osmo_ss7_asp_peer_add_host(struct osmo_ss7_asp_peer *peer, void *talloc_ctx, + const char *host) +{ + return osmo_ss7_asp_peer_add_host2(peer, talloc_ctx, host, false); +} + +static int asp_apply_peer_primary_address(const struct osmo_ss7_asp *asp) +{ + struct osmo_fd *ofd; + struct osmo_sockaddr_str addr_str; + struct osmo_sockaddr addr; + uint16_t local_port; + int rc; + + /* No SCTP Peer Primary Address explicitly configured, do nothing. */ + if (asp->cfg.local.idx_primary == -1) + return 0; + OSMO_ASSERT(asp->cfg.local.idx_primary < asp->cfg.local.host_cnt); + + if (asp->cfg.is_server) + ofd = osmo_stream_srv_get_ofd(asp->server); + else + ofd = osmo_stream_cli_get_ofd(asp->client); + + if (asp->cfg.local.port == 0) { + char port_buf[16]; + osmo_sock_get_local_ip_port(ofd->fd, port_buf, sizeof(port_buf)); + local_port = atoi(port_buf); + } else { + local_port = asp->cfg.local.port; + } + rc = osmo_sockaddr_str_from_str(&addr_str, + asp->cfg.local.host[asp->cfg.local.idx_primary], + local_port); + if (rc < 0) + return rc; + rc = osmo_sockaddr_str_to_sockaddr(&addr_str, &addr.u.sas); + if (rc < 0) + return rc; + LOGPASP(asp, DLSS7, LOGL_INFO, "Set Peer's Primary Address %s\n", + osmo_sockaddr_to_str(&addr)); + rc = _setsockopt_peer_primary_addr(ofd->fd, &addr); + + return rc; +} + +static int asp_apply_primary_address(const struct osmo_ss7_asp *asp) +{ + struct osmo_fd *ofd; + struct osmo_sockaddr_str addr_str; + struct osmo_sockaddr addr; + int rc; + + /* No SCTP Primary Address explicitly configured, do nothing. */ + if (asp->cfg.remote.idx_primary == -1) + return 0; + OSMO_ASSERT(asp->cfg.remote.idx_primary < asp->cfg.remote.host_cnt); + + if (asp->cfg.is_server) + ofd = osmo_stream_srv_get_ofd(asp->server); + else + ofd = osmo_stream_cli_get_ofd(asp->client); + + rc = osmo_sockaddr_str_from_str(&addr_str, + asp->cfg.remote.host[asp->cfg.remote.idx_primary], + asp->cfg.remote.port); + if (rc < 0) + return rc; + rc = osmo_sockaddr_str_to_sockaddr(&addr_str, &addr.u.sas); + if (rc < 0) + return rc; + LOGPASP(asp, DLSS7, LOGL_INFO, "Set Primary Address %s\n", + osmo_sockaddr_to_str(&addr)); + rc = _setsockopt_primary_addr(ofd->fd, &addr); + return rc; +} + static bool ipv6_sctp_supported(const char *host, bool bind) { int rc; @@ -1534,7 +1733,9 @@ } rate_ctr_group_set_name(asp->ctrg, name); asp->inst = inst; + osmo_ss7_asp_peer_init(&asp->cfg.remote); asp->cfg.remote.port = remote_port; + osmo_ss7_asp_peer_init(&asp->cfg.local); asp->cfg.local.port = local_port; asp->cfg.proto = proto; asp->cfg.name = talloc_strdup(asp, name); @@ -1849,6 +2050,7 @@ { struct osmo_fd *ofd = osmo_stream_cli_get_ofd(cli); struct osmo_ss7_asp *asp = osmo_stream_cli_get_data(cli); + int rc = 0; /* update the socket name */ talloc_free(asp->sock_name); @@ -1856,6 +2058,15 @@ LOGPASP(asp, DLSS7, LOGL_INFO, "Client connected %s\n", asp->sock_name); + /* Now that we have the conn in place, the local/remote addresses are + * fed and the local port is known for sure. Apply SCTP Primary addresses + * if needed: + */ + if (asp->cfg.proto != OSMO_SS7_ASP_PROT_IPA) { + rc = asp_apply_peer_primary_address(asp); + rc = asp_apply_primary_address(asp); + } + if (asp->lm && asp->lm->prim_cb) { /* Notify layer manager that a connection has been * established */ @@ -1865,7 +2076,7 @@ osmo_fsm_inst_dispatch(asp->fi, XUA_ASP_E_M_ASP_UP_REQ, NULL); } - return 0; + return rc; } static void xua_cli_close(struct osmo_stream_cli *cli) @@ -2016,6 +2227,7 @@ struct osmo_ss7_asp *asp; char *sock_name = osmo_sock_get_name(link, fd); const char *proto_name = get_value_string(osmo_ss7_asp_protocol_vals, oxs->cfg.proto); + int rc = 0; LOGP(DLSS7, LOGL_INFO, "%s: New %s connection accepted\n", sock_name, proto_name); @@ -2105,11 +2317,16 @@ * data */ osmo_stream_srv_set_data(srv, asp); + if (oxs->cfg.proto != OSMO_SS7_ASP_PROT_IPA) { + rc = asp_apply_peer_primary_address(asp); + rc = asp_apply_primary_address(asp); + } + /* send M-SCTP_ESTABLISH.ind to Layer Manager */ osmo_fsm_inst_dispatch(asp->fi, XUA_ASP_E_SCTP_EST_IND, 0); xua_asp_send_xlm_prim_simple(asp, OSMO_XLM_PRIM_M_SCTP_ESTABLISH, PRIM_OP_INDICATION); - return 0; + return rc; } /*! \brief send a fully encoded msgb via a given ASP diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 61f14cd..44ba780 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -656,14 +656,17 @@ } DEFUN_ATTR(asp_local_ip, asp_local_ip_cmd, - "local-ip " VTY_IPV46_CMD, + "local-ip " VTY_IPV46_CMD " [primary]", "Specify Local IP Address from which to contact ASP\n" "Local IPv4 Address from which to contact of ASP\n" - "Local IPv6 Address from which to contact of ASP\n", + "Local IPv6 Address from which to contact of ASP\n" + "Signal the SCTP peer to use this address as Primary Address\n", CMD_ATTR_NODE_EXIT) { struct osmo_ss7_asp *asp = vty->index; - if (osmo_ss7_asp_peer_add_host(&asp->cfg.local, asp, argv[0]) != 0) { + bool is_primary = argc > 1; + + if (osmo_ss7_asp_peer_add_host2(&asp->cfg.local, asp, argv[0], is_primary) != 0) { vty_out(vty, "%% Failed adding host '%s' to set%s", argv[0], VTY_NEWLINE); return CMD_WARNING; } @@ -671,14 +674,17 @@ } DEFUN_ATTR(asp_remote_ip, asp_remote_ip_cmd, - "remote-ip " VTY_IPV46_CMD, + "remote-ip " VTY_IPV46_CMD " [primary]", "Specify Remote IP Address of ASP\n" "Remote IPv4 Address of ASP\n" - "Remote IPv6 Address of ASP\n", + "Remote IPv6 Address of ASP\n" + "Set remote address as SCTP Primary Address\n", CMD_ATTR_NODE_EXIT) { struct osmo_ss7_asp *asp = vty->index; - if (osmo_ss7_asp_peer_add_host(&asp->cfg.remote, asp, argv[0]) != 0) { + bool is_primary = argc > 1; + + if (osmo_ss7_asp_peer_add_host2(&asp->cfg.remote, asp, argv[0], is_primary) != 0) { vty_out(vty, "%% Failed adding host '%s' to set%s", argv[0], VTY_NEWLINE); return CMD_WARNING; } @@ -937,11 +943,13 @@ vty_out(vty, " description %s%s", asp->cfg.description, VTY_NEWLINE); for (i = 0; i < asp->cfg.local.host_cnt; i++) { if (asp->cfg.local.host[i]) - vty_out(vty, " local-ip %s%s", asp->cfg.local.host[i], VTY_NEWLINE); + vty_out(vty, " local-ip %s%s%s", asp->cfg.local.host[i], + asp->cfg.local.idx_primary == i ? " primary" : "", VTY_NEWLINE); } for (i = 0; i < asp->cfg.remote.host_cnt; i++) { if (asp->cfg.remote.host[i]) - vty_out(vty, " remote-ip %s%s", asp->cfg.remote.host[i], VTY_NEWLINE); + vty_out(vty, " remote-ip %s%s%s", asp->cfg.remote.host[i], + asp->cfg.remote.idx_primary == i ? " primary" : "", VTY_NEWLINE); } if (asp->cfg.qos_class) vty_out(vty, " qos-class %u%s", asp->cfg.qos_class, VTY_NEWLINE); diff --git a/tests/vty/ss7_asp_test.vty b/tests/vty/ss7_asp_test.vty index 3296c65..d23f9c0 100644 --- a/tests/vty/ss7_asp_test.vty +++ b/tests/vty/ss7_asp_test.vty @@ -220,8 +220,8 @@ ss7_asp_vty_test(config-cs7-asp)# list ... description .TEXT - remote-ip (A.B.C.D|X:X::X:X) - local-ip (A.B.C.D|X:X::X:X) + remote-ip (A.B.C.D|X:X::X:X) [primary] + local-ip (A.B.C.D|X:X::X:X) [primary] qos-class <0-255> role (sg|asp|ipsp) sctp-role (client|server) @@ -255,6 +255,40 @@ ASP Name AS Name State Type Role Remote IPaddr & Port SCTP Role ------------ ------------ ------------- ---- ---- ----------------------- --------- my-asp ? uninitialized m3ua sg (127.0.0.200|127.0.0.201):12345 server +ss7_asp_vty_test(config-cs7-asp)# ! Mark as primary: +ss7_asp_vty_test(config-cs7-asp)# remote-ip 127.0.0.201 primary +ss7_asp_vty_test(config-cs7-asp)# ! 'local-ip 127.0.0.101 primary' cannot be tested here since output may be different based on sysctl available +ss7_asp_vty_test(config-cs7-asp)# local-ip 127.0.0.101 +... +ss7_asp_vty_test(config-cs7-asp)# do show cs7 instance 0 asp + Current Primary Link +ASP Name AS Name State Type Role Remote IPaddr & Port SCTP Role +------------ ------------ ------------- ---- ---- ----------------------- --------- +my-asp ? uninitialized m3ua sg (127.0.0.200|127.0.0.201*):12345 server +ss7_asp_vty_test(config-cs7-asp)# show running-config +... + local-ip 127.0.0.100 + local-ip 127.0.0.101 + remote-ip 127.0.0.200 + remote-ip 127.0.0.201 primary +... +end +ss7_asp_vty_test(config-cs7-asp)# ! Mark as non-primary: +ss7_asp_vty_test(config-cs7-asp)# remote-ip 127.0.0.201 +ss7_asp_vty_test(config-cs7-asp)# local-ip 127.0.0.101 +ss7_asp_vty_test(config-cs7-asp)# do show cs7 instance 0 asp + Current Primary Link +ASP Name AS Name State Type Role Remote IPaddr & Port SCTP Role +------------ ------------ ------------- ---- ---- ----------------------- --------- +my-asp ? uninitialized m3ua sg (127.0.0.200|127.0.0.201):12345 server +ss7_asp_vty_test(config-cs7-asp)# show running-config +... + local-ip 127.0.0.100 + local-ip 127.0.0.101 + remote-ip 127.0.0.200 + remote-ip 127.0.0.201 +... +end ss7_asp_vty_test(config-cs7-asp)# exit ss7_asp_vty_test(config-cs7)# as my-ass m3ua -- To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/34111 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Change-Id: I4a9fc1a4ad82ed20ece328bc53fca58299d744ca Gerrit-Change-Number: 34111 Gerrit-PatchSet: 4 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[M] Change in libosmo-sccp[master]: ss7: Use libosmo-netif's osmo_stream_{cli,srv}_recv() APIs
by laforge 21 Aug '23

21 Aug '23
Attention is currently required from: pespin, fixeria. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/34089 ) Change subject: ss7: Use libosmo-netif's osmo_stream_{cli,srv}_recv() APIs ...................................................................... Patch Set 1: Code-Review+2 (1 comment) Patchset: PS1: > > the patch you're referring-to has not yet been merged […] Done -- To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/34089 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmo-sccp Gerrit-Branch: master Gerrit-Change-Id: If3d78b636e8e224aa9c8597d0b242e29d3e3c84e Gerrit-Change-Number: 34089 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-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Comment-Date: Mon, 21 Aug 2023 18:44:24 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: Yes Comment-In-Reply-To: laforge <laforge(a)osmocom.org> Comment-In-Reply-To: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmo-sgsn[master]: sgsn_rim: forward message based on RIM ROUTING ADDRESS
by laforge 21 Aug '23

21 Aug '23
Attention is currently required from: pespin, dexter. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/34122 ) Change subject: sgsn_rim: forward message based on RIM ROUTING ADDRESS ...................................................................... Patch Set 3: (2 comments) Commit Message: https://gerrit.osmocom.org/c/osmo-sgsn/+/34122/comment/85999748_3c81504b PS3, Line 10: corredt correct File src/sgsn/sgsn_libgtp.c: https://gerrit.osmocom.org/c/osmo-sgsn/+/34122/comment/0a31d719_5835bc51 PS3, Line 721: rim_ra_discr = rim_ra_discr_encoded[0]; > I really see no point in having these 2 vars here. […] unless we're missing something, I'm agreeing with pespin here. -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/34122 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: Ifd2b915ed2f05130cff8ee77714b82005c17de3d Gerrit-Change-Number: 34122 Gerrit-PatchSet: 3 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: pespin <pespin(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Mon, 21 Aug 2023 18:43:29 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: pespin <pespin(a)sysmocom.de> Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: MME_Tests: add testcase TC_s1ap_reset
by laforge 21 Aug '23

21 Aug '23
Attention is currently required from: dexter. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34156 ) Change subject: MME_Tests: add testcase TC_s1ap_reset ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34156 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: I23f4d5f2c39790b6cb0dacaec1e31912177af3ec Gerrit-Change-Number: 34156 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Mon, 21 Aug 2023 18:42:18 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmo-pcu[master]: pcuif_proto: get rid of _DT, _dt (Direct TLLI)
by laforge 21 Aug '23

21 Aug '23
Attention is currently required from: osmith, dexter. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-pcu/+/34134 ) Change subject: pcuif_proto: get rid of _DT, _dt (Direct TLLI) ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-pcu/+/34134 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-pcu Gerrit-Branch: master Gerrit-Change-Id: If641b507dcb6b176109c99dce7cff2a7561364b0 Gerrit-Change-Number: 34134 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Attention: dexter <pmaier(a)sysmocom.de> Gerrit-Comment-Date: Mon, 21 Aug 2023 18:42:01 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmo-e1d[master]: octoi: Add force-send-all-ts mode
by laforge 21 Aug '23

21 Aug '23
laforge has submitted this change. ( https://gerrit.osmocom.org/c/osmo-e1d/+/34149 ) Change subject: octoi: Add force-send-all-ts mode ...................................................................... octoi: Add force-send-all-ts mode This new mode (can be enabled per account) will force the E1OIP protocol to always send all timeslots, i.e. not do any of the suppression of timeslots that do not exhibit any change to the previous E1 frame. Change-Id: I6d17d3829b2c1c62e701a1d8c021d93d93593613 --- M include/osmocom/octoi/octoi.h M src/octoi/e1oip.c M src/octoi/e1oip.h M src/octoi/octoi_clnt_fsm.c M src/octoi/octoi_clnt_vty.c M src/octoi/octoi_srv_fsm.c M src/octoi/octoi_srv_vty.c M src/octoi/octoi_vty.h 8 files changed, 59 insertions(+), 10 deletions(-) Approvals: Jenkins Builder: Verified osmith: Looks good to me, but someone else must approve laforge: Looks good to me, approved diff --git a/include/osmocom/octoi/octoi.h b/include/osmocom/octoi/octoi.h index fddee41..645af3f 100644 --- a/include/osmocom/octoi/octoi.h +++ b/include/osmocom/octoi/octoi.h @@ -22,6 +22,7 @@ char *user_id; /* user ID (IMSI) */ enum octoi_account_mode mode; uint8_t batching_factor; /* E1 frames per UDP packet (Tx) */ + bool force_send_all_ts; /* force transmission of all timeslots */ uint32_t prefill_frame_count; /* FIFO prefill/preseed count (Rx) */ union { struct { diff --git a/src/octoi/e1oip.c b/src/octoi/e1oip.c index c4bf054..85dd165 100644 --- a/src/octoi/e1oip.c +++ b/src/octoi/e1oip.c @@ -119,12 +119,16 @@ } iline_stat_set(iline, LINE_STAT_E1oIP_E1O_FIFO, frame_fifo_frames(&iline->e1o.fifo)); - /* then compute the ts_mask */ - for (i = 0, ref_frame = iline->e1o.last_frame; i < n_frames; i++, ref_frame = buf[i-1]) { - /* FIXME: what to do about TS0? */ - for (unsigned int j = 1; j < BYTES_PER_FRAME; j++) { - if (buf[i][j] != ref_frame[j]) - ts_mask |= (1U << j); + if (iline->cfg.force_send_all_ts) { + ts_mask = 0xfffffffe; + } else { + /* then compute the ts_mask */ + for (i = 0, ref_frame = iline->e1o.last_frame; i < n_frames; i++, ref_frame = buf[i-1]) { + /* FIXME: what to do about TS0? */ + for (unsigned int j = 1; j < BYTES_PER_FRAME; j++) { + if (buf[i][j] != ref_frame[j]) + ts_mask |= (1U << j); + } } } eith->ts_mask = htonl(ts_mask); @@ -314,10 +318,11 @@ } void e1oip_line_configure(struct e1oip_line *iline, uint8_t batching_factor, - uint32_t prefill_frame_count) + uint32_t prefill_frame_count, bool force_send_all_ts) { iline->cfg.batching_factor = batching_factor; iline->cfg.prefill_frame_count = prefill_frame_count; + iline->cfg.force_send_all_ts = force_send_all_ts; } void e1oip_line_reset(struct e1oip_line *iline) diff --git a/src/octoi/e1oip.h b/src/octoi/e1oip.h index ccdebd5..9357d48 100644 --- a/src/octoi/e1oip.h +++ b/src/octoi/e1oip.h @@ -53,6 +53,7 @@ struct { uint8_t batching_factor; uint32_t prefill_frame_count; + bool force_send_all_ts; } cfg; /* E1 originated side (E1->IP) */ @@ -84,7 +85,7 @@ void e1oip_line_set_name(struct e1oip_line *line, const char *name); void e1oip_line_reset(struct e1oip_line *iline); void e1oip_line_configure(struct e1oip_line *iline, uint8_t batching_factor, - uint32_t prefill_frame_count); + uint32_t prefill_frame_count, bool force_send_all_ts); void e1oip_line_destroy(struct e1oip_line *iline); int e1oip_rcvmsg_tdm_data(struct e1oip_line *iline, struct msgb *msg); diff --git a/src/octoi/octoi_clnt_fsm.c b/src/octoi/octoi_clnt_fsm.c index 2ec5c8c..2bfc8f9 100644 --- a/src/octoi/octoi_clnt_fsm.c +++ b/src/octoi/octoi_clnt_fsm.c @@ -123,7 +123,7 @@ struct clnt_state *st = fi->priv; e1oip_line_configure(st->peer->iline, st->acc->batching_factor, - st->acc->prefill_frame_count); + st->acc->prefill_frame_count, st->acc->force_send_all_ts); /* reset RIFO/FIFO etc. */ e1oip_line_reset(st->peer->iline); iline_ctr_add(st->peer->iline, LINE_CTR_E1oIP_CONNECT_ACCEPT, 1); diff --git a/src/octoi/octoi_clnt_vty.c b/src/octoi/octoi_clnt_vty.c index c7c2482..54ed60f 100644 --- a/src/octoi/octoi_clnt_vty.c +++ b/src/octoi/octoi_clnt_vty.c @@ -280,6 +280,8 @@ install_element(OCTOI_CLNT_ACCOUNT_NODE, &cfg_account_ice1_line_cmd); install_element(OCTOI_CLNT_ACCOUNT_NODE, &cfg_account_mode_cmd); install_element(OCTOI_CLNT_ACCOUNT_NODE, &cfg_account_batching_factor_cmd); + install_element(OCTOI_CLNT_ACCOUNT_NODE, &cfg_account_force_all_ts_cmd); + install_element(OCTOI_CLNT_ACCOUNT_NODE, &cfg_account_no_force_all_ts_cmd); install_element(OCTOI_CLNT_ACCOUNT_NODE, &cfg_account_prefill_frame_count_cmd); #ifdef HAVE_DAHDI_TRUNKDEV install_element(OCTOI_CLNT_ACCOUNT_NODE, &cfg_account_trunkdev_name_cmd); diff --git a/src/octoi/octoi_srv_fsm.c b/src/octoi/octoi_srv_fsm.c index ed9e8f9..b6914b7 100644 --- a/src/octoi/octoi_srv_fsm.c +++ b/src/octoi/octoi_srv_fsm.c @@ -176,7 +176,7 @@ struct srv_state *st = fi->priv; e1oip_line_configure(st->peer->iline, st->acc->batching_factor, - st->acc->prefill_frame_count); + st->acc->prefill_frame_count, st->acc->force_send_all_ts); /* reset RIFO/FIFO etc. */ e1oip_line_reset(st->peer->iline); iline_ctr_add(st->peer->iline, LINE_CTR_E1oIP_CONNECT_ACCEPT, 1); diff --git a/src/octoi/octoi_srv_vty.c b/src/octoi/octoi_srv_vty.c index 67c4eb6..4fc4e47 100644 --- a/src/octoi/octoi_srv_vty.c +++ b/src/octoi/octoi_srv_vty.c @@ -391,6 +391,26 @@ return CMD_SUCCESS; } +gDEFUN(cfg_account_force_all_ts, cfg_account_force_all_ts_cmd, + "force-all-ts", + "Force transmission of all TS all the time\n") +{ + struct octoi_account *acc = vty->index; + + acc->force_send_all_ts = true; + return CMD_SUCCESS; +} + +gDEFUN(cfg_account_no_force_all_ts, cfg_account_no_force_all_ts_cmd, + "no force-all-ts", + NO_STR "Don't force transmission of all TS all the time\n") +{ + struct octoi_account *acc = vty->index; + + acc->force_send_all_ts = false; + return CMD_SUCCESS; +} + gDEFUN(cfg_account_prefill_frame_count, cfg_account_prefill_frame_count_cmd, "prefill-frame-count <0-8000>", "Number of E1 frames to pre-fill/pre-seed in Rx RIFO\n" @@ -455,6 +475,8 @@ VTY_NEWLINE); if (acc->batching_factor != DEFAULT_BATCHING_FACTOR) vty_out(vty, " batching-factor %u%s", acc->batching_factor, VTY_NEWLINE); + if (acc->force_send_all_ts) + vty_out(vty, " force-all-ts%s", VTY_NEWLINE); if (acc->prefill_frame_count != DEFAULT_PREFILL_FRAME_COUNT) vty_out(vty, " prefill-frame-count %u%s", acc->prefill_frame_count, VTY_NEWLINE); @@ -538,6 +560,8 @@ install_element(OCTOI_ACCOUNT_NODE, &cfg_account_ice1_line_cmd); install_element(OCTOI_ACCOUNT_NODE, &cfg_account_redir_cmd); install_element(OCTOI_ACCOUNT_NODE, &cfg_account_batching_factor_cmd); + install_element(OCTOI_ACCOUNT_NODE, &cfg_account_force_all_ts_cmd); + install_element(OCTOI_ACCOUNT_NODE, &cfg_account_no_force_all_ts_cmd); install_element(OCTOI_ACCOUNT_NODE, &cfg_account_prefill_frame_count_cmd); #ifdef HAVE_DAHDI_TRUNKDEV install_element(OCTOI_ACCOUNT_NODE, &cfg_account_trunkdev_name_cmd); diff --git a/src/octoi/octoi_vty.h b/src/octoi/octoi_vty.h index 33188e4..55fa7fe 100644 --- a/src/octoi/octoi_vty.h +++ b/src/octoi/octoi_vty.h @@ -8,6 +8,8 @@ extern struct cmd_element cfg_account_ice1_serno_cmd; extern struct cmd_element cfg_account_ice1_line_cmd; extern struct cmd_element cfg_account_batching_factor_cmd; +extern struct cmd_element cfg_account_force_all_ts_cmd; +extern struct cmd_element cfg_account_no_force_all_ts_cmd; extern struct cmd_element cfg_account_prefill_frame_count_cmd; extern struct cmd_element cfg_account_trunkdev_name_cmd; extern struct cmd_element cfg_account_trunkdev_line_cmd; -- To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/34149 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1d Gerrit-Branch: master Gerrit-Change-Id: I6d17d3829b2c1c62e701a1d8c021d93d93593613 Gerrit-Change-Number: 34149 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-MessageType: merged
1 0
0 0
[M] Change in osmo-e1d[master]: octoi: Add force-send-all-ts mode
by laforge 21 Aug '23

21 Aug '23
laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-e1d/+/34149 ) Change subject: octoi: Add force-send-all-ts mode ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-e1d/+/34149 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-e1d Gerrit-Branch: master Gerrit-Change-Id: I6d17d3829b2c1c62e701a1d8c021d93d93593613 Gerrit-Change-Number: 34149 Gerrit-PatchSet: 1 Gerrit-Owner: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Mon, 21 Aug 2023 18:40:37 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[M] Change in osmo-gsm-manuals[master]: build: replace inkscape with rsvg-convert
by laforge 21 Aug '23

21 Aug '23
Attention is currently required from: osmith. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-gsm-manuals/+/34158 ) Change subject: build: replace inkscape with rsvg-convert ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-gsm-manuals/+/34158 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Change-Id: I0d132f8f6fd73fbe14b5bfa10a8659acaddf38f7 Gerrit-Change-Number: 34158 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Mon, 21 Aug 2023 18:39:36 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
[S] Change in osmo-gsm-manuals[master]: build/Makefile.asciidoc: print less clutter
by laforge 21 Aug '23

21 Aug '23
Attention is currently required from: osmith. laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-gsm-manuals/+/34157 ) Change subject: build/Makefile.asciidoc: print less clutter ...................................................................... Patch Set 1: Code-Review+2 -- To view, visit https://gerrit.osmocom.org/c/osmo-gsm-manuals/+/34157 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-gsm-manuals Gerrit-Branch: master Gerrit-Change-Id: I23d11bab274793eb8bcedc3fd9290901823e32d2 Gerrit-Change-Number: 34157 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Mon, 21 Aug 2023 18:38:59 +0000 Gerrit-HasComments: No Gerrit-Has-Labels: Yes Gerrit-MessageType: comment
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 73
  • 74
  • 75
  • 76
  • 77
  • 78
  • 79
  • ...
  • 152
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.