aboutsummaryrefslogtreecommitdiffstats
path: root/src/gb/gprs_ns2_udp.c
diff options
context:
space:
mode:
authorAlexander Couzens <lynxis@fe80.eu>2021-02-08 23:13:12 +0100
committerAlexander Couzens <lynxis@fe80.eu>2021-02-12 03:34:32 +0100
commitc4704769237537478b2671225344aa64ad7bdb60 (patch)
treeaa6f951406bfa900fce0135cbab7beb4e4b28c62 /src/gb/gprs_ns2_udp.c
parent855155c6ae9d4452b4cddc6ac711c2946d7b5377 (diff)
gprs_ns2: add signalling & data weights for UDP binds
Allow to assign a signalling and data weight to UDP binds. Those weights will be used when doing dynamic configuration over IP-SNS. This is only the first part which only uses the assigned weights when doing a new SNS configuration. The outgoing change weight procedure will be supported in a later patch when the SNS fsm supports outgoing procedures. Related: SYS#5354 Change-Id: I5133e4229377d44772a9af28628a2bc420fea34b
Diffstat (limited to 'src/gb/gprs_ns2_udp.c')
-rw-r--r--src/gb/gprs_ns2_udp.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gb/gprs_ns2_udp.c b/src/gb/gprs_ns2_udp.c
index e07f6d43..0f224583 100644
--- a/src/gb/gprs_ns2_udp.c
+++ b/src/gb/gprs_ns2_udp.c
@@ -104,6 +104,8 @@ static void dump_vty(const struct gprs_ns2_vc_bind *bind,
}
vty_out(vty, "UDP bind: %s:%d DSCP: %d%s", sockstr.ip, sockstr.port, priv->dscp, VTY_NEWLINE);
+ vty_out(vty, " IP-SNS signalling weight: %u data weight: %u%s",
+ bind->sns_sig_weight, bind->sns_data_weight, VTY_NEWLINE);
vty_out(vty, " %lu NS-VC: %s", nsvcs, VTY_NEWLINE);
llist_for_each_entry(nsvc, &bind->nsvc, blist) {
@@ -567,3 +569,16 @@ struct gprs_ns2_vc_bind *ns2_ip_get_bind_by_index(struct gprs_ns2_inst *nsi,
return NULL;
}
+
+/*! set the signalling and data weight for this bind
+ * \param[in] bind
+ * \param[in] signalling the signalling weight
+ * \param[in] data the data weight
+ */
+void gprs_ns2_ip_bind_set_sns_weight(struct gprs_ns2_vc_bind *bind, uint8_t signalling, uint8_t data)
+{
+ OSMO_ASSERT(gprs_ns2_is_ip_bind(bind));
+ bind->sns_sig_weight = signalling;
+ bind->sns_data_weight = data;
+ ns2_sns_update_weights(bind);
+}