Commit Graph

13 Commits

Author SHA1 Message Date
Pau Espin bd2b55679e ggsn: Log tun fd write errors
Change-Id: I5f681b5edcc4cf525629d2078ae0c0ffd7ebb72d
2021-06-01 12:00:21 +02:00
Pau Espin 1bf41e4f36 ggsn, sgsnemu: Drop use of no-op deprecated gtp_retrans* APIs
Related: OS#4178
Change-Id: I295b89ee493d230c2550d461fca9602c589d38b5
2019-09-05 09:59:52 +00:00
Pau Espin f5fbb419ef ggsn: Implement echo req/resp and recovery
This patch is quite big because implementing echo req/resp and recovery
requires having knowledge and managing differentiated state for each GSN
peer attached/connected to osmo-ggsn. This kind of information was not
available in osmo-ggsn nor in libgtp.

So osmo-ggsn is now able to track GSN peers connected to a
ggsn_ctx (associated gsn_t from libgtp) by means of "sgsn_peer" data
structure, and accessible from the ggsn through a list. The instances of
sgsn_peer are currently allocated and destroyed dynamically based on
discovered peer who have at least a pdp context attached to us (we are
not interested in peers without pdp contexts because we don't need to
send echo requests/responses and maintain state in that case).

A new private pointer (pdp_t->priv) data structure struct pdp_priv_t is
added to be able to relate a pdp_t to an sgsn as well as the already
existing pointer to an apn.

An "echo-interval <0-36000>" VTY command is added which allows
configuring time wait between echo requests being sent to each
sgsn_peer. Transmission of echo requests is disabled by default.

Finally, a new "show sgsn" VTY command is introduced, and its output is
also printed during "show ggsn".

Related: OS#4165
Change-Id: Id2c84165dc59dff495106758146a701ca488834f
2019-08-28 11:34:11 +02:00
Pau Espin 012d51ed7d Introduce LOGTUN log helper
Change-Id: I237acdee0be19498804e0d509c610f4e0454ba72
2019-08-28 11:14:57 +02:00
Pau Espin f612ffea82 Move pdp_get_peer_ipv() to lib/util.*
Preparation for next commit, where this function will be needed inside
libmisc (lib/*).

Change-Id: Ibab4f6c09d1e5f0e9cfaea28ae1e7ab5b5c219b5
2019-08-28 11:14:57 +02:00
Pau Espin 421f22e8cf ggsn: Split application lifecycle related code into ggsn_main.c
This way we further shrink ggsn.c and leave there GGSN related code.

Change-Id: I9e6a3beac7657f0a8c02d514b54c6f1caa93bba7
2019-08-28 11:14:57 +02:00
Pau Espin f7884e880e ggsn: Move PCO handling code into its own file
This way ggsn.c is shrinked in size and get rid of a lot of code there,
which is of no interest unless the reader is interested in that really
specific part.

Change-Id: Ieaa7e71f17c7fd9377c76ef53362eab596d669a6
2019-08-28 11:13:46 +02:00
Pau Espin 72ab4bc547 ggsn: Drop unused param force in apn_stop()
Change-Id: I920679c7062d480c1cfaa3d89c90a0ed4a2ef58b
2019-05-29 19:09:02 +02:00
Pau Espin 37c45e3998 ggsn: Add 'ipv6 link-local' vty cmd
This vty cmd let's you set up a new link-local IP for a specific APN to
be used during ICMPv6 Router Advertisement procedure.

osmo-ggsn hence requires a link-local IPv6 address to be added to the
tun interface, otherwise the apn will not be configured correctly and it
won't be able to allocate addresses from the ipv6 pool later on.

This feature is useful in case your OS doesn't support autoconfiguring
link-local IPs when the interface is brought up (some linux versions are
known to fail at this) or in case you configured your OS specifically to
avoid automatic set up (sysctl net.ipv6.conf.*.autoconf).

If "no ipv6 link-local" is provided (default), osmo-ggsn will rely on the
OS or the ipup-script setting up the link-local IP for the tun
interface at creation time, then fetching it after ipup-script time and
using the first link-local ip found. On the other hand, if the "ipv6
link-local" cmd is provided, osmo-ggsn will add the link-local IP to the
interface manually and use that one for later Router Advertisement
procedures.

Change-Id: I09ef27f54940d4c47150e5f9016d1cd4298c16b5
2017-12-14 16:01:35 +00:00
Harald Welte 93fed3bc51 ggsn: Add per-APN VTY configuration option on G-PDU sequence numbers
This per-APN vty option determines if we are transmitting GTP sequence
numbers in downlink G-PDU messages.  This behavior is optional as per
GTP spec.  The default behavior is "true", like before this change.

Related: OS#2519
Change-Id: Ibf0de261f83951309b01b4feae998b6656c77664
2017-09-24 23:10:01 +08:00
Harald Welte f85fe9720b ICMPv6: Send router advertisement from own link-local address
I'm not quite sure how I ended up doing this, but for some strange
reason the code before this commit is sending the ICMPv6 Router
Advertisements from some weird non-standard source address.  This is
a violation of RFC4861 which clearly states that the source address
of router advertisements "MUST be the link-local address assigned to the
interface from which this message is sent."

Change-Id: Ib444af70fc8f0b433d371281601fd5a37b29039e
2017-09-24 20:51:47 +08:00
Harald Welte 98146776dd ggsn: Add ability to specify local IP addresses for GTP-C and GTP-U
In case the GGSN is behind some kind of DNAT, the public GTP-C and
GTP-U IP addresses as exposed inside the GTP payload information
elements are different from the (internal, behind-nat) IP address
to which it listens/binds.

Change-Id: I548c9011c9abd66d46f963b1def61575f3dabb89
2017-09-06 12:22:31 +02:00
Harald Welte dda21ed7d4 Introduce a VTY, factually turning OpenGGSN into an Osmocom program
Change-Id: I9613ca3436e77ea132c47f0096df7c5050d7e826
2017-09-06 09:17:11 +02:00