diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-10-11 10:06:39 +0200 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2010-10-25 21:04:46 +0200 |
commit | c1578bc74702ac879b7fbf6cab868770f268e3cd (patch) | |
tree | d0d5717aee694779da0ecf16d63de26b01428e78 /openbsc/src | |
parent | c1cac1e31ac89ce533fea50eb1150b29ad260c8c (diff) |
nat: Add an option to set the query string to match
Allow the query string to be set. The ussd matching code
will check for this string and then forward it to the bypass.
Diffstat (limited to 'openbsc/src')
-rw-r--r-- | openbsc/src/nat/bsc_nat_vty.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/openbsc/src/nat/bsc_nat_vty.c b/openbsc/src/nat/bsc_nat_vty.c index de58bba07..940ebfdf2 100644 --- a/openbsc/src/nat/bsc_nat_vty.c +++ b/openbsc/src/nat/bsc_nat_vty.c @@ -80,6 +80,8 @@ static int config_write_nat(struct vty *vty) vty_out(vty, " access-list-name %s%s", _nat->acc_lst_name, VTY_NEWLINE); if (_nat->ussd_lst_name) vty_out(vty, " ussd-list-name %s%s", _nat->ussd_lst_name, VTY_NEWLINE); + if (_nat->ussd_query) + vty_out(vty, " ussd-query %s%s", _nat->ussd_query, VTY_NEWLINE); llist_for_each_entry(lst, &_nat->access_lists, list) { write_acc_lst(vty, lst); @@ -409,6 +411,18 @@ DEFUN(cfg_nat_ussd_lst_name, return CMD_SUCCESS; } +DEFUN(cfg_nat_ussd_query, + cfg_nat_ussd_query_cmd, + "ussd-query QUERY", + "Set the USSD query to match with the ussd-list-name\n" + "The query to match") +{ + if (_nat->ussd_query) + talloc_free(_nat->ussd_query); + _nat->ussd_query = talloc_strdup(_nat, argv[0]); + return CMD_SUCCESS; +} + /* per BSC configuration */ DEFUN(cfg_bsc, cfg_bsc_cmd, "bsc BSC_NR", "Select a BSC to configure") { @@ -647,6 +661,7 @@ int bsc_nat_vty_init(struct bsc_nat *nat) install_element(NAT_NODE, &cfg_nat_bsc_ip_tos_cmd); install_element(NAT_NODE, &cfg_nat_acc_lst_name_cmd); install_element(NAT_NODE, &cfg_nat_ussd_lst_name_cmd); + install_element(NAT_NODE, &cfg_nat_ussd_query_cmd); /* access-list */ install_element(NAT_NODE, &cfg_lst_imsi_allow_cmd); |