[S] Change in libosmo-sccp[master]: xua_server: asp: Support removing local addresses

2023-10-04 Thread pespin
pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/libosmo-sccp/+/34613?usp=email )

Change subject: xua_server: asp: Support removing local addresses
..

xua_server: asp: Support removing local addresses

The socket is reconfigured (and hence reopened) upon VTY node exit if
changes were stored in the address list of the xua_server
(osmo_stream_srv_link).

Related: OS#4607
Change-Id: I942edff7695efeea7753f22e31c2098c201290ff
---
M include/osmocom/sigtran/osmo_ss7.h
M src/osmo_ss7_vty.c
M src/osmo_ss7_xua_srv.c
3 files changed, 43 insertions(+), 0 deletions(-)

Approvals:
  pespin: Looks good to me, approved
  laforge: Looks good to me, but someone else must approve
  Jenkins Builder: Verified
  osmith: Looks good to me, but someone else must approve




diff --git a/include/osmocom/sigtran/osmo_ss7.h 
b/include/osmocom/sigtran/osmo_ss7.h
index 841c12b..a8a624f 100644
--- a/include/osmocom/sigtran/osmo_ss7.h
+++ b/include/osmocom/sigtran/osmo_ss7.h
@@ -562,6 +562,7 @@
 int
 osmo_ss7_xua_server_set_local_hosts(struct osmo_xua_server *xs, const char 
**local_hosts, size_t local_host_cnt);
 int osmo_ss7_xua_server_add_local_host(struct osmo_xua_server *xs, const char 
*local_host);
+int osmo_ss7_xua_server_del_local_host(struct osmo_xua_server *xs, const char 
*local_host);
 void osmo_ss7_xua_server_destroy(struct osmo_xua_server *xs);

 struct osmo_sccp_instance *
diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c
index 172893e..ff27cf3 100644
--- a/src/osmo_ss7_vty.c
+++ b/src/osmo_ss7_vty.c
@@ -511,6 +511,22 @@
return CMD_SUCCESS;
 }

+DEFUN_ATTR(xua_no_local_ip, xua_no_local_ip_cmd,
+  "no local-ip " VTY_IPV46_CMD,
+  NO_STR "Configure the Local IP Address for xUA\n"
+  "IPv4 Address to use for XUA\n"
+  "IPv6 Address to use for XUA\n",
+  CMD_ATTR_NODE_EXIT)
+{
+   struct osmo_xua_server *xs = vty->index;
+
+   if (osmo_ss7_xua_server_del_local_host(xs, argv[0]) != 0) {
+   vty_out(vty, "%% Failed deleting local address '%s' from 
set%s", argv[0], VTY_NEWLINE);
+   return CMD_WARNING;
+   }
+   return CMD_SUCCESS;
+}
+
 DEFUN_ATTR(xua_accept_dyn_asp, xua_accept_dyn_asp_cmd,
   "accept-asp-connections (pre-configured|dynamic-permitted)",
   "Define what kind of ASP connections to accept\n"
@@ -2476,6 +2492,7 @@
install_lib_element(L_CS7_NODE, _xua_cmd);
install_lib_element(L_CS7_NODE, _cs7_xua_cmd);
install_lib_element(L_CS7_XUA_NODE, _local_ip_cmd);
+   install_lib_element(L_CS7_XUA_NODE, _no_local_ip_cmd);
install_lib_element(L_CS7_XUA_NODE, _accept_dyn_asp_cmd);
install_lib_element(L_CS7_XUA_NODE, _sctp_param_init_cmd);
install_lib_element(L_CS7_XUA_NODE, _no_sctp_param_init_cmd);
diff --git a/src/osmo_ss7_xua_srv.c b/src/osmo_ss7_xua_srv.c
index dc27c83..32266ff 100644
--- a/src/osmo_ss7_xua_srv.c
+++ b/src/osmo_ss7_xua_srv.c
@@ -284,6 +284,17 @@
return osmo_stream_srv_link_set_addrs(xs->server, (const char 
**)xs->cfg.local.host, xs->cfg.local.host_cnt);
 }

+int
+osmo_ss7_xua_server_del_local_host(struct osmo_xua_server *xs, const char 
*local_host)
+{
+   int rc;
+
+   rc = osmo_ss7_asp_peer_del_host(>cfg.local, local_host);
+   if (rc < 0)
+   return rc;
+   return osmo_stream_srv_link_set_addrs(xs->server, (const char 
**)xs->cfg.local.host, xs->cfg.local.host_cnt);
+}
+
 bool ss7_xua_server_set_default_local_hosts(struct osmo_xua_server *oxs)
 {
/* If no local addr was set, or erased after _create(): */

--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/34613?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I942edff7695efeea7753f22e31c2098c201290ff
Gerrit-Change-Number: 34613
Gerrit-PatchSet: 2
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-MessageType: merged


[S] Change in libosmo-sccp[master]: xua_server: asp: Support removing local addresses

2023-10-04 Thread pespin
pespin has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmo-sccp/+/34613?usp=email )

Change subject: xua_server: asp: Support removing local addresses
..


Patch Set 1: Code-Review+2


--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/34613?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I942edff7695efeea7753f22e31c2098c201290ff
Gerrit-Change-Number: 34613
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Reviewer: pespin 
Gerrit-Comment-Date: Wed, 04 Oct 2023 11:21:03 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in libosmo-sccp[master]: xua_server: asp: Support removing local addresses

2023-10-04 Thread osmith
Attention is currently required from: pespin.

osmith has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmo-sccp/+/34613?usp=email )

