aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2010-07-27 19:21:53 +0800
committerHolger Hans Peter Freyther <zecke@selfish.org>2010-07-27 19:21:53 +0800
commit6b7710739a345cc38935124b7097b4ad594b57bb (patch)
treeef41d89b9bc02d99a03b030b8e9252789760926c
parente731e1d6dd4a8371ca2d9f8142b9afaeedd012a4 (diff)
nat: Rename ip-tos to ip-dscp and provide an alias...
-rw-r--r--openbsc/include/openbsc/bsc_nat.h2
-rw-r--r--openbsc/src/nat/bsc_nat.c2
-rw-r--r--openbsc/src/nat/bsc_nat_vty.c16
3 files changed, 13 insertions, 7 deletions
diff --git a/openbsc/include/openbsc/bsc_nat.h b/openbsc/include/openbsc/bsc_nat.h
index b628ed058..32628d674 100644
--- a/openbsc/include/openbsc/bsc_nat.h
+++ b/openbsc/include/openbsc/bsc_nat.h
@@ -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;
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);