aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs
AgeCommit message (Collapse)AuthorFilesLines
2016-02-25enable ctrl bind config for various programsNeels Hofmeyr2-13/+23
Add ctrl_vty_init() calls and feed the ctrl_vty_get_bind_addr() return value to ctrl_interface_setup() in the following programs: osmo-bsc osmo-bsc_nat osmo-nitb osmo-sgsn For osmo-sgsn, move the control interface setup invocation below the config parsing, so that the ctrl_vty_get_bind_addr() can return the configured address.
2016-02-25enable telnet VTY bind address config for various programsNeels Hofmeyr3-10/+24
Following the 'line vty'/'bind A.B.C.D' command added in libosmocore, use the configured address to set the telnet bind for the VTY line. It is now possible to publish the VTY on a specific local interface (including 0.0.0.0 aka "any"). Implement in all of: osmo-gbproxy osmo-gtphub osmo-sgsn osmo-bsc osmo-bsc_nat osmo-bsc_mgcp osmo-nitb In some of these main programs, move the telnet initialization below the configuration parsing. Historically, this was not a good idea for programs using bsc_init.c (aka bsc_bootstrap_network()), since they expected a gsm_network struct pointer in ((struct telnet_connection*)vty->priv)->priv, so that telnet had to be either initialized or replaced by a dummy struct. In the meantime, the gsm_network struct is not actually looked up in a priv pointer but in the static bsc_vty.c scope (bsc_gsmnet), so this limitation is mere legacy (even though said legacy is still there in an "#if 0" chunk). In the other binaries I have briefly looked at the init sequence dependencies and found no reason to initialize telnet above the config file parsing. In any case, I have tested every single one of abovementioned binaries to verify that they still parse the example config successfully and launch, allowing VTY connections on the configured address(es). I hope this suffices. In all of the above, log VTY address and port. LOGL_INFO is disabled by default in some of the logging scopes, and since it is a single log message right at program launch, I decided for the slightly more aggressive LOGL_NOTICE.
2016-02-23gtphub: tweak default logging levelNeels Hofmeyr1-1/+1
2016-02-23gtphub: include ports.h instead of redefining OSMO_VTY_PORT_GTPHUBNeels Hofmeyr1-5/+1
2016-02-22sgsn: Re-add searching for MM ctx based on TLLI / P-TMSI matchesJacob Erlbeck2-3/+48
If an MM context cannot be found based on BBSGP info and a RA UPDATE REQUEST is received, try to find an MM context with an P-TMSI from which the TLLI could have been derived. This also checks, whether the routing area matches. This is similar to the old behaviour removed by the commits "sgsn: Only look at TLLIs in sgsn_mm_ctx_by_tlli" and "sgsn: Remove tlli_foreign2local", except that this will only be done for RA UPDATE REQUESTs now. Sponsored-by: On-Waves ehf
2016-02-22sgsn: Change handling of missing mmctx in gsm48_rx_gmm_ra_upd_reqJacob Erlbeck1-3/+15
Currently the MM context is just overwritten by a call to sgsn_mm_ctx_by_tlli(msgb_tlli(msg), &old_ra_id) even if it has already been found by using the BSSGP info. With the changes made to sgsn_mm_ctx_by_tlli this will never find a MM context if the routing area has changed. If the routing area has not changed, the mmctx has already been found if it exists. This commit splits searching for an MM context (if it hasn't been found already) from checking, whether a found one can really be used. The actual search is removed, so that the MS will be forced to restart the attach procedure, which is less efficient but safe. Sponsored-by: On-Waves ehf
2016-02-22sgsn: Only look at TLLIs in sgsn_mm_ctx_by_tlliJacob Erlbeck1-30/+1
Currently the code also matches the TLLI against LOCAL and FOREIGN mappings of the P-TMSI, thus eventually finding MM contexts not consistent with the TLLI (both tlli and tlli_new differ). On the other hand, tlli_new is not checked at all. This commit changes the function to only look at mmctx->tlli, mmctx->tlli_new, and the routing area. Sponsored-by: On-Waves ehf
2016-02-22sgsn: Make ra_id_equals available as gprs_ra_id_equalsJacob Erlbeck2-9/+9
The function is moved to gprs_utils.c, renamed, and made non-static to be usable in other modules, too. Sponsored-by: On-Waves ehf
2016-02-22sgsn: Remove tlli_foreign2localJacob Erlbeck1-23/+2
Currently foreign TLLI are sometimes mapped to local TLLI in the hope that they will match. This seems to sometimes introduce inconsisties, possibly leading to a failing assertion in _bssgp_tx_dl_ud. This mapping should probably reduce the allocation of additional LLME during routing area changes. This commit removes tlli_foreign2local. Sponsored-by: On-Waves ehf
2016-01-30gsm0408: Provide unique strings for the gsm 04.08 messageHolger Hans Peter Freyther2-20/+20
At Rhizomatica we see that some GSM 04.08 messages are leaked and have no other indication if that is Call Control, SMS or something else.
2016-01-26gprs: use libgtp cflagsAlexander Huemer1-1/+1
2016-01-23gtphub: Fix use after free on failureHolger Hans Peter Freyther1-1/+3
Even if fclose fails the stream is inaccessible and the second fclose might cause memory violation. Linux manpage says: Upon successful completion 0 is returned. Otherwise, EOF is returned and errno is set to indicate the error. In either case any further access (including another call to fclose()) to the stream results in undefined behavior. Fixes: CID#57958
2016-01-22gtphub: Make the two setter static as wellHolger Hans Peter Freyther1-2/+2
Same as with the previous gtphub commit. Make these static to deal with the new semantic of inline in gcc5.
2016-01-22gtphub: Fix compilation using gcc5Holger Hans Peter Freyther1-2/+2
The semantic of inline has changed and we need to make it static to not end up with undefined references.
2015-12-14gtphub VTY: add newlines to some VTY docs' final linesNeels Hofmeyr1-8/+8
2015-12-14gtphub VTY: fix doc strings for show cmdsNeels Hofmeyr1-7/+10
2015-12-08gtphub: log: limit length of hex dumps.Neels Hofmeyr2-4/+7
The debug log prints the received/sent bytes in hex. When this data surpasses the buffer size available for the log string (4096), the log is truncated and lacks a newline character. Limit the amount of dumped bytes to 1000. Sponsored-by: On-Waves ehi
2015-12-07gtphub: add VTY show for peers and peer stats.Neels Hofmeyr1-4/+119
Sponsored-by: On-Waves ehi
2015-12-07gtphub: improve handling of restarted peer.Neels Hofmeyr1-11/+12
Handle peer restart earlier, so that all the tunnels are deleted by the restart code path, instead of the first one being deleted due to reused TEI. That caused confusing logging messages. Also, when receiving Delete confirmations from the peer that didn't restart, don't complain about unknown peer, but acknowledge and remove the half invalidated tunnel. This means that the pending delete entry from the restart code path is not needed / not used, so don't bother to add pending delete entries upon peer restart. The test test_peer_restarted_reusing_tei() hits the situation where a tunnel is removed because of a reused TEI rather than the restart counter. Adjust the test to expect the "out-of-band" delete request earlier on, and to still see the half invalidated tunnel around. Enhance the test by adding the delete response from the peer that didn't restart, and add a final tunnels_are() verification. Sponsored-by: On-Waves ehi
2015-12-07gtphub: log most common message type names.Neels Hofmeyr1-14/+63
Sponsored-by: On-Waves ehi
2015-12-07gtphub: simplify/fix: one TEI mapping per tunnel.Neels Hofmeyr2-45/+41
Because the sender is known, one unique TEI per tunnel suffices to map the TEIs that the peers are sending to gtphub, instead of previously 4 (SGSN<->GGSN interaction on User and Ctrl plane, where each had an own unique TEI). Also, previously, a tunnel's endpoints should also have been checked against each other for TEI reuse, not only against the endpoints of other tunnels. This simplification fixes that problem for free. Thus simplify TEI reuse detection and improve VTY show readability and debugging. Adjust log and VTY output for tunnels. Adjust tests accordingly. Suggested-by: Holger Hans Peter Freyther <holger@moiji-mobile.com> Sponsored-by: On-Waves ehi
2015-12-07gtphub: fix: when checking TEIs, skip 0.Neels Hofmeyr1-1/+4
Sponsored-by: On-Waves ehi
2015-12-07gtphub: log: add TEI reuse msg, fix another TEI msg.Neels Hofmeyr1-2/+5
Sponsored-by: On-Waves ehi
2015-12-07gtphub: log: add side str to msg for reused TEINeels Hofmeyr1-1/+2
Sponsored-by: On-Waves ehi
2015-12-07gtphub: add more detailed I/O rate counters.Neels Hofmeyr2-16/+80
Count bytes and packets per peer port, as well es per tunnel enpoint, which adds two more levels of detail. Sponsored-by: On-Waves ehi
2015-12-07gtphub: be strict about unknown cmdline argsNeels Hofmeyr1-1/+2
Sponsored-by: On-Waves ehi
2015-12-07gtphub: tweak logging.Neels Hofmeyr2-16/+14
Less spaces in tunnel strings, adjust tests accordingly. Use side_idx to remove code dup in rate counter output. Sponsored-by: On-Waves ehi
2015-12-07gtphub: logging: have one newline per log.Neels Hofmeyr2-18/+12
Some logging was multiline to ease human reading of debug output. However, in the VTY output, these newlines lack a CR motion. Split multiline logs into separate lines. Also add one missing space. Sponsored-by: On-Waves ehi
2015-12-07gtphub: fix missing newline in log outputNeels Hofmeyr1-1/+1
Sponsored-by: On-Waves ehi
2015-12-03gtphub: tweak startup log for sgsn_use_senderNeels Hofmeyr1-0/+3
2015-12-03gtphub: implement sgsn_use_sender for NAT.Neels Hofmeyr2-2/+49
If an SGSN is behind NAT, we cannot rely on the default ports. Specifically, if a GGSN sends a message, the forwarding to the SGSN should go to whichever port the SGSN last sent from (whether sequence nr is known or not). Add sgsn_use_sender config and VTY command, and store the sender instead of the GSN Address IE and default port if set. Sponsored-by: On-Waves ehi
2015-12-03gtphub: prepare: keep tunnel ref in gtp_packet_desc.Neels Hofmeyr1-25/+38
Rather than passing a tunnel pointer as function arguments, keep it in the gtp_packet_desc struct passed around anyway. Reason: in the next commit (will add sgsn_use_sender), I need the tunnel to be passed back out to gtphub_handle_buf(), and besides simplifying existing code, this also makes passing the tunnel back out trivial. Sponsored-by: On-Waves ehi
2015-12-03gtphub: tweak an error log messageNeels Hofmeyr1-2/+4
2015-12-03gtphub: Del PDP: replace unnecessary lookup with asserts.Neels Hofmeyr1-33/+6
2015-12-03gtphub: check TEI presence in Create PDP Ctx ResponseNeels Hofmeyr1-0/+10
Sponsored-by: On-Waves ehi
2015-12-03gtphub: improve logging for invalid packetNeels Hofmeyr1-4/+7
Sponsored-by: On-Waves ehi
2015-12-03gtphub: cosmeticNeels Hofmeyr1-9/+4
During the peer review session with Holger, these things were deemed fixable. No need to have a static gtp_packet_desc in gtphub_handle_buf. No need to memcpy, direct assignment does the job. Remove obsolete comments. Fix a stray space. Sponsored-by: On-Waves ehi
2015-12-03gtphub: fix restart cleanup peer matching.Neels Hofmeyr1-1/+5
Adjust test expectations accordingly. Sponsored-by: On-Waves ehi
2015-12-03gtphub: wrap gtphub_write() for test suite.Neels Hofmeyr3-26/+60
Sponsored-by: On-Waves ehi
2015-12-03gtphub: fix use after free.Neels Hofmeyr1-27/+37
A tunnel pointer was still being checked after deleting by a call to expiring_item_del(). 'continue' to the next tun. Sponsored-by: On-Waves ehi
2015-12-03gtphub: Add a debug logNeels Hofmeyr1-0/+6
Sponsored-by: On-Waves ehi
2015-12-03gtphub: fix: add a missing NULL checkNeels Hofmeyr1-0/+2
Sponsored-by: On-Waves ehi
2015-12-03gtphub: cosmetic: early continue for less indentNeels Hofmeyr1-21/+22
Sponsored-by: On-Waves ehi
2015-12-03gtphub: monitor GSNs' restart counters.Neels Hofmeyr1-18/+118
If a GSN indicates that it has reset, tear down each known tunnel for that GSN individually (don't send the GSNs on the other side a different restart counter, because they represent more than just this GSN). Sponsored-by: On-Waves ehi
2015-12-03gtphub: cosmeticNeels Hofmeyr1-50/+50
Move the SGSN read callback next to the GGSN read callback. Comments. Tweak an initialization to NULL. Sponsored-by: On-Waves ehi
2015-12-03gtphub: handle Delete PDP Context.Neels Hofmeyr1-15/+154
During resolution of the header TEI, also return the tunnel struct that resolved the TEI, so the Delete PDP Ctx code does not need to look it up again. Upon Delete PDP Ctx Request, remember the IEs and that a request was made. Upon Delete PDP Ctx Response, find the pending delete and remove the corresponding tunnel, iff the response indicates success. Add a context deletion to regression tests, rename the test appropriately. Sponsored-by: On-Waves ehi
2015-12-03gtphub: remove obsolete todo commentNeels Hofmeyr1-2/+0
Sponsored-by: On-Waves ehi
2015-12-03gtphub: fix segfault when empty config.Neels Hofmeyr1-2/+12
gsn_addr_from_str(): return error upon NULL string. Add some debug logging. With an empty config, no bind addresses were set, and the address parser did not check for a NULL pointer, resulting in a segfault. Sponsored-by: On-Waves ehi
2015-12-03gtphub: be more fatal about not finding an unused TEI.Neels Hofmeyr1-2/+10
Sponsored-by: On-Waves ehi
2015-12-03gtphub: fix some style complaints from cppcheckNeels Hofmeyr2-12/+5
Sponsored-by: On-Waves ehi