From d1effd835fb8ca5df7d32db0eeee82c1939e1ab9 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Sun, 10 Oct 2010 17:29:20 +0200 Subject: nat: Provide a USSD access list to check for which to play HLR. --- openbsc/include/openbsc/bsc_nat.h | 3 +++ openbsc/src/nat/bsc_nat_vty.c | 15 +++++++++++++++ 2 files changed, 18 insertions(+) diff --git a/openbsc/include/openbsc/bsc_nat.h b/openbsc/include/openbsc/bsc_nat.h index baa950ccb..678f1895f 100644 --- a/openbsc/include/openbsc/bsc_nat.h +++ b/openbsc/include/openbsc/bsc_nat.h @@ -232,6 +232,9 @@ struct bsc_nat { /* filter */ char *acc_lst_name; + /* USSD messages we want to match */ + char *ussd_lst_name; + /* statistics */ struct bsc_nat_statistics stats; }; diff --git a/openbsc/src/nat/bsc_nat_vty.c b/openbsc/src/nat/bsc_nat_vty.c index 9822e5c57..de58bba07 100644 --- a/openbsc/src/nat/bsc_nat_vty.c +++ b/openbsc/src/nat/bsc_nat_vty.c @@ -78,6 +78,8 @@ static int config_write_nat(struct vty *vty) vty_out(vty, " ip-dscp %d%s", _nat->bsc_ip_dscp, VTY_NEWLINE); if (_nat->acc_lst_name) 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); llist_for_each_entry(lst, &_nat->access_lists, list) { write_acc_lst(vty, lst); @@ -395,6 +397,18 @@ DEFUN(cfg_nat_acc_lst_name, return CMD_SUCCESS; } +DEFUN(cfg_nat_ussd_lst_name, + cfg_nat_ussd_lst_name_cmd, + "ussd-list-name NAME", + "Set the name of the access list to check for IMSIs for USSD message\n" + "The name of the access list for HLR USSD handling") +{ + if (_nat->ussd_lst_name) + talloc_free(_nat->ussd_lst_name); + _nat->ussd_lst_name = 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") { @@ -632,6 +646,7 @@ int bsc_nat_vty_init(struct bsc_nat *nat) install_element(NAT_NODE, &cfg_nat_bsc_ip_dscp_cmd); 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); /* access-list */ install_element(NAT_NODE, &cfg_lst_imsi_allow_cmd); -- cgit v1.2.3