laforge submitted this change.
Add DSCP configuration support for server transport role
Introduce VTY command to configure the Differentiated Services Code
Point (DSCP) values for transport "role" server.
The configured DSCP value is applied to the listener socket. Incoming
socket connections will then automatically inherit these DSCP settings
from the listener socket.
It is not (yet) possible to configure DSCP values for individual active
server connections. The setting applies globally via the listener.
A later patch will allow DSCP configuration of each individual ASP.
Related: SYS#8071
Depends: libosmo-netif.git Change-Id Ic70422ec73c753b61843444582f8665ca42e7a6d
Change-Id: I35eab3672157c318616f51ee3042243aed263d4e
---
M TODO-RELEASE
M src/ss7_vty.h
M src/ss7_xua_srv.c
M src/ss7_xua_srv.h
M src/ss7_xua_srv_vty.c
5 files changed, 46 insertions(+), 0 deletions(-)
diff --git a/TODO-RELEASE b/TODO-RELEASE
index ef38361..7c51822 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -8,3 +8,4 @@
# If any interfaces have been removed or changed since the last public release: c:r:0.
#library what description / commit summary line
libosmo-asn1-tcap >0.2.1 osmo_asn1_tcap_TCMessage_decode()
+libosmo-netif >1.7.0 Stream-Server: Also apply DSCP settings on listening socket
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)"
diff --git a/src/ss7_xua_srv.c b/src/ss7_xua_srv.c
index c080f63..96a20bc 100644
--- a/src/ss7_xua_srv.c
+++ b/src/ss7_xua_srv.c
@@ -402,6 +402,15 @@
return false;
}
+bool ss7_xua_server_set_ip_dscp(struct osmo_xua_server *xs)
+{
+ if (!xs->server)
+ return false;
+ if (xs->cfg.ip_dscp != 0)
+ osmo_stream_srv_link_set_ip_dscp(xs->server, xs->cfg.ip_dscp);
+ return true;
+}
+
void ss7_xua_server_destroy(struct osmo_xua_server *xs)
{
struct osmo_ss7_asp *asp, *asp2;
diff --git a/src/ss7_xua_srv.h b/src/ss7_xua_srv.h
index 1eaf754..7eb00c2 100644
--- a/src/ss7_xua_srv.h
+++ b/src/ss7_xua_srv.h
@@ -27,6 +27,7 @@
struct {
bool accept_dyn_reg;
struct osmo_ss7_asp_peer local;
+ uint8_t ip_dscp;
enum osmo_ss7_asp_protocol proto;
struct {
bool num_ostreams_present;
@@ -70,6 +71,7 @@
ss7_xua_server_set_local_hosts(struct osmo_xua_server *xs, const char **local_hosts, size_t local_host_cnt);
int ss7_xua_server_add_local_host(struct osmo_xua_server *xs, const char *local_host);
int ss7_xua_server_del_local_host(struct osmo_xua_server *xs, const char *local_host);
+bool ss7_xua_server_set_ip_dscp(struct osmo_xua_server *oxs);
void ss7_xua_server_destroy(struct osmo_xua_server *xs);
bool ss7_xua_server_set_default_local_hosts(struct osmo_xua_server *oxs);
diff --git a/src/ss7_xua_srv_vty.c b/src/ss7_xua_srv_vty.c
index 3a5e4ae..5ee395b 100644
--- a/src/ss7_xua_srv_vty.c
+++ b/src/ss7_xua_srv_vty.c
@@ -148,6 +148,33 @@
return CMD_SUCCESS;
}
+DEFUN_ATTR(xua_init_ip_dscp, xua_init_ip_dscp_cmd,
+ "init-ip-dscp " IP_DSCP_RANGE_STR,
+ "Specify IP DSCP of Listener\n"
+ IP_DSCP_RANGE_HELP_STR,
+ CMD_ATTR_IMMEDIATE)
+{
+ struct osmo_xua_server *xs = vty->index;
+
+ xs->cfg.ip_dscp = atoi(argv[0]);
+ ss7_xua_server_set_ip_dscp(xs);
+
+ return CMD_SUCCESS;
+}
+
+DEFUN_ATTR(xua_no_init_ip_dscp, xua_no_init_ip_dscp_cmd,
+ "no init-ip-dscp",
+ NO_STR "Specify IP DSCP of Listener\n",
+ CMD_ATTR_IMMEDIATE)
+{
+ struct osmo_xua_server *xs = vty->index;
+
+ xs->cfg.ip_dscp = 0;
+ ss7_xua_server_set_ip_dscp(xs);
+
+ return CMD_SUCCESS;
+}
+
DEFUN_ATTR(xua_accept_dyn_asp, xua_accept_dyn_asp_cmd,
"accept-asp-connections (pre-configured|dynamic-permitted)",
"Define what kind of ASP connections to accept\n"
@@ -225,6 +252,8 @@
if (xs->cfg.local.host[i])
vty_out(vty, " local-ip %s%s", xs->cfg.local.host[i], VTY_NEWLINE);
}
+ if (xs->cfg.ip_dscp)
+ vty_out(vty, " init-ip-dscp %u%s", xs->cfg.ip_dscp, VTY_NEWLINE);
if (xs->cfg.accept_dyn_reg)
vty_out(vty, " accept-asp-connections dynamic-permitted%s", VTY_NEWLINE);
if (xs->cfg.sctp_init.num_ostreams_present)
@@ -341,6 +370,8 @@
install_lib_element(L_CS7_NODE, &no_cs7_xua_cmd);
install_lib_element(L_CS7_XUA_NODE, &xua_local_ip_cmd);
install_lib_element(L_CS7_XUA_NODE, &xua_no_local_ip_cmd);
+ install_lib_element(L_CS7_XUA_NODE, &xua_init_ip_dscp_cmd);
+ install_lib_element(L_CS7_XUA_NODE, &xua_no_init_ip_dscp_cmd);
install_lib_element(L_CS7_XUA_NODE, &xua_accept_dyn_asp_cmd);
install_lib_element(L_CS7_XUA_NODE, &xua_sctp_param_init_cmd);
install_lib_element(L_CS7_XUA_NODE, &xua_no_sctp_param_init_cmd);
To view, visit change 42807. To unsubscribe, or for help writing mail filters, visit settings.