From c4704769237537478b2671225344aa64ad7bdb60 Mon Sep 17 00:00:00 2001 From: Alexander Couzens Date: Mon, 8 Feb 2021 23:13:12 +0100 Subject: 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 --- src/gb/gprs_ns2_udp.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'src/gb/gprs_ns2_udp.c') 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); +} -- cgit v1.2.3