From 6b7710739a345cc38935124b7097b4ad594b57bb Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Tue, 27 Jul 2010 19:21:53 +0800 Subject: nat: Rename ip-tos to ip-dscp and provide an alias... --- openbsc/src/nat/bsc_nat.c | 2 +- openbsc/src/nat/bsc_nat_vty.c | 16 +++++++++++----- 2 files changed, 12 insertions(+), 6 deletions(-) (limited to 'openbsc/src') diff --git a/openbsc/src/nat/bsc_nat.c b/openbsc/src/nat/bsc_nat.c index 826f28819..538472ac2 100644 --- a/openbsc/src/nat/bsc_nat.c +++ b/openbsc/src/nat/bsc_nat.c @@ -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)); diff --git a/openbsc/src/nat/bsc_nat_vty.c b/openbsc/src/nat/bsc_nat_vty.c index 49ac3e2b4..03453609e 100644 --- a/openbsc/src/nat/bsc_nat_vty.c +++ b/openbsc/src/nat/bsc_nat_vty.c @@ -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); -- cgit v1.2.3