Neels Hofmeyr has submitted this change and it was merged.

Change subject: vty: add 'asp' / 'local-ip' command
......................................................................


vty: add 'asp' / 'local-ip' command

We can set the ASP's remote IP (i.e. where to reach osmo-stp), but so far the
only way to specify the local IP address to bind to can only be set from C code
(e.g. the simple client). Allow setting the local address via VTY.

For example, this is desired for the osmo-gsm-tester, to not use arbitrary IP
addresses.

Change-Id: I3f71897dfacafcf3126e51894d6ca756b02dcd7d
---
M src/osmo_ss7_vty.c
1 file changed, 13 insertions(+), 0 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c
index 1fb35a1..8d13865 100644
--- a/src/osmo_ss7_vty.c
+++ b/src/osmo_ss7_vty.c
@@ -556,6 +556,16 @@
        return CMD_SUCCESS;
 }
 
+DEFUN(asp_local_ip, asp_local_ip_cmd,
+       "local-ip A.B.C.D",
+       "Specify Local IP Address from which to contact ASP\n"
+       "Local IP Address from which to contact of ASP\n")
+{
+       struct osmo_ss7_asp *asp = vty->index;
+       osmo_talloc_replace_string(asp, &asp->cfg.local.host, argv[0]);
+       return CMD_SUCCESS;
+}
+
 DEFUN(asp_remote_ip, asp_remote_ip_cmd,
        "remote-ip A.B.C.D",
        "Specify Remote IP Address of ASP\n"
@@ -633,6 +643,8 @@
                osmo_ss7_asp_protocol_name(asp->cfg.proto), VTY_NEWLINE);
        if (asp->cfg.description)
                vty_out(vty, "  description %s%s", asp->cfg.description, 
VTY_NEWLINE);
+       if (asp->cfg.local.host)
+               vty_out(vty, "  local-ip %s%s", asp->cfg.local.host, 
VTY_NEWLINE);
        if (asp->cfg.remote.host)
                vty_out(vty, "  remote-ip %s%s", asp->cfg.remote.host, 
VTY_NEWLINE);
        if (asp->cfg.qos_class)
@@ -1728,6 +1740,7 @@
        install_element(L_CS7_NODE, &no_cs7_asp_cmd);
        install_element(L_CS7_ASP_NODE, &cfg_description_cmd);
        install_element(L_CS7_ASP_NODE, &asp_remote_ip_cmd);
+       install_element(L_CS7_ASP_NODE, &asp_local_ip_cmd);
        install_element(L_CS7_ASP_NODE, &asp_qos_class_cmd);
        install_element(L_CS7_ASP_NODE, &asp_block_cmd);
        install_element(L_CS7_ASP_NODE, &asp_shutdown_cmd);

-- 
To view, visit https://gerrit.osmocom.org/3826
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I3f71897dfacafcf3126e51894d6ca756b02dcd7d
Gerrit-PatchSet: 2
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: Neels Hofmeyr <[email protected]>
Gerrit-Reviewer: Harald Welte <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: Neels Hofmeyr <[email protected]>

Reply via email to