jolly has uploaded this change for review.

View Change

Add DSCP configuration support for STP client

Introduce VTY command to configure the Differentiated Services Code
Point (DSCP) values for the STP clients.

Related: SYS#8071
Change-Id: Ia125a392eec5605553809774162675b5249b8494
---
M src/ss7_asp.c
M src/ss7_asp.h
M src/ss7_asp_vty.c
M src/ss7_vty.h
4 files changed, 19 insertions(+), 0 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/08/42808/1
diff --git a/src/ss7_asp.c b/src/ss7_asp.c
index c1739f3..5993db4 100644
--- a/src/ss7_asp.c
+++ b/src/ss7_asp.c
@@ -816,6 +816,7 @@
osmo_stream_cli_set_local_addrs(asp->client, (const char **)asp->cfg.local.host, asp->cfg.local.host_cnt);
osmo_stream_cli_set_local_port(asp->client, asp->cfg.local.port);
osmo_stream_cli_set_proto(asp->client, asp->cfg.trans_proto);
+ osmo_stream_cli_set_ip_dscp(asp->client, asp->cfg.ip_dscp);
osmo_stream_cli_set_reconnect_timeout(asp->client, 5);
osmo_stream_cli_set_connect_cb(asp->client, xua_cli_connect_cb);
osmo_stream_cli_set_disconnect_cb(asp->client, xua_cli_disconnect_cb);
diff --git a/src/ss7_asp.h b/src/ss7_asp.h
index a4e0e2f..b607046 100644
--- a/src/ss7_asp.h
+++ b/src/ss7_asp.h
@@ -138,6 +138,7 @@

struct osmo_ss7_asp_peer local;
struct osmo_ss7_asp_peer remote;
+ uint8_t ip_dscp;
uint8_t qos_class;
uint32_t quirks;

diff --git a/src/ss7_asp_vty.c b/src/ss7_asp_vty.c
index 89fb949..593c607 100644
--- a/src/ss7_asp_vty.c
+++ b/src/ss7_asp_vty.c
@@ -410,6 +410,17 @@
return CMD_SUCCESS;
}

+DEFUN_ATTR(asp_ip_dscps, asp_ip_dscp_cmd,
+ "ip-dscp " IP_DSCP_RANGE_STR,
+ "Specify IP DSCP of ASP\n"
+ IP_DSCP_RANGE_HELP_STR,
+ CMD_ATTR_NODE_EXIT)
+{
+ struct osmo_ss7_asp *asp = vty->index;
+ asp->cfg.ip_dscp = atoi(argv[0]);
+ return CMD_SUCCESS;
+}
+
DEFUN_ATTR(asp_qos_clas, asp_qos_class_cmd,
"qos-class " QOS_CLASS_RANGE_STR,
"Specify QoS Class of ASP\n"
@@ -1381,6 +1392,8 @@
vty_out(vty, " remote-ip %s%s%s", asp->cfg.remote.host[i],
asp->cfg.remote.idx_primary == i ? " primary" : "", VTY_NEWLINE);
}
+ if (asp->cfg.ip_dscp != 0)
+ vty_out(vty, " ip-dscp %u%s", asp->cfg.ip_dscp, VTY_NEWLINE);
if (asp->cfg.qos_class)
vty_out(vty, " qos-class %u%s", asp->cfg.qos_class, VTY_NEWLINE);
vty_out(vty, " role %s%s", osmo_str_tolower(get_value_string(osmo_ss7_asp_role_names, asp->cfg.role)),
@@ -1490,6 +1503,7 @@
install_lib_element(L_CS7_ASP_NODE, &asp_no_remote_ip_cmd);
install_lib_element(L_CS7_ASP_NODE, &asp_local_ip_cmd);
install_lib_element(L_CS7_ASP_NODE, &asp_no_local_ip_cmd);
+ install_lib_element(L_CS7_ASP_NODE, &asp_ip_dscp_cmd);
install_lib_element(L_CS7_ASP_NODE, &asp_qos_class_cmd);
install_lib_element(L_CS7_ASP_NODE, &asp_role_cmd);
install_lib_element(L_CS7_ASP_NODE, &asp_transport_role_cmd);
diff --git a/src/ss7_vty.h b/src/ss7_vty.h
index 18dc5a6..1d99cad 100644
--- a/src/ss7_vty.h
+++ b/src/ss7_vty.h
@@ -37,6 +37,9 @@
"SCTP (Stream Control Transmission Protocol)\n" \
"TCP (Transmission Control Protocol)\n"

+#define IP_DSCP_RANGE_STR "<0-63>"
+#define IP_DSCP_RANGE_HELP_STR "IP Differentiated Service Code Point\n"
+
#define QOS_CLASS_RANGE_STR "<0-7>"
#define QOS_CLASS_RANGE_HELP_STR "QoS Class\n"
#define QOS_CLASS_VAR_STR "(" QOS_CLASS_RANGE_STR "|default)"

To view, visit change 42808. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-MessageType: newchange
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: Ia125a392eec5605553809774162675b5249b8494
Gerrit-Change-Number: 42808
Gerrit-PatchSet: 1
Gerrit-Owner: jolly <andreas@eversberg.eu>