pespin submitted this change.

View Change


Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve osmith: Looks good to me, but someone else must approve fixeria: Looks good to me, approved
Set stream_cli/srv name to contain ASP + sockname

Upon connect/accept, update the name to contain both the ASP and the
sockname of the established socked. This allows easily identifying the
stream based on IP layer as well as upper xUA layer.

Example logs:
"""
stream.c:1193 SRV(m3ua,::1:2905) accept()ed new link from ::1 to port 2905
stream.c:1672 SRVCONN(asp-dyn-0,(r=::1:43568<->l=::1:2905)) connected read/write (what=0x1)
stream.c:1589 SRVCONN(asp-dyn-0,(r=::1:43568<->l=::1:2905)) message received
"""
"""
stream.c:521 CLICONN(asp0){CONNECTING} connection established
stream.c:552 CLICONN(asp0,(r=::1:2905<->l=::ffff:127.0.0.2:35911)){CONNECTED} connected read
stream.c:401 CLICONN(asp0,(r=::1:2905<->l=::ffff:127.0.0.2:35911)){CONNECTED} message received
"""

Depends: libosmo-netif.git I539a0d29d11348efe702f971965a55cf56db5c59
Change-Id: I05bc5f6c7795f62c1814c1c774287b41ee85a475
---
M TODO-RELEASE
M src/osmo_ss7.c
2 files changed, 31 insertions(+), 0 deletions(-)

diff --git a/TODO-RELEASE b/TODO-RELEASE
index 5406d05..000f9f3 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -8,5 +8,6 @@
# If any interfaces have been removed or changed since the last public release: c:r:0.
#library what description / commit summary line
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
diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c
index aba14b3..3851ab8 100644
--- a/src/osmo_ss7.c
+++ b/src/osmo_ss7.c
@@ -1623,6 +1623,7 @@
" client for ASP %s\n", asp->cfg.name);
return -1;
}
+ osmo_stream_cli_set_name(asp->client, asp->cfg.name);
osmo_stream_cli_set_nodelay(asp->client, true);
osmo_stream_cli_set_addrs(asp->client, (const char**)asp->cfg.remote.host, asp->cfg.remote.host_cnt);
osmo_stream_cli_set_port(asp->client, asp->cfg.remote.port);
@@ -2089,9 +2090,11 @@
* connection came in */
asp->server = srv;
asp->xua_server = oxs;
+
/* update the ASP socket name */
talloc_free(asp->sock_name);
asp->sock_name = talloc_reparent(link, asp, sock_name);
+ osmo_stream_srv_set_name(asp->server, asp->cfg.name);
/* make sure the conn_cb() is called with the asp as private
* data */
osmo_stream_srv_set_data(srv, asp);
@@ -2206,6 +2209,7 @@
oxs->cfg.local.port = local_port;

oxs->server = osmo_stream_srv_link_create(oxs);
+ osmo_stream_srv_link_set_name(oxs->server, osmo_ss7_asp_protocol_name(proto));
osmo_stream_srv_link_set_data(oxs->server, oxs);
osmo_stream_srv_link_set_accept_cb(oxs->server, xua_accept_cb);


To view, visit change 33335. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I05bc5f6c7795f62c1814c1c774287b41ee85a475
Gerrit-Change-Number: 33335
Gerrit-PatchSet: 9
Gerrit-Owner: pespin <pespin@sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann@sysmocom.de>
Gerrit-Reviewer: fixeria <vyanitskiy@sysmocom.de>
Gerrit-Reviewer: laforge <laforge@osmocom.org>
Gerrit-Reviewer: osmith <osmith@sysmocom.de>
Gerrit-Reviewer: pespin <pespin@sysmocom.de>
Gerrit-MessageType: merged