Commit Graph

26 Commits

Author SHA1 Message Date
Pau Espin f44dfa8a0e Rename bscconfig.h -> config.h
Change-Id: I007103be34c1aaab7a9375c44b226d4590fe5b24
2023-01-11 12:51:38 +01:00
Pau Espin e659f75cf1 Keep sgsn subsystems under struct sgsn_instance lifecycle
Rework initialization and destruction of several sgsn subsystems to be
allocated & released together with the struct sgsn_instance.

This makes it easier to destroy and recreate the entire context and
allows us to start moving global variables scattered around to be under
struct sgsn_instance.

Change-Id: Idf60519b8e475b94d38bbb69e737132a5afaefab
2023-01-05 17:23:43 +01:00
Pau Espin 920c6c8c81 Introduce new header file sgsn/gtp.h
It will be used to store all stuff relatd to libgtp use and GTP
protocol, similar to what we already do for other protocols.

Change-Id: I4aae35cd0ea401856cd822cb507d668350d07a89
2023-01-05 14:15:52 +01:00
Pau Espin df203361e8 Move gprs_sndcp_vty_init() declaration to gprs_sndcp.h
Change-Id: Iea9692e7ef9bd017d89ef654d2f2ae5b30cc4550
2023-01-05 14:15:52 +01:00
Pau Espin b61ab9b9ac gprs_subscriber: Move API declarations to correct header
Change-Id: Iaa1032c38fa54ad57c472d9120cfbb34b2ae90e9
2023-01-05 14:15:50 +01:00
Pau Espin 4398ac073b Rename gprs_gb.[c,h] -> gprs_ns.[c,h]
All remaining code in that file is NS protocol related, hence let's
rename it so that we end up with one file per protocol in the Gb stack.

Change-Id: I8312c8a70d60cab48764950c5b57ca02964e9db2
2022-12-28 23:14:20 +01:00
Pau Espin 7a74ae492e Create new specific file for BSSGP code
Right now there's no much code there since the related code is totally
entangled with the LLC one.
This will eventually change in the future when we switch to use
libosmo-gprs.
Hence, this commit is a preparation to have already some place to put
new BSSGP specific code in the future.

Change-Id: I816396ab5ccb86032bbc21b41a959934a7768780
2022-12-28 23:11:49 +01:00
Max e7ccfdb4aa ctrl: take both address and port from vty config
Change-Id: Ie1330b152a2e5cdcdb80a1c958e7c1d784b78eab
2022-12-17 21:16:58 +03:00
Pau Espin e5c8998f9c Support forwarding RIM messages over GTPCv1 EUTRAN<->GERAN
MMEs connect over Gn interface using GTPCv1 towards the SGSN in order to
exchange RIM PDUs by using "RAN Information Relay" GTPCv1 message type.
For more info, see 3GPP TS 29.060 sec 7.5.14.1 "RAN Information Relay"

In order to support it, this commit does the following:

* Uses new libgtp APIs to rx and tx RAN Information Relay messages. The
  same "gsn" object is reused, ie. the local GTPCv1 socket address used
  for exchanging messages against GGSN is reused.
* Adds a new "sgsn_mme_ctx" struct holding information about MMEs
  allowed by the SGSN, each one containing information about the GTP
  address it uses, the in/out routing based on TAI requests, etc. The
  set of MMEs and their config can be set up using new VTY node introduced
  in this commit.
* The RIM related code in SGSN is refactored to allow forwarding from
  and to several types of addresses/interfaces.

Depends: osmo-ggsn.git Change-Id Iea3eb032ccd4aed5187baca7f7719349d76039d4
Depends: libosmocore.git Change-Id I534db7d8bc5ceb19a2a6866f07d5f5c70e456c5c
Related: SYS#5314
Change-Id: I396450b8d8b66595dab8ff7bf41cbf964bb40d93
2021-05-19 11:45:05 +02:00
Vadim Yanitskiy 8de4be261d main: resurrect removed 'ns' logging category as deprecated
This logging category has been removed completely in [1], and now
osmo-sgsn fails to start with old configuration files:

  There is no such command.
  Error occurred during reading the below line:
   logging level ns info

