aboutsummaryrefslogtreecommitdiffstats
path: root/src/gb
AgeCommit message (Collapse)AuthorFilesLines
2020-11-24ns2: move link layer type into NSEAlexander Couzens6-29/+20
Even it was in theory possible to mix NS-VC ll types within a NSE. This is an unrealistic configuration. Further more to select the correct load sharing mechanism the NSE must know the correct link layer. Change-Id: I18dfd40a2429cd61b7c4a3dad5f226c64296f7d8
2020-11-24ns2: move LL into public apiAlexander Couzens5-37/+29
Also fix prefix. GPRS_NS -> GPRS_NS2. In preparation to move LL into upper layer. Change-Id: I3b5e0d51ce69b095095e5160ca0cf0d4534db1b8
2020-11-24ns2: permit multiple nsvci in one nse in VTYHarald Welte1-44/+54
Change-Id: I4ad454320d0a03e81b399f55e8bd0ee57402dad0
2020-11-24ns2: implement link sharing selectorAlexander Couzens2-14/+136
Change-Id: I212fa1a65e8c16cf1e525d1962d5689446c7e49e
2020-11-24ns2: add support for frame relayAlexander Couzens7-23/+1656
Add support for frame relay over dahdi hdlc device. It's supporting lmi by q933 and supports both SGSN and BSS. Change-Id: Id3b49f93d33c271f77cd9c9db03cde6b727a4d30
2020-11-20ns2: Add a VTY command to reset NSVC FSMDaniel Willmann1-0/+33
Mainly useful for testing so implemented as a hidden command Change-Id: I83b9cd7381c25da0e8aa847038a2d422c8dd63cf Related: SYS#5002
2020-11-20ns2: Add a function to set the NSVC FSM back to unconfiguredDaniel Willmann2-17/+40
The function gprs_ns2_vs_force_unconfigured() resets the NSVC state back to the initial value when it was first started. This can be useful for testing. Related: SYS#5002 Change-Id: If96d56b19959372af4eba009661be19e985b4d51
2020-11-20ns2: Split 'initiater' into initiate_{reset,block}Daniel Willmann1-21/+28
Related: SYS#5002 Change-Id: Iff5aff0cf8d19d9c718dd11c4e731ced2aeb16ba
2020-11-20ns2: check if ns_vc_alloc() fails in bind_connect()Alexander Couzens1-0/+3
Change-Id: I82c984b9808451a72a62ff03b0495a1d09473e1c
2020-11-09ns2: fixup gprs_ns2_prim_strsAlexander Couzens1-1/+1
The gprs_ns2_prim_strs was merged to early. The renaming in the last gerrit patchset wasn't done correct. Change-Id: Ie8e1e003d70af48f2d647b2c2701d4fc0f17e307
2020-11-06ns2: Improve NSVC outputDaniel Willmann1-33/+1
In show ns lots of info was printed many times. We can just use gprs_ns2_ll_str() to get the information about an NSVC so use that and ensure newlines. The NSVC are still printed twice - at least for the UDP bind: Once in dump_nse and once in dump_bind. Change-Id: I6f734d92ec1e17f339f7b32e449ffd614efa7319 Related: SYS#4998
2020-11-06ns2: Send NSVC representation in NS_AFF_CAUSE_VC_* status indicationDaniel Willmann4-7/+16
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
2020-11-06ns2: Add gprs_ns2_nsvc_state_name() to get the current state of a VCDaniel Willmann2-0/+9
Change-Id: I4c4c5b9142d7240ed452218e263ba12e2b70d1a0 Related: SYS#4998
2020-11-03libosmocore: change the memory management of NS2Alexander Couzens3-16/+34
Until now NS2 always free'd it's own memory. Even when the msg was sent as primitive to the upper layer. Change the memory ownership when sending a primitive to the upper layer. The upper layer has to free the msg buffer. Merge together with: I180433735bfbb3375c41318d7a7709d5845199ba (osmo-pcu) Change-Id: Id844d7acbcab102a7dc472d608a5e97a748ecb43
2020-11-03libosmogb: Add a function to tx BVC RESET by nsei/bvciDaniel Willmann3-22/+39
This is needed for osmo-gbproxy where we need more control over BSSGP. Related: SYS#4998 Change-Id: Ifa769bce920a08cf93553dcb164a3fcf50162517
2020-10-27gprs_ns2: convert gprs_ns2_cause_str into an static inlineAlexander Couzens2-9/+2
Be consistent with other implementation of get_value_string() in libosomocore. Change-Id: Ic79757df8683e0461c04f7ef9279e4fe645eb821
2020-10-27ns2: add value strings for ns2_affecting_cause_prim_str & ns2_prim_strAlexander Couzens2-0/+19
Change-Id: Ibf610fbd929dddc4a4e235152447caff522d4eb2
2020-10-27gprs_ns2: remove the nsvc fsm timer when cleaning up the fsmAlexander Couzens1-1/+9
Change-Id: I9c7f767077ed2e354d0980a9f11246c1151c65e2
2020-10-27gb: ns2_sns: Add missing value_string entry for GPRS_SNS_EV_NO_NSVCPau Espin Pedrol1-0/+1
Change-Id: Ifd4501676217f1a27f3ee02156be4e3dcb847703
2020-10-27gb: ns2_sns: Fix missing trailing newline char in log linePau Espin Pedrol1-1/+1
Change-Id: I8dc45237a605e76e852a74a0de91ac2a812387d0
2020-10-12gprs_ns2: add gprs_ns2_ip_vc_equal()Alexander Couzens2-0/+35
Compare the NS-VC with the given parameter Change-Id: I3a0cd305fd73b3cb9ec70246ec15ac70b83e57f2
2020-10-12gprs_ns2: Partial revert 48f63867 allow to create NS_ALIVE NSVCAlexander Couzens1-15/+10
NS_ALIVE can't create new NS-VC. Those NS-VC can be only created by SNS or by vty. Also fixes a crash because the TLV parser tried to retrieve NSEI TLV which doesn't exist on NS_ALIVE PDUs. Related: OS#4792 Change-Id: I16b9d7b2eb7544a83ce871d894887c4b30605b34
2020-10-12gprs_ns2: add gprs_ns2_nse_foreach_nsvc()Alexander Couzens2-0/+23
Allow to loop over all NSVC within a NSE via a callback Change-Id: I5a2bb95d05d06d909347e2fb084a446ead888cb3
2020-10-12gprs_ns2: gprs_ns2_ip_vc_remote() the nsvc can be also constAlexander Couzens1-1/+1
Change-Id: Ia000f535f18f21b41038f2ce7721f0fb59f6a093
2020-10-12gprs_ns2: add gprs_ns2_nse_sns_remote() returns the initial SNS addressAlexander Couzens2-0/+16
Allows the PCU to get the SNS remote address. Change-Id: I54f110acc3acccb362f6e554324d08cc42b7c328
2020-10-12gprs_ns2: add gprs_ns2_ip_vc_local() return the local sockaddrAlexander Couzens2-0/+18
Change-Id: I65a739772596015b90473045d32d4934d924e43f
2020-10-12gprs_ns2: rename gprs_ns2_ip_vc_sockaddr -> gprs_ns2_ip_vc_remoteAlexander Couzens5-9/+9
It's more clear which part of the address is returned. In preparation to add a gprs_ns2_ip_vc_local. Change-Id: I6110ff573362961c713a990da7ef3f3dbedf6c57
2020-10-12gprs_ns2: const the return value of gprs_ns2_ip_vc_sockaddr / ↵Alexander Couzens4-10/+12
gprs_ns2_ip_bind_sockaddr The sockaddr should not be changed. free and create the bind/nsvc if the address should be changed. Change-Id: I371ac2361b569e36722b02fc9cd82ec8da2fa9e3
2020-10-12gprs_ns2: add gprs_ns2_free_nses() to free all NS-EAlexander Couzens2-6/+11
Allow users to clean up most of the state (e.g. the PCU). Change-Id: Ia00753a64b7622a0864341f51ea49b6963543755
2020-10-12gprs_ns2: add gprs_ns2_free_binds() to free all bindsAlexander Couzens2-4/+11
Allow users to clean up all binds (e.g. the PCU). Change-Id: Ic8f6f8aca10da23a18fab8870be7806065a34b47
2020-10-12gprs_ns2: add gprs_ns2_nse_nsei() to get the nsei of a nseAlexander Couzens2-0/+10
Change-Id: I5f67e6a9bf4cb322bd169061fee0a528012ed54d
2020-10-12gprs_ns2: gprs_ns2_ip_bind() check if the bind already existsAlexander Couzens1-1/+8
To prevent adding the same bind twice. It also returns the bind in **result. Change-Id: Ib816f14c387cc6ff86f9c0057daded1d72cee0f5
2020-10-12gprs_ns2: add gprs_ns2_ip_bind_by_sockaddr() to search for binds by sockaddrAlexander Couzens2-0/+27
Change-Id: I48c3f1a82574eee0a49e6941cf9e1365c2302d3b
2020-10-12gprs_ns2: fix empty prefix in TLV Parse errorAlexander Couzens1-4/+4
Those messages were printed without any prefix because LOGPC was used. LOGPC means continue a log line. This must happened while copying this part of code over from ns1 where has been a LOGP in this function. Related: OS#4792 Change-Id: I2672ea0e34d19ea6172cb3458b8ff98d9700b2d0
2020-10-12gprs_ns2: fix SNS_ADD for IPv4Alexander Couzens1-1/+1
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
2020-10-10gprs_ns2: gprs_ns2_free(): add missing talloc_freeAlexander Couzens1-0/+2
It clean up all the space except the nsi itself. Change-Id: Ia3fbe5d679d0af75b2b0db020f1eb082d629cf50
2020-10-09gprs_ns2: make struct osmo_sockaddr pointers constVadim Yanitskiy6-13/+16
Using the 'const' qualifier allows the compiler to spot some programming errors and further optimize the code. Change-Id: I0df6a00ac1830bd64a10b9336b827e113fa772bb
2020-10-09gprs_ns2: Fix parsing of SNS-{ADD,DEL,CHANGE_WEIGHT}Harald Welte1-2/+2
Change-Id: I94c12986f8255e4373b13b1a8fae3df08004ad96 Related: OS#4791
2020-10-09gprs_ns2_udp: Avoid dangling freed struct in list if binding failsPau Espin Pedrol1-2/+1
Change-Id: Ic54434b7cfc40136788257e768cae7a2b5d5bc79
2020-10-08bssgp: Don't include RA-ID in BVC-RESET for BVCI=0 (signalling)Harald Welte1-1/+10
3GPP TS 48.018 is quite clear: The RA-ID must only be included when a PTP-BVCI is being reset [and only if the sender is the BSS]. Before this patch, osmo-pcu is including the RA-ID in BVC-RESET for BVCI=0. Change-Id: Ie87820537d6d616da4fd4bbf73eab06e28fda5e1
2020-10-07gprs_ns2_vty_create: remove bind pointer checkAlexander Couzens1-10/+8
The bind pointer can't be NULL because gprs_ns2_ip_bind() is either return 0 and bind is valid or != 0 and returning. Found-by: Coverity Fixes: CID#214854 Change-Id: I11d86c9cb36226701e51942f14d7a6412c3eff26
2020-10-06vty: use install_lib_element() and install_lib_element_ve()Vadim Yanitskiy3-51/+51
See https://lists.osmocom.org/pipermail/openbsc/2020-October/013278.html. Change-Id: Ic541126ffd4975daf87199abfafb465e2055e44f Related: SYS#4937
2020-10-05ns2: vty: on `show ns` add information of NS bindsAlexander Couzens3-1/+44
Change-Id: I6cef42749555e577d5573f2ed8b8bce4cf842a98
2020-10-05ns2: vty: allow the users (pcu/sgsn) to set a default bindAlexander Couzens1-1/+9
The SGSN will always bind to 0.0.0.0 in difference the PCU bind is depending on the info indication. Allow to the user to define a default bind address. Change-Id: I2a9dcd14f4ad16211c0f6d98812ad4a13e910c2a
2020-10-03ns2: vty: show all nseAlexander Couzens1-1/+0
Don't stop after dumping the first nse Change-Id: I0ca1807692854b23b77ca9042768529df3f80289
2020-10-03ns2: status ind: add additional flags (first and persistent)Alexander Couzens2-0/+8
Both flags are required to allow the NS user to sent BVC RESET for persistent NSE. On persistent NSE with persistent NS alive configuration (no RESET/UNBLOCK/BLOCK) the PCU can't detect if the SGSN has restartet or crashed. Change-Id: Iaad7b53d44338e5dd81dc2202f23bdcb715af804
2020-10-03ns2: refactor ns2_prim_status_ind()Alexander Couzens3-16/+12
Replace parameters nsi + nsei with a single nse pointer. Change-Id: I35f6381110ba7ba1e013f21120e971362bdff55b
2020-10-01ns2: parse the return code of gprs_ns2_ip_bindAlexander Couzens1-2/+1
Fixes a crash when the bind fails. Change-Id: I96c8e871a350f8f7b9ba2450bb37b90b535f42e2
2020-09-26ns2: fix a msg leak when receiving REJECTED messagesAlexander Couzens2-4/+4
Change-Id: I7edc53c29c3dd09c395a275ceb8648b8eb19c06c
2020-09-25gprs_ns2: Make reason constDaniel Willmann1-2/+2
Change-Id: Ia0db18703d9fd137a5c5fe4474e2d76868a9af9d