add VTY/configfile command for setting encryption (A5) level

This is just configuring the gsm_network property, nobody uses it yet
This commit is contained in:
Harald Welte 2009-08-30 15:47:06 +09:00
parent 08d91a5b26
commit 4381cfe41b
2 changed files with 15 additions and 0 deletions

View File

@ -374,6 +374,7 @@ struct gsm_network {
char *name_long;
char *name_short;
enum gsm_auth_policy auth_policy;
int a5_encryption;
/* layer 4 */
int (*mncc_recv) (struct gsm_network *net, int msg_type, void *arg);

View File

@ -85,6 +85,8 @@ static void net_dump_vty(struct vty *vty, struct gsm_network *net)
net->name_short, VTY_NEWLINE);
vty_out(vty, " Authentication policy: %s%s",
gsm_auth_policy_name(net->auth_policy), VTY_NEWLINE);
vty_out(vty, " Encryption: A5/%u%s", net->a5_encryption,
VTY_NEWLINE);
}
DEFUN(show_net, show_net_cmd, "show network",
@ -264,6 +266,7 @@ static int config_write_net(struct vty *vty)
vty_out(vty, " short name %s%s", gsmnet->name_short, VTY_NEWLINE);
vty_out(vty, " long name %s%s", gsmnet->name_long, VTY_NEWLINE);
vty_out(vty, " auth policy %s%s", gsm_auth_policy_name(gsmnet->auth_policy), VTY_NEWLINE);
vty_out(vty, " encryption a5 %u%s", gsmnet->a5_encryption, VTY_NEWLINE);
return CMD_SUCCESS;
}
@ -766,6 +769,16 @@ DEFUN(cfg_net_auth_policy,
return CMD_SUCCESS;
}
DEFUN(cfg_net_encryption,
cfg_net_encryption_cmd,
"encryption a5 (0|1|2)",
"Enable or disable encryption (A5) for this network\n")
{
gsmnet->auth_policy = atoi(argv[0]);
return CMD_SUCCESS;
}
/* per-BTS configuration */
DEFUN(cfg_bts,
cfg_bts_cmd,
@ -1155,6 +1168,7 @@ int bsc_vty_init(struct gsm_network *net)
install_element(GSMNET_NODE, &cfg_net_name_short_cmd);
install_element(GSMNET_NODE, &cfg_net_name_long_cmd);
install_element(GSMNET_NODE, &cfg_net_auth_policy_cmd);
install_element(GSMNET_NODE, &cfg_net_encryption_cmd);
install_element(GSMNET_NODE, &cfg_bts_cmd);
install_node(&bts_node, config_write_bts);