Let's accept it and print a deprecation warning.

Change-Id: I2036170af41db89484c299e18e0b703c97427dc1
Fixes: [1] Ia4723ab344ad6a1927029a2d5d0dda020266b39d
2021-03-14 20:59:08 +01:00
Harald Welte adcf97d095 Remove bogus DNS log category
When we switched to the libosmogb NS2 implementation, we should have
removed the DNS category, as NS2 uses DLNS internally and hence DNS
is unused.

Change-Id: Ia4723ab344ad6a1927029a2d5d0dda020266b39d
Closes: OS#5058
2021-03-10 12:30:05 +00:00
Harald Welte ebd39830cb main: change initialization order
We must have initialized e.g. the NS protocol stack before calling
handle_options(), as that might want to dumpy the VTY XML, and it
can obviously only dump those nodes that are registered at that
point.

Change-Id: Icd1b8fb3f466cdace67ff0d4f7c85183d8266c41
2021-02-23 16:43:37 +01:00
Harald Welte 999a776b70 main: add --vty-ref-mode, use vty_dump_xml_ref_mode()
Change-Id: I893fc869d5900eff8395bfded0c2fa3883c5a1e7
Depends: Ie2022a7f9e167e5ceacf15350c037dd43768ff40
Related: SYS#5359
2021-02-23 15:52:54 +01:00
Philipp Maier 2ce050ba46 sgsn_rim: Add routing for (GERAN) BSSGP RIM messages
The SGSN currently does not forward BSSGP RIM messages.

Related: SYS#5103
Depends: libosmocore Icd667f41d5735de56cd9fb257670337c679dd258
Change-Id: I6fde8ab8955660b48000ca1b650cfc7c7b2e24ba
2021-01-28 23:20:31 +01:00
Alexander Couzens 43e5f8a2c6 follow libosmocore/gprs_ns2 API changes (gprs_ns2_dynamic_create_nse)
The call gprs_ns2_dynamic_create_nse has been removed because it
was a workaround for the old/dropped vty api.

Depends-on: Ie924ead6da17657f3da334068c8ada82c8845495 (libosmocore)
Change-Id: Ie636cfd18d6d43da0e42f2c2de68dfa5c571d55c
2021-01-28 21:19:59 +00:00
Alexander Couzens caf73b803c sgsn: migrate to the new gprs_ns2_vty configuration
Change the whole vty configuration for NS to be more flexible
and support more setups. Old configurations are invalid.

API change which must be synchronized with libosmocore

For further information see:
https://osmocom.org/projects/libosmocore/wiki/Network_service_(NS)

Depends-on: I8c3f2afecc74b78f7f914f7dce166cbcb63444eb (libosmocore)
Change-Id: Ie9306ab4d4738c2c57a69987086e22771b30657e
2021-01-28 21:19:59 +00:00
Alexander Couzens f23e2db752 sgsn: Use the new NS2 api
The new NS2 api supports NSE with multiple NS-VC and contains a NS-VC
fsm. FR/GRE support is not working.
The configuration is compatible except for FR/GRE.

Relates: OS#4629
Depends-on: Iaad7b53d44338e5dd81dc2202f23bdcb715af804 (libosmocore)
Depends-on: I6cef42749555e577d5573f2ed8b8bce4cf842a98 (libosmocore)
Change-Id: I92a3bcaf166b091a22d74c7c1586964d33d7cc9d
2021-01-04 16:06:13 +00:00
Harald Welte 453a51d1a1 migrate to DLBSSGP as log sub-system for BSSGP
Change-Id: I69ee10b6fad1da2053cf6f3ae99d3ecf62a144ce
Depends: libosmocore.git Change-Id I506190aae9217c0956e4b5764d1a0c0772268e93
2020-12-10 15:42:15 +01:00
Pau Espin bcd7709452 sgsn: generate coredump and exit upon SIGABRT received
Previous code relied on abort() switching sigaction to SIG_FDL +
retriggering SIGABRT in case the signal handler returns, which would
then generate the coredump + terminate the process.
However, if a SIGABRT is received from somewhere else (kill -SIGABRT),
then the process would print the talloc report and continue running,
which is not desired.

Change-Id: I65f70a53b6982bff9ea4bd6ff786d8a2f8181eac
Fixes: OS#4865
2020-11-25 18:28:55 +01:00
Daniel Willmann 62fa6198ae Let libosmocore handle VTY parent node tracking
* is_config_node is deprecated, so don't set it
* go_parent_cb is only used if we want to do special stuff upon exiting
  a node, in osmo-sgsn and gtphub only osmo_ss7_vty_go_parent() needs to
  be called

Change-Id: I2008dd9026922d29ee703c59e70d3fecced0ee18
2020-11-06 22:21:21 +01:00
Pau Espin e6c5b4a970 Change default SCTP conn NULL->127.0.0.1 to localhost->localhost
"127.0.0.1" is changed to "localhost" to let local NSS decide whether to
use IPv4 or IPv6. In newish systems, IPv6 ::1 will be selected since
IPv6 takes precedence over IPv4.

Similarly, the default source addr needs to be changed from NULL to "localhost"
since for some yet unknwon reason, getaddrinfo(AF_UNSPEC, NULL) returns
first IPv4 "0.0.0.0" and later "::", which is inconsistent with
getaddrinfo("localhost") result, resulting in src=IPv4(0.0.0.0) and
dst=IPv6(::1), which is incompatible and will fail. In any case, since
the default remote address is a local one and it's the client side,
there's no real logical change since the kernel would anyway should have
taken a local address anyway.

Change-Id: I2f599e1aa449d44136ef20ba5f516ca9b61f3223
2020-08-21 18:07:11 +02:00
Pau Espin aae7daff81 Support setting rt-prio and cpu-affinity mask through VTY
Change-Id: I1af1b154d14de6d6d6fba08f15f167f4b2ed9aa2
Depends: libosmocore.git Change-Id If76a4bd2cc7b3c7adf5d84790a944d78be70e10a
Depends: osmo-gsm-masnuals.git Change-Id Icd75769ef630c3fa985fc5e2154d5521689cdd3c
Related: SYS#4986
2020-08-18 13:50:00 +02:00
Harald Welte 9d16b14345 Send a BVC-RESET to all persistent Gb interfaces at start-up
3GPP TS 48.018 Section 8.4:

> After any failure affecting the NSE, the party (BSS or SGSN) where
> the failure resided shall reset the signalling BVC. After sending or
> receiving a BVC-RESET PDU for the signalling BVC, the BSS shall stop all
> traffic and initiate the BVC-RESET procedure for all BVCs corresponding
> to PTP functional entities of the underlying network service entity. The
> BSS must complete the BVC-RESET procedure for signalling BVC before
> starting PTP BVC-RESET procedures.

TODO: We should not just trigger a single outbound BVC-RESET message,
but we should re-transmit them until we get a response.   This would
likely entail adding FSMs to libosmogb, which we will leave for a later
point - it's anticipated that the NS + BSSGP code is undergoing quite
some changes in the coming months anyway, so leave it for then.

Change-Id: I0b46035b40709c38bb9ab9493c11031a577e3ee0
Closes: OS#4629
Depends: libosmocore.git I353adc1aa72377f7d4b3336d2ff47791fb73d62c
2020-07-27 14:43:36 +00:00
Harald Welte de67c001b7 exit(2) on unsupported positional arguments on command line
Change-Id: I4f2d70d0b0f1b7bdb8604c930aba8fbb53d8bd54
2019-12-03 22:28:19 +01:00
Harald Welte 61557f42c1 check for osmo_ss7_init() error return value
Change-Id: Ic228273aa6fb197b78c70c467a4a99af317e8098
2019-12-01 12:43:17 +00:00
Pau Espin 762c39ccc6 Move out sgsn to its own subdir
Change-Id: I16fccc0eadf588599b9e5578d0f4dbaf9df81737
2019-09-02 14:03:04 +02:00