The IP-SNS requires at least one initial remote address of the SGSN.
However it should be multiple initial remote address instead of a single
in case the interface might fail.
Rework the SNS to support multiple initial remote addresses.
Change-Id: I71cdbfb53e361e6112fed5e2712236d797ef3ab2
The wrong argument was used to multiply by 4. However it was still
compliant because the SNS code would always supports 16 NSVCs.
Use the correct multiplier.
Fixes: ttnc3 pcu sns test cases
Fixes: 42ad549152 ("gprs_ns2_sns: dynamic calculate the maximum NS-VCs")
Change-Id: I58d706c6fffb4237b90b37cade4dc00c6aba6ac9
The event GPRS_SNS_EV_NO_NSVC was never dispatched because the
S() was missing to convert it into a bitmask.
Change-Id: I4af01293ff0ba8629e1426b1ba92f72f0520c7f0
The previous hard-coded value could be not enough if the user configures
too many local binds. Allow at least 8 NS-VCs. In case the user
configures too many binds (> 2) increase the maximum NS-VCs to allow
the SGSN to have 4 redundant connections.
Change-Id: Iae859dc504716fd6f705e72db5fc293b4b3298e7
The SNS FSM can go into the SIZE state when all NS-VC are failing.
This is the case if the network connection to the SGSN got interrupted.
Change-Id: I7e7da9451458505c1c2d73836dd916aee7704fda
NS_AFF_CAUSE_VC_* failure and recovery should indicate the NSVC in
question. Use the string representation reported by gprs_ns2_ll_str()
for that.
NS_AFF_CAUSE_VC_RECOVERY was never sent so do that on unblock as well.
Change-Id: Iad6f0dc4565a46868cbbe17c361dcd473006c83d
Related: SYS#4998
It's more clear which part of the address is returned.
In preparation to add a gprs_ns2_ip_vc_local.
Change-Id: I6110ff573362961c713a990da7ef3f3dbedf6c57
The sockaddr should not be changed.
free and create the bind/nsvc if the address should be changed.
Change-Id: I371ac2361b569e36722b02fc9cd82ec8da2fa9e3
The remote must be initialized because the osmo_sockaddr_cmp is using a memcmp() and might fail
on spare bytes in the struct. The same was already done for IPv6.
Related: OS#4792
Change-Id: Iefeef969bb2b5ae4d5db6a6358293ef9eeda858a
Using the 'const' qualifier allows the compiler to spot some
programming errors and further optimize the code.
Change-Id: I0df6a00ac1830bd64a10b9336b827e113fa772bb
gprs_ns2_nsvc_by_sockaddr_nsei is doing the lookup within a NSE.
gprs_ns2_nsvc_by_sockaddr_bind is doing the lookup within a bind.
Make both function look similiar and take similiar arguments.
Change-Id: Ia499fc279013668abe7348e578a0768f7d16faf9
I was reading through the code and noticed many functions not
documented yet, or with incomplete documentation. Change that.
Change-Id: I85a2419604a9fd9ff3c4828a7463e222652f77bf
[ 198s] for (unsigned i = 0; i < gss->num_ip6_remote; i++) {
[ 198s] ^
[ 198s] gprs_ns2_sns.c: In function 'ns2_sns_st_configured_change':
[ 198s] gprs_ns2_sns.c:1053:3: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
[ 198s] for (int i = 0; i < num_v4; i++) {
[ 198s] ^
[ 198s] gprs_ns2_sns.c:1067:3: error: 'for' loop initial declarations are only allowed in C99 or C11 mode
[ 198s] for (int i = 0; i < num_v6; i++) {
[ 198s] ^
[ 198s] Makefile:535: recipe for target 'gprs_ns2_sns.lo' failed
Change-Id: I4b7c576fcdf9d35f85e00ad076af7c48d5eb34a5