jolly has uploaded this change for review.

View Change

Add DSCP configuration support for STP server

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

Related: SYS#8071
Change-Id: I35eab3672157c318616f51ee3042243aed263d4e
---
M src/ss7_xua_srv.c
M src/ss7_xua_srv.h
M src/ss7_xua_srv_vty.c
3 files changed, 26 insertions(+), 0 deletions(-)

git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran refs/changes/07/42807/1
diff --git a/src/ss7_xua_srv.c b/src/ss7_xua_srv.c
index c080f63..5a1a3e7 100644
--- a/src/ss7_xua_srv.c
+++ b/src/ss7_xua_srv.c
@@ -402,6 +402,13 @@
return false;
}

+bool ss7_xua_server_set_ip_dscp(struct osmo_xua_server *xs)
+{
+ 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..a44e277 100644
--- a/src/ss7_xua_srv_vty.c
+++ b/src/ss7_xua_srv_vty.c
@@ -148,6 +148,20 @@
return CMD_SUCCESS;
}

+DEFUN_ATTR(xua_ip_dscp, xua_ip_dscp_cmd,
+ "ip-dscp " IP_DSCP_RANGE_STR,
+ "Specify IP DSCP of ASP\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_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 +239,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, " 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 +357,7 @@
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_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.

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