aboutsummaryrefslogtreecommitdiffstats
path: root/src/gb/gprs_ns2_sns.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_sns.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_sns.c')
-rw-r--r--src/gb/gprs_ns2_sns.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/gb/gprs_ns2_sns.c b/src/gb/gprs_ns2_sns.c
index 7b287542..d061eed2 100644
--- a/src/gb/gprs_ns2_sns.c
+++ b/src/gb/gprs_ns2_sns.c
@@ -796,8 +796,8 @@ static void ns2_sns_st_size_onenter(struct osmo_fsm_inst *fi, uint32_t old_state
}
ip4_elems->udp_port = sa->u.sin.sin_port;
- ip4_elems->sig_weight = 2;
- ip4_elems->data_weight = 1;
+ ip4_elems->sig_weight = bind->sns_sig_weight;
+ ip4_elems->data_weight = bind->sns_data_weight;
ip4_elems++;
}
@@ -835,8 +835,8 @@ static void ns2_sns_st_size_onenter(struct osmo_fsm_inst *fi, uint32_t old_state
}
ip6_elems->udp_port = sa->u.sin.sin_port;
- ip6_elems->sig_weight = 2;
- ip6_elems->data_weight = 1;
+ ip6_elems->sig_weight = bind->sns_sig_weight;
+ ip6_elems->data_weight = bind->sns_data_weight;
ip6_elems++;
}
@@ -1810,6 +1810,14 @@ void ns2_sns_notify_alive(struct gprs_ns2_nse *nse, struct gprs_ns2_vc *nsvc, bo
}
}
+/* Update SNS weights
+ * \param[in] nsvc the NSVC which should be updated
+ */
+void ns2_sns_update_weights(struct gprs_ns2_vc_bind *bind)
+{
+ /* TODO: implement weights after binds per sns implemented */
+}
+
/* initialize osmo_ctx on main tread */
static __attribute__((constructor)) void on_dso_load_ctx(void)
{