aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-10-12 18:25:52 +0200
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-10-25 21:04:46 +0200
commite393f273e7c65edea09b12385ca648724c9c3825 (patch)
tree036424e1446d2e880023a5f70d1eeac6305ec2a5
parent3229f442f46480551479b987f2f6a1b5c360e4d6 (diff)
nat: Keep a ussd token in the config
We will have the USSD provider connecting to us and we will use the IPA protocol, including the auth mechanism.
-rw-r--r--openbsc/include/openbsc/bsc_nat.h2
-rw-r--r--openbsc/src/nat/bsc_nat_vty.c28
2 files changed, 30 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/bsc_nat.h b/openbsc/include/openbsc/bsc_nat.h
index 61f19f27..f718766a 100644
--- a/openbsc/include/openbsc/bsc_nat.h
+++ b/openbsc/include/openbsc/bsc_nat.h
@@ -235,6 +235,8 @@ struct bsc_nat {
/* USSD messages we want to match */
char *ussd_lst_name;
char *ussd_query;
+ char *ussd_token;
+ char *ussd_local;
/* 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 940ebfdf..b284fedd 100644
--- a/openbsc/src/nat/bsc_nat_vty.c
+++ b/openbsc/src/nat/bsc_nat_vty.c
@@ -82,6 +82,10 @@ static int config_write_nat(struct vty *vty)
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);
+ if (_nat->ussd_token)
+ vty_out(vty, " ussd-token %s%s", _nat->ussd_token, VTY_NEWLINE);
+ if (_nat->ussd_local)
+ vty_out(vty, " ussd-local-ip %s%s", _nat->ussd_local, VTY_NEWLINE);
llist_for_each_entry(lst, &_nat->access_lists, list) {
write_acc_lst(vty, lst);
@@ -423,6 +427,28 @@ DEFUN(cfg_nat_ussd_query,
return CMD_SUCCESS;
}
+DEFUN(cfg_nat_ussd_token,
+ cfg_nat_ussd_token_cmd,
+ "ussd-token TOKEN",
+ "Set the token used to identify the USSD module\n" "Secret key\n")
+{
+ if (_nat->ussd_token)
+ talloc_free(_nat->ussd_token);
+ _nat->ussd_token = talloc_strdup(_nat, argv[0]);
+ return CMD_SUCCESS;
+}
+
+DEFUN(cfg_nat_ussd_local,
+ cfg_nat_ussd_local_cmd,
+ "ussd-local-ip A.B.C.D",
+ "Set the IP to listen for the USSD Provider\n" "IP Address\n")
+{
+ if (_nat->ussd_local)
+ talloc_free(_nat->ussd_local);
+ _nat->ussd_local = 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")
{
@@ -662,6 +688,8 @@ int bsc_nat_vty_init(struct bsc_nat *nat)
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);
+ install_element(NAT_NODE, &cfg_nat_ussd_token_cmd);
+ install_element(NAT_NODE, &cfg_nat_ussd_local_cmd);
/* access-list */
install_element(NAT_NODE, &cfg_lst_imsi_allow_cmd);