diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-04-23 23:55:14 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2011-04-26 09:33:47 +0200 |
commit | de2b860dffd5e55b52ecf0db36b326f17cf70e10 (patch) | |
tree | f02645e5bfa2764133087453bc143911fc5efb19 /openbsc/src/osmo-bsc_nat/bsc_nat_vty.c | |
parent | c3f28320c24024e6e970735eef6f062821d588a2 (diff) |
nat: Introduce a block on the NAT to slowly get rid of BSCs
For restarting the NAT we can now block it, it will not accept
new connections and for existing connections it will attempt
to drop them over time. A blocked NAT will end up with no BSC
connections left and then can be safely restarted.
Diffstat (limited to 'openbsc/src/osmo-bsc_nat/bsc_nat_vty.c')
-rw-r--r-- | openbsc/src/osmo-bsc_nat/bsc_nat_vty.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c b/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c index da4815084..ef433caed 100644 --- a/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c +++ b/openbsc/src/osmo-bsc_nat/bsc_nat_vty.c @@ -749,6 +749,17 @@ DEFUN(set_last_endp, set_last_endp_cmd, return CMD_SUCCESS; } +DEFUN(block_new_conn, block_new_conn_cmd, + "nat-block (block|unblock)", + "Block the NAT for new connections\n" + "Block\n" "Unblock\n") +{ + _nat->blocked = argv[0][0] == 'b'; + vty_out(vty, "%%Going to %s the NAT.%s", + _nat->blocked ? "block" : "unblock", VTY_NEWLINE); + return CMD_SUCCESS; +} + int bsc_nat_vty_init(struct bsc_nat *nat) { _nat = nat; @@ -766,6 +777,7 @@ int bsc_nat_vty_init(struct bsc_nat *nat) install_element_ve(&show_acc_lst_cmd); install_element(ENABLE_NODE, &set_last_endp_cmd); + install_element(ENABLE_NODE, &block_new_conn_cmd); /* nat group */ install_element(CONFIG_NODE, &cfg_nat_cmd); |