nat: Rename ip-tos to ip-dscp and provide an alias...

This commit is contained in:
Holger Hans Peter Freyther
2010-07-27 19:21:53 +08:00
parent e731e1d6dd
commit 6b7710739a
3 changed files with 13 additions and 7 deletions

View File

@@ -241,7 +241,7 @@ struct bsc_nat {
/* known BSC's */
struct llist_head bsc_configs;
int num_bsc;
int bsc_ip_tos;
int bsc_ip_dscp;
/* MGCP config */
struct mgcp_config *mgcp_cfg;

View File

@@ -898,7 +898,7 @@ static int ipaccess_listen_bsc_cb(struct bsc_fd *bfd, unsigned int what)
LOGP(DNAT, LOGL_ERROR, "Failed to set TCP_NODELAY: %s\n", strerror(errno));
rc = setsockopt(fd, IPPROTO_IP, IP_TOS,
&nat->bsc_ip_tos, sizeof(nat->bsc_ip_tos));
&nat->bsc_ip_dscp, sizeof(nat->bsc_ip_dscp));
if (rc != 0)
LOGP(DNAT, LOGL_ERROR, "Failed to set IP_TOS: %s\n", strerror(errno));

View File

@@ -73,7 +73,7 @@ static int config_write_nat(struct vty *vty)
vty_out(vty, " timeout pong %d%s", _nat->pong_timeout, VTY_NEWLINE);
if (_nat->token)
vty_out(vty, " token %s%s", _nat->token, VTY_NEWLINE);
vty_out(vty, " ip-tos %d%s", _nat->bsc_ip_tos, VTY_NEWLINE);
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);
@@ -341,14 +341,19 @@ DEFUN(cfg_nat_token, cfg_nat_token_cmd,
return CMD_SUCCESS;
}
DEFUN(cfg_nat_bsc_ip_tos, cfg_nat_bsc_ip_tos_cmd,
"ip-tos <0-255>",
"Set the IP_TOS for the BSCs to use\n" "Set the IP_TOS attribute")
DEFUN(cfg_nat_bsc_ip_dscp, cfg_nat_bsc_ip_dscp_cmd,
"ip-dscp <0-255>",
"Set the IP DSCP for the BSCs to use\n" "Set the IP_TOS attribute")
{
_nat->bsc_ip_tos = atoi(argv[0]);
_nat->bsc_ip_dscp = atoi(argv[0]);
return CMD_SUCCESS;
}
ALIAS_DEPRECATED(cfg_nat_bsc_ip_dscp, cfg_nat_bsc_ip_tos_cmd,
"ip-tos <0-255>",
"Use ip-dscp in the future.\n" "Set the DSCP\n")
DEFUN(cfg_nat_acc_lst_name,
cfg_nat_acc_lst_name_cmd,
"access-list-name NAME",
@@ -569,6 +574,7 @@ int bsc_nat_vty_init(struct bsc_nat *nat)
install_element(NAT_NODE, &cfg_nat_ping_time_cmd);
install_element(NAT_NODE, &cfg_nat_pong_time_cmd);
install_element(NAT_NODE, &cfg_nat_token_cmd);
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);