pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/33237 )
Change subject: osmo_sccp_simple_client_on_ss7_id(): Always follow VTY config of ASP if it was explicitly defined in VTY
......................................................................
osmo_sccp_simple_client_on_ss7_id(): Always follow VTY config of ASP if it was explicitly defined in VTY
The VTY config defaults are "role sg" and "sctp-role server".
However, if not set explicitly in VTY,
osmo_sccp_simple_client_on_ss7_id() was replacing them to "role asp" and
"sctp-role client".
This is fine if the ASP is not defined/created at the VTY (aka
dynamically created with no config), but if the ASP is defined in the
VTY it becomes really confusing, since it's picking different defaults
than the usual ones.
Hence, follow always the same VTY defaults in
osmo_sccp_simple_client_on_ss7_id().
As a result of this change:
- Programs not defining the ASP over VTY keep the same behavior (ASP is
created with role=asp and sctp-role=client)
- Programs defining ASP over VTY (eg. "asp asp-clnt-msc-0 5000 0 m3ua")
explicitly setting "role" and "sctp-role": keep the same behavior
- Programs defining ASP over VTY but not explicitly setting "role" or
"sctp-role", will get now the usual defaults instead.
So in summary, strange cases where osmo_sccp_simple_client_on_ss7_id()
is used (osmo-bsc, osmo-hnbgw, osmo-msc) and the dynamically created
ASP is created through VTY, then the config file must also explicitly
define the following lines:
role asp
sctp-role client
This patch also changes the "show running-config" VTY cmd to also always
show the configured role and sctp-role values, which are of vital
importance to understand a given setup.
Change-Id: Ie81987265118e48173211f88b27a006115dc62d4
---
M include/osmocom/sigtran/osmo_ss7.h
M src/osmo_ss7_vty.c
M src/sccp_user.c
M tests/vty/ss7_asp_test.vty
4 files changed, 49 insertions(+), 22 deletions(-)
Approvals:
Jenkins Builder: Verified
laforge: Looks good to me, but someone else must approve
osmith: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h
index f413983..eff16b9 100644
--- a/include/osmocom/sigtran/osmo_ss7.h
+++ b/include/osmocom/sigtran/osmo_ss7.h
@@ -430,8 +430,6 @@
enum osmo_ss7_asp_admin_state adm_state;
bool is_server;
enum osmo_ss7_asp_role role;
- bool role_set_by_vty;
- bool sctp_role_set_by_vty;
struct osmo_ss7_asp_peer local;
struct osmo_ss7_asp_peer remote;
diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c
index 2418428..09e5f0a 100644
--- a/src/osmo_ss7_vty.c
+++ b/src/osmo_ss7_vty.c
@@ -715,8 +715,6 @@
return CMD_WARNING;
} else
OSMO_ASSERT(0);
-
- asp->cfg.role_set_by_vty = true;
return CMD_SUCCESS;
}
@@ -735,8 +733,6 @@
asp->cfg.is_server = true;
else
OSMO_ASSERT(0);
-
- asp->cfg.sctp_role_set_by_vty = true;
return CMD_SUCCESS;
}
@@ -851,12 +847,9 @@
}
if (asp->cfg.qos_class)
vty_out(vty, " qos-class %u%s", asp->cfg.qos_class, VTY_NEWLINE);
- if (asp->cfg.role_set_by_vty) {
- vty_out(vty, " role %s%s", osmo_str_tolower(get_value_string(osmo_ss7_asp_role_names, asp->cfg.role)),
- VTY_NEWLINE);
- }
- if (asp->cfg.sctp_role_set_by_vty || !asp->cfg.is_server)
- vty_out(vty, " sctp-role %s%s", asp->cfg.is_server ? "server" : "client", VTY_NEWLINE);
+ vty_out(vty, " role %s%s", osmo_str_tolower(get_value_string(osmo_ss7_asp_role_names, asp->cfg.role)),
+ VTY_NEWLINE);
+ vty_out(vty, " sctp-role %s%s", asp->cfg.is_server ? "server" : "client", VTY_NEWLINE);
for (i = 0; i < sizeof(uint32_t) * 8; i++) {
if (!(asp->cfg.quirks & ((uint32_t) 1 << i)))
continue;
diff --git a/src/sccp_user.c b/src/sccp_user.c
index f1a4203..aac6ee0 100644
--- a/src/sccp_user.c
+++ b/src/sccp_user.c
@@ -630,6 +630,10 @@
if (!asp)
goto out_rt;
asp_created = true;
+ /* Ensure that the ASP we use is set to sctp-role client. */
+ asp->cfg.is_server = false;
+ /* Ensure that the ASP we use is set to role ASP. */
+ asp->cfg.role = OSMO_SS7_ASP_ROLE_ASP;
if (default_local_ip)
osmo_ss7_asp_peer_set_hosts(&asp->cfg.local, asp, &default_local_ip, 1);
if (default_remote_ip)
@@ -642,11 +646,6 @@
osmo_ss7_as_add_asp(as, asp->cfg.name);
}
- /* Make sure that the sctp-role of this ASP is set to "client" unless the user
- * made a conscious decision about the role via the VTY */
- if (!asp->cfg.sctp_role_set_by_vty)
- asp->cfg.is_server = false;
-
/* If ASP was configured through VTY it may be explicitly configured as
* SCTP server. It may be a bit confusing since this function is to create
* a "SCCP simple client", but this allows users of this API such as
@@ -667,11 +666,6 @@
}
}
- /* Make sure that the role of this ASP is set to ASP unless the user
- * made a conscious decision about the role via the VTY */
- if (!asp->cfg.role_set_by_vty)
- asp->cfg.role = OSMO_SS7_ASP_ROLE_ASP;
-
/* Restart ASP */
if (prot != OSMO_SS7_ASP_PROT_IPA)
osmo_ss7_asp_use_default_lm(asp, LOGL_DEBUG);
diff --git a/tests/vty/ss7_asp_test.vty b/tests/vty/ss7_asp_test.vty
index 5faabd9..ffa263f 100644
--- a/tests/vty/ss7_asp_test.vty
+++ b/tests/vty/ss7_asp_test.vty
@@ -343,6 +343,8 @@
asp my-asp 12345 54321 m3ua
local-ip 127.0.0.100
remote-ip 127.0.0.200
+ role sg
+ sctp-role server
as my-ass m3ua
asp my-asp
routing-key 0 3.2.1
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/33237
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: Ie81987265118e48173211f88b27a006115dc62d4
Gerrit-Change-Number: 33237
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
Attention is currently required from: osmith, neels.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/33237 )
Change subject: osmo_sccp_simple_client_on_ss7_id(): Always follow VTY config of ASP if it was explicitly defined in VTY
......................................................................
Patch Set 2: Code-Review+2
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/33237
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: Ie81987265118e48173211f88b27a006115dc62d4
Gerrit-Change-Number: 33237
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 14 Jun 2023 12:00:07 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
Attention is currently required from: osmith, neels.
osmith has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/33237 )
Change subject: osmo_sccp_simple_client_on_ss7_id(): Always follow VTY config of ASP if it was explicitly defined in VTY
......................................................................
Patch Set 2: Code-Review+1
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/33237
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: Ie81987265118e48173211f88b27a006115dc62d4
Gerrit-Change-Number: 33237
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 14 Jun 2023 11:58:58 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/33216 )
Change subject: osmo_sccp_simple_client_on_ss7_id(): Support ASP explicitly configured as sctp server
......................................................................
osmo_sccp_simple_client_on_ss7_id(): Support ASP explicitly configured as sctp server
Right now, if a user configures an cs7 instance, as and asp (with
sctp-role server) in the VTY, then the function
osmo_sccp_simple_client_on_ss7_id() (used by osmo-bsc, osmo-msc,
osmo-hnbgw, etc.) will silently change the config to be SCTP client.
This is really confusing, since the user configured explicitly the ASP
as server but ends up running as client.
Instead, if the user explicitly configured the ASP as SCTP server,
allow it (after validating the user also properly configured a xUA
server through VTY).
Change-Id: I20de33edb8751a515d6719c49efadfc387dd85f8
---
M include/osmocom/sigtran/osmo_ss7.h
M src/osmo_ss7_vty.c
M src/sccp_user.c
3 files changed, 47 insertions(+), 4 deletions(-)
Approvals:
laforge: Looks good to me, but someone else must approve
Jenkins Builder: Verified
osmith: Looks good to me, but someone else must approve
pespin: Looks good to me, approved
diff --git a/include/osmocom/sigtran/osmo_ss7.h b/include/osmocom/sigtran/osmo_ss7.h
index e025709..f413983 100644
--- a/include/osmocom/sigtran/osmo_ss7.h
+++ b/include/osmocom/sigtran/osmo_ss7.h
@@ -431,6 +431,7 @@
bool is_server;
enum osmo_ss7_asp_role role;
bool role_set_by_vty;
+ bool sctp_role_set_by_vty;
struct osmo_ss7_asp_peer local;
struct osmo_ss7_asp_peer remote;
diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c
index 541d197..2418428 100644
--- a/src/osmo_ss7_vty.c
+++ b/src/osmo_ss7_vty.c
@@ -736,6 +736,7 @@
else
OSMO_ASSERT(0);
+ asp->cfg.sctp_role_set_by_vty = true;
return CMD_SUCCESS;
}
@@ -854,8 +855,8 @@
vty_out(vty, " role %s%s", osmo_str_tolower(get_value_string(osmo_ss7_asp_role_names, asp->cfg.role)),
VTY_NEWLINE);
}
- if (!asp->cfg.is_server)
- vty_out(vty, " sctp-role client%s", VTY_NEWLINE);
+ if (asp->cfg.sctp_role_set_by_vty || !asp->cfg.is_server)
+ vty_out(vty, " sctp-role %s%s", asp->cfg.is_server ? "server" : "client", VTY_NEWLINE);
for (i = 0; i < sizeof(uint32_t) * 8; i++) {
if (!(asp->cfg.quirks & ((uint32_t) 1 << i)))
continue;
diff --git a/src/sccp_user.c b/src/sccp_user.c
index 2be9cd4..f1a4203 100644
--- a/src/sccp_user.c
+++ b/src/sccp_user.c
@@ -642,8 +642,30 @@
osmo_ss7_as_add_asp(as, asp->cfg.name);
}
- /* Ensure that the ASP we use is set to client mode. */
- asp->cfg.is_server = false;
+ /* Make sure that the sctp-role of this ASP is set to "client" unless the user
+ * made a conscious decision about the role via the VTY */
+ if (!asp->cfg.sctp_role_set_by_vty)
+ asp->cfg.is_server = false;
+
+ /* If ASP was configured through VTY it may be explicitly configured as
+ * SCTP server. It may be a bit confusing since this function is to create
+ * a "SCCP simple client", but this allows users of this API such as
+ * osmo-hnbgw to support SCTP-role server if properly configured through VTY.
+ */
+ if (asp->cfg.is_server) {
+ struct osmo_xua_server *xs;
+ LOGP(DLSCCP, LOGL_NOTICE,
+ "%s: Requesting an SCCP simple client on ASP %s configured with 'sctp-role server'\n",
+ name, asp->cfg.name);
+ xs = osmo_ss7_xua_server_find(ss7, prot, asp->cfg.local.port);
+ if (!xs) {
+ LOGP(DLSCCP, LOGL_ERROR,
+ "%s: Requesting an SCCP simple client on ASP %s configured with 'sctp-role server' "
+ "but no matching xUA server was configured!\n",
+ name, asp->cfg.name);
+ goto out_asp;
+ }
+ }
/* Make sure that the role of this ASP is set to ASP unless the user
* made a conscious decision about the role via the VTY */
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/33216
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I20de33edb8751a515d6719c49efadfc387dd85f8
Gerrit-Change-Number: 33216
Gerrit-PatchSet: 8
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-mgw/+/33308 )
Change subject: mgcp-client: Add keepalive feature
......................................................................
Patch Set 3:
This change is ready for review.
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/33308
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: I3dc74c78548d017f272da863d5282dc5e0020ca3
Gerrit-Change-Number: 33308
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Wed, 14 Jun 2023 11:56:08 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-mgw/+/33313
to look at the new patch set (#2).
Change subject: mgcp_client: pool: Only pick clients with an MGCP link considered to be UP
......................................................................
mgcp_client: pool: Only pick clients with an MGCP link considered to be UP
This way the user ends up picking a working MGW instance instead of one
which is not reachable around the time.
Related: SYS#6481
Change-Id: Ia3f451d3cd97851f65074408812b1ddc68f67056
---
M src/libosmo-mgcp-client/mgcp_client_pool.c
1 file changed, 18 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/13/33313/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/33313
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: Ia3f451d3cd97851f65074408812b1ddc68f67056
Gerrit-Change-Number: 33313
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-MessageType: newpatchset
Attention is currently required from: pespin.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-mgw/+/33312
to look at the new patch set (#2).
Change subject: mgw: Allow auditing speciall 'null' endpoint
......................................................................
mgw: Allow auditing speciall 'null' endpoint
This is a special endpoint which can always be audited. This is useful
for clients who wish to submit requests to osmo-mgw periodically to find
out whether the MGW is still reachable. This endpoint will be used by
libomso-mgcp-client as default target endpoint to implement such
feature.
This "null" Endpoint is osmo-mgw specific, not described in MGCP specs.
Related: SYS#6481
Change-Id: Ia409b16e9211e6261e2e0f21288544289d6f3733
---
M doc/manuals/chapters/mgcp_endpoints.adoc
M include/osmocom/mgcp/mgcp_endp.h
M src/libosmo-mgcp/mgcp_endp.c
M src/libosmo-mgcp/mgcp_protocol.c
4 files changed, 50 insertions(+), 4 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/12/33312/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/33312
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: Ia409b16e9211e6261e2e0f21288544289d6f3733
Gerrit-Change-Number: 33312
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newpatchset
Attention is currently required from: osmith, neels, dexter.
pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/33216 )
Change subject: osmo_sccp_simple_client_on_ss7_id(): Support ASP explicitly configured as sctp server
......................................................................
Patch Set 8:
(1 comment)
File src/osmo_ss7_vty.c:
https://gerrit.osmocom.org/c/libosmo-sccp/+/33216/comment/ff2d5ba4_56469684
PS8, Line 858: || !asp->cfg.is_server
> I wonder if this still makes sense. Is there any way asp->cfg. […]
yes, osmo_ss7_asp_find_or_create(). It's the default unless set by osmo_sccp_simple_client_on_ss7_id() or now also explicitly configured over VTY.
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/33216
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I20de33edb8751a515d6719c49efadfc387dd85f8
Gerrit-Change-Number: 33216
Gerrit-PatchSet: 8
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: dexter <pmaier(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 14 Jun 2023 11:54:22 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: osmith <osmith(a)sysmocom.de>
Gerrit-MessageType: comment