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.
This commit is contained in:
parent
3229f442f4
commit
e393f273e7
|
@ -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;
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue