diff options
author | Harald Welte <laforge@gnumonks.org> | 2017-04-14 16:35:36 +0200 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2017-04-14 17:11:21 +0200 |
commit | e7589d107c6167bb77d86fb62aed538b6d8f6c97 (patch) | |
tree | 314db22376a43356e85824c122e414c37ba82d09 | |
parent | 146bb5cebdf789216af5222ccad7fd435b7e1a44 (diff) |
osmo_ss7_vty: Introduce xUA listener accept-asp-connections command
Using this command one can specify if ASP connections should be refused
if there's no matching configuration, or whether ASPs should simply be
create on-demand.
Change-Id: Ic93b99047fb566cdb25a2f4139ebef54849dece9
-rw-r--r-- | src/osmo_ss7_vty.c | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/src/osmo_ss7_vty.c b/src/osmo_ss7_vty.c index 5dfa465..e661623 100644 --- a/src/osmo_ss7_vty.c +++ b/src/osmo_ss7_vty.c @@ -436,12 +436,30 @@ DEFUN(xua_local_ip, xua_local_ip_cmd, return CMD_SUCCESS; } +DEFUN(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" + "Accept only pre-confiugred ASPs (source IP/prt)\n" + "Accept any connection and dynamically create an ASP definition\n") +{ + struct osmo_xua_server *xs = vty->index; + + if (!strcmp(argv[0], "dynamic-permitted")) + xs->cfg.accept_dyn_reg = true; + else + xs->cfg.accept_dyn_reg = false; + + return CMD_SUCCESS; +} + static void write_one_xua(struct vty *vty, struct osmo_xua_server *xs) { vty_out(vty, " %s %u%s", get_value_string(osmo_ss7_asp_protocol_vals, xs->cfg.proto), xs->cfg.local.port, VTY_NEWLINE); vty_out(vty, " local-ip %s%s", xs->cfg.local.host, VTY_NEWLINE); + if (xs->cfg.accept_dyn_reg) + vty_out(vty, " accept-asp-connections dynamic-permitted%s", VTY_NEWLINE); } @@ -1007,6 +1025,7 @@ void osmo_ss7_vty_init_sg(void) install_element(L_CS7_NODE, &cs7_xua_cmd); install_element(L_CS7_NODE, &no_cs7_xua_cmd); install_element(L_CS7_XUA_NODE, &xua_local_ip_cmd); + install_element(L_CS7_XUA_NODE, &xua_accept_dyn_asp_cmd); } void osmo_ss7_set_vty_alloc_ctx(void *ctx) |