pespin has uploaded a new patch set (#3). ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/33238 )
Change subject: tests: Update *.vty after libosmo-sccp VTY improvements
......................................................................
tests: Update *.vty after libosmo-sccp VTY improvements
After recent change, libosmo-sccp is always printing the "role" config.
Depends: libosmo-sccp.git Change-Id Ie81987265118e48173211f88b27a006115dc62d4
Change-Id: I316cd26ceb97f2ccfd1065d65177e7d3926625b0
---
M tests/config/defaults.vty
M tests/config/legacy.vty
M tests/config/one_cs7.vty
M tests/config/one_cs7_with_addrs.vty
M tests/config/one_cs7_with_iucs_addr.vty
M tests/config/one_cs7_with_iups_addr.vty
M tests/config/two_cs7.vty
M tests/config/two_cs7_with_addrs.vty
8 files changed, 21 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/38/33238/3
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/33238
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I316cd26ceb97f2ccfd1065d65177e7d3926625b0
Gerrit-Change-Number: 33238
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-CC: Jenkins Builder
Gerrit-MessageType: newpatchset
pespin has uploaded a new patch set (#2). ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/33238 )
Change subject: tests: Update defaults.vty after libosmo-sccp VTY improvements
......................................................................
tests: Update defaults.vty after libosmo-sccp VTY improvements
After recent change, libosmo-sccp is always printing the "role" config.
Depends: libosmo-sccp.git Change-Id Ie81987265118e48173211f88b27a006115dc62d4
Change-Id: I316cd26ceb97f2ccfd1065d65177e7d3926625b0
---
M tests/config/defaults.vty
M tests/config/legacy.vty
M tests/config/one_cs7.vty
M tests/config/one_cs7_with_addrs.vty
M tests/config/one_cs7_with_iucs_addr.vty
M tests/config/one_cs7_with_iups_addr.vty
M tests/config/two_cs7.vty
M tests/config/two_cs7_with_addrs.vty
8 files changed, 21 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-hnbgw refs/changes/38/33238/2
--
To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/33238
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-hnbgw
Gerrit-Branch: master
Gerrit-Change-Id: I316cd26ceb97f2ccfd1065d65177e7d3926625b0
Gerrit-Change-Number: 33238
Gerrit-PatchSet: 2
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-CC: Jenkins Builder
Gerrit-MessageType: newpatchset
pespin has uploaded this change for review. ( 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(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/37/33237/1
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 421ba9c..2a7c53b 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 982f188..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 concious 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 14ca25a..bd1c139 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: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: neels, laforge.
Hello Jenkins Builder, neels, laforge,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmo-sccp/+/33216
to look at the new patch set (#6).
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(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/16/33216/6
--
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: 6
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-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newpatchset
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33236 )
Change subject: Explicitly configure ASPs asp-clnt-* as role=asp & sctp-role=client
......................................................................
Explicitly configure ASPs asp-clnt-* as role=asp & sctp-role=client
Until recently, the asp-clnt-* ASPs, which have specific handling in osmo_sccp_simple_client_on_ss7_id(),
were being always forcedly set to sctp-role CLIENT by code in that
function.
This prevented user of that API from explicitly configuring the ASP as
"sctp-role server" through the VTY as the option would be overwritten silently.
Now, the sctp-role from config is followed if the ASP is
defined/configured through the VTY (not dynamically created at the time
osmo_sccp_simple_client_on_ss7_id() is called).
Since the default for a VTY-specified ASP is to be in "sctp-role
server", the config files need to be updated to properly configure the
ASP to be in "sctp-role client", which is the desired mode here.
Same applies for "role", where the default is SG but it is actually used
as "ASP" here.
Change-Id: I4eb5b5f6b4b24df079b4c74e2a2e2ebb8769b0bd
---
M bsc/osmo-bsc-sccplite.cfg
M bsc/osmo-bsc-vamos.cfg
M bsc/osmo-bsc.cfg
M bts/osmo-bsc.cfg
M msc/osmo-msc.cfg
M sgsn/osmo-sgsn.cfg
M sgsn/osmo-sgsn.sns.cfg
M smlc/osmo-smlc.cfg
8 files changed, 42 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/36/33236/1
diff --git a/bsc/osmo-bsc-sccplite.cfg b/bsc/osmo-bsc-sccplite.cfg
index 4a3498b..05934ed 100644
--- a/bsc/osmo-bsc-sccplite.cfg
+++ b/bsc/osmo-bsc-sccplite.cfg
@@ -25,6 +25,8 @@
point-code 0.23.3
asp asp-clnt-msc-0 5000 0 ipa
remote-ip 127.0.0.1
+ role asp
+ sctp-role client
as as-clnt-msc-0 ipa
asp asp-clnt-msc-0
routing-key 0 0.23.3
diff --git a/bsc/osmo-bsc-vamos.cfg b/bsc/osmo-bsc-vamos.cfg
index 4b0389f..73cafe7 100644
--- a/bsc/osmo-bsc-vamos.cfg
+++ b/bsc/osmo-bsc-vamos.cfg
@@ -49,6 +49,8 @@
cs7 instance 0
asp asp-clnt-msc-0 2905 1905 m3ua
remote-ip 127.0.0.1
+ role asp
+ sctp-role client
sccp-address msc2
point-code 0.0.2
sccp-address msc3
diff --git a/bsc/osmo-bsc.cfg b/bsc/osmo-bsc.cfg
index bb62f52..43f7833 100644
--- a/bsc/osmo-bsc.cfg
+++ b/bsc/osmo-bsc.cfg
@@ -49,6 +49,8 @@
cs7 instance 0
asp asp-clnt-msc-0 2905 1905 m3ua
remote-ip 127.0.0.1
+ role asp
+ sctp-role client
sccp-address msc2
point-code 0.0.2
sccp-address msc3
diff --git a/bts/osmo-bsc.cfg b/bts/osmo-bsc.cfg
index 8f3169b..967e265 100644
--- a/bts/osmo-bsc.cfg
+++ b/bts/osmo-bsc.cfg
@@ -40,6 +40,8 @@
cs7 instance 0
point-code 0.23.3
asp asp-clnt-msc-0 2905 0 m3ua
+ role asp
+ sctp-role client
as as-clnt-msc-0 m3ua
asp asp-clnt-msc-0
routing-key 2 0.23.3
diff --git a/msc/osmo-msc.cfg b/msc/osmo-msc.cfg
index 1adb0e9..a266ed4 100644
--- a/msc/osmo-msc.cfg
+++ b/msc/osmo-msc.cfg
@@ -42,6 +42,8 @@
point-code 0.23.1
asp asp-clnt-OsmoMSC-A 2905 0 m3ua
remote-ip 127.0.0.1
+ role asp
+ sctp-role client
as as-clnt-OsmoMSC-A m3ua
asp asp-clnt-OsmoMSC-A
routing-key 3 0.23.1
diff --git a/sgsn/osmo-sgsn.cfg b/sgsn/osmo-sgsn.cfg
index 7941007..b446f87 100644
--- a/sgsn/osmo-sgsn.cfg
+++ b/sgsn/osmo-sgsn.cfg
@@ -58,6 +58,8 @@
point-code 0.23.4
asp asp-clnt-OsmoSGSN-A 2905 0 m3ua
remote-ip 127.0.0.200
+ role asp
+ sctp-role client
as as-clnt-OsmoSGSN-A m3ua
asp asp-clnt-OsmoSGSN-A
routing-key 3 0.23.4
diff --git a/sgsn/osmo-sgsn.sns.cfg b/sgsn/osmo-sgsn.sns.cfg
index 988790a..5d09b1b 100644
--- a/sgsn/osmo-sgsn.sns.cfg
+++ b/sgsn/osmo-sgsn.sns.cfg
@@ -58,6 +58,8 @@
point-code 0.23.4
asp asp-clnt-OsmoSGSN-A 2905 0 m3ua
remote-ip 127.0.0.200
+ role asp
+ sctp-role client
as as-clnt-OsmoSGSN-A m3ua
asp asp-clnt-OsmoSGSN-A
routing-key 3 0.23.4
diff --git a/smlc/osmo-smlc.cfg b/smlc/osmo-smlc.cfg
index 3bba0b3..7da2163 100644
--- a/smlc/osmo-smlc.cfg
+++ b/smlc/osmo-smlc.cfg
@@ -21,7 +21,8 @@
local-ip fd02:db8:23::20
remote-ip 172.18.23.200
remote-ip fd02:db8:23::200
-
+ role asp
+ sctp-role client
cells
lac-ci 23 42 lat 23.23 lon 42.42
cgi 001 02 3 4 lat 5.678 lon 6.789
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/33236
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: I4eb5b5f6b4b24df079b4c74e2a2e2ebb8769b0bd
Gerrit-Change-Number: 33236
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange
Attention is currently required from: arehbein, laforge, pespin.
daniel has posted comments on this change. ( https://gerrit.osmocom.org/c/libosmo-netif/+/33193 )
Change subject: Add osmo_io support to osmo_stream_cli and osmo_stream_srv
......................................................................
Patch Set 6:
(1 comment)
Patchset:
PS5:
> >The problem I see is: How would you handle compatibility with old code that registers a read_cb? T […]
Some more open questions:
Since we already have osmo_stream_*_get_ofd() we should add osmo_stream_*_get_iofd(). Since they will return pointer we could simply return NULL if it's called with the wrong mode, but maybe an assert is better.
osmo_stream_srv_create2 is called with the newly accept()ed fd so I'd still pass the read/close callbacks in create2().
Otherwise the code would look like this:
```
accept_cb(link, fd) {
srv = osmo_stream_srv_create2(ctx, "Connection", link, fd);
osmo_stream_srv_set_read_cb(srv, read_cb);
osmo_stream_srv_set_close_cb(srv, close_cb);
// Somehow we need to signal that the callbacks are set and we are ready to read data
osmo_stream_srv_open(srv);
}
```
--
To view, visit https://gerrit.osmocom.org/c/libosmo-netif/+/33193
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: libosmo-netif
Gerrit-Branch: master
Gerrit-Change-Id: I2f52c7107c392b6f4b0bf2a84f8c873c084a200c
Gerrit-Change-Number: 33193
Gerrit-PatchSet: 6
Gerrit-Owner: arehbein <arehbein(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-CC: daniel <dwillmann(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: arehbein <arehbein(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Thu, 08 Jun 2023 16:40:28 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: laforge <laforge(a)osmocom.org>
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Comment-In-Reply-To: daniel <dwillmann(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: neels, laforge.
Hello Jenkins Builder, neels, laforge,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/libosmo-sccp/+/33216
to look at the new patch set (#5).
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, 45 insertions(+), 2 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/16/33216/5
--
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: 5
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-Attention: neels <nhofmeyr(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-MessageType: newpatchset