Change subject: xua_server: asp: Support removing local addresses
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/34613?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I942edff7695efeea7753f22e31c2098c201290ff
Gerrit-Change-Number: 34613
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Reviewer: osmith 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Wed, 04 Oct 2023 08:39:34 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in libosmo-sccp[master]: xua_server: asp: Support removing local addresses

2023-10-03 Thread laforge
Attention is currently required from: pespin.

laforge has posted comments on this change. ( 
https://gerrit.osmocom.org/c/libosmo-sccp/+/34613?usp=email )

Change subject: xua_server: asp: Support removing local addresses
..


Patch Set 1: Code-Review+1


--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/34613?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I942edff7695efeea7753f22e31c2098c201290ff
Gerrit-Change-Number: 34613
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge 
Gerrit-Attention: pespin 
Gerrit-Comment-Date: Tue, 03 Oct 2023 12:42:49 +
Gerrit-HasComments: No
Gerrit-Has-Labels: Yes
Gerrit-MessageType: comment


[S] Change in libosmo-sccp[master]: xua_server: asp: Support removing local addresses

2023-10-02 Thread pespin
pespin has uploaded this change for review. ( 
https://gerrit.osmocom.org/c/libosmo-sccp/+/34613?usp=email )


Change subject: xua_server: asp: Support removing local addresses
..

xua_server: asp: Support removing local addresses

The socket is reconfigured (and hence reopened) upon VTY node exit if
changes were stored in the address list of the xua_server
(osmo_stream_srv_link).

Related: OS#4607
Change-Id: I942edff7695efeea7753f22e31c2098c201290ff
---
M include/osmocom/sigtran/osmo_ss7.h
M src/osmo_ss7_vty.c
M src/osmo_ss7_xua_srv.c
3 files changed, 43 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/13/34613/1

diff --git a/include/osmocom/sigtran/osmo_ss7.h 
b/include/osmocom/sigtran/osmo_ss7.h
index 841c12b..a8a624f 100644
--- a/include/osmocom/sigtran/osmo_ss7.h
+++ b/include/osmocom/sigtran/osmo_ss7.h
@@ -562,6 +562,7 @@
 int
 osmo_ss7_xua_server_set_local_hosts(struct osmo_xua_server *xs, const char 
**local_hosts, size_t local_host_cnt);
 int osmo_ss7_xua_server_add_local_host(struct osmo_xua_server *xs, const char 
*local_host);
+int osmo_ss7_xua_server_del_local_host(struct osmo_xua_server *xs, const char 
*local_host);
 void osmo_ss7_xua_server_destroy(struct osmo_xua_server *xs);

 struct osmo_sccp_instance *
diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c
index 172893e..ff27cf3 100644
--- a/src/osmo_ss7_vty.c
+++ b/src/osmo_ss7_vty.c
@@ -511,6 +511,22 @@
return CMD_SUCCESS;
 }

+DEFUN_ATTR(xua_no_local_ip, xua_no_local_ip_cmd,
+  "no local-ip " VTY_IPV46_CMD,
+  NO_STR "Configure the Local IP Address for xUA\n"
+  "IPv4 Address to use for XUA\n"
+  "IPv6 Address to use for XUA\n",
+  CMD_ATTR_NODE_EXIT)
+{
+   struct osmo_xua_server *xs = vty->index;
+
+   if (osmo_ss7_xua_server_del_local_host(xs, argv[0]) != 0) {
+   vty_out(vty, "%% Failed deleting local address '%s' from 
set%s", argv[0], VTY_NEWLINE);
+   return CMD_WARNING;
+   }
+   return CMD_SUCCESS;
+}
+
 DEFUN_ATTR(xua_accept_dyn_asp, xua_accept_dyn_asp_cmd,
   "accept-asp-connections (pre-configured|dynamic-permitted)",
   "Define what kind of ASP connections to accept\n"
@@ -2476,6 +2492,7 @@
install_lib_element(L_CS7_NODE, _xua_cmd);
install_lib_element(L_CS7_NODE, _cs7_xua_cmd);
install_lib_element(L_CS7_XUA_NODE, _local_ip_cmd);
+   install_lib_element(L_CS7_XUA_NODE, _no_local_ip_cmd);
install_lib_element(L_CS7_XUA_NODE, _accept_dyn_asp_cmd);
install_lib_element(L_CS7_XUA_NODE, _sctp_param_init_cmd);
install_lib_element(L_CS7_XUA_NODE, _no_sctp_param_init_cmd);
diff --git a/src/osmo_ss7_xua_srv.c b/src/osmo_ss7_xua_srv.c
index dc27c83..32266ff 100644
--- a/src/osmo_ss7_xua_srv.c
+++ b/src/osmo_ss7_xua_srv.c
@@ -284,6 +284,17 @@
return osmo_stream_srv_link_set_addrs(xs->server, (const char 
**)xs->cfg.local.host, xs->cfg.local.host_cnt);
 }
 
+int
+osmo_ss7_xua_server_del_local_host(struct osmo_xua_server *xs, const char 
*local_host)
+{
+   int rc;
+
+   rc = osmo_ss7_asp_peer_del_host(>cfg.local, local_host);
+   if (rc < 0)
+   return rc;
+   return osmo_stream_srv_link_set_addrs(xs->server, (const char 
**)xs->cfg.local.host, xs->cfg.local.host_cnt);
+}
+
 bool ss7_xua_server_set_default_local_hosts(struct osmo_xua_server *oxs)
 {
/* If no local addr was set, or erased after _create(): */

--
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/34613?usp=email
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: I942edff7695efeea7753f22e31c2098c201290ff
Gerrit-Change-Number: 34613
Gerrit-PatchSet: 1
Gerrit-Owner: pespin 
Gerrit-MessageType: newchange