aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc
AgeCommit message (Collapse)AuthorFilesLines
2015-11-24gtphub: fix ares segfault: add missing initialization.Neels Hofmeyr1-0/+2
The struct gtphub_resolved_ggsn was not initialized properly, so that adding it to a list caused a segmentation fault.
2015-11-24gtphub: lose obsolete comment.Neels Hofmeyr1-2/+0
The del_cb is now also used for ares (GGSN resolution) timeouts, and expiry is anyway separated from nr_map, so this comment is void. Sponsored-by: On-Waves ehi
2015-11-21tests/smpp: Fix linking orderHarald Welte1-2/+3
At least when using system-wide libtalloc, the LIBOSMOCORE_LIBS must come last, after the static libraries under libcommon.
2015-11-21Fix compilation with no libc-ares present on the systemHarald Welte2-3/+5
This build failure was introduced with the OAP and gtphub changes.
2015-11-20gtp: Fix Makefile.am so maybe distcheck is now going to workHolger Hans Peter Freyther1-1/+1
2015-11-20vty: Print NCC/BCC and not just integer value of BSICHarald Welte1-1/+2
2015-11-20Fix TSC/BSIC handling bug and remove bts->tscHarald Welte7-37/+15
This fixes a bug in the following circumstances: * BSIC is set to 0 in the config file * No TSC is explicitly specified at the BST level in the config file In this case, we ended up using BSIC=0 and TSC=7, as TSC=7 is our default initialization value. The TSC of the CCCH/BCCH must always be the BCC, which is the lower 3 bits of the BSIC. Having configuration options for both the BSIC _and_ the TSC at the BTS level therefore makes no sense, as it only adds ways in which users can configure non-oprational configurations. So we remove the bts->tsc member, and keep only the ts->tsc members that allow us to configure a timeslot-specific TSC that's different from the BTS TSC (= BCC).
2015-11-20oap and gtphub tests must only be compiled of LIBGTP is present!Harald Welte1-2/+2
2015-11-20Depend on libgtp >= 0.92, as previous versions don't have gtpie.h installedHarald Welte1-1/+1
this fixes compilation for people having older gtp libraries installed.
2015-11-20meas_db.c: fix compiler warningsHarald Welte1-0/+1
s_db.c: In function ‘_insert_ud’: meas_db.c:65:6: warning: implicit declaration of function ‘rxlev2dbm’ [-Wimplicit-function-declaration] rxlev2dbm(ud->full.rx_lev))); ^
2015-11-20gtphub: fix echo reply to SGSNs: wrong fd. Add test.Neels Hofmeyr2-16/+62
The actual fix is just one character, but also add a regression test against this, on both CTRL and USER plane.
2015-11-18gtphub: fix three oversights (thanks to coverity).Neels Hofmeyr1-5/+3
- an unnecessary if-not-NULL check (1339764); - a missing nul termination safety net (1339768); - a typo resulting in the wrong proxy being logged (1339767). Sponsored-by: On-Waves ehi
2015-11-18gtphub: fix fatal log msg for SGSN proxy.Neels Hofmeyr1-1/+1
While reworking the logging, a stray comma found its way into the code. Fixes coverity 1339765. Sponsored-by: On-Waves ehi
2015-11-18gtphub: fix gtphub_read() semantics.Neels Hofmeyr1-9/+7
gtphub always wants to know the sender, hence make the from_addr pointer mandatory. Fixes two coverity complaints (1339766, 1339764). Sponsored-by: On-Waves ehi
2015-11-18fix build: remove obsolete gtphub EXTRA_DIST.Neels Hofmeyr1-4/+1
Sponsored-by: On-Waves ehi
2015-11-16gtphub: cosmetic: break long lines.Neels Hofmeyr4-124/+201
Fit most of the code in 80 chars width. Some instances still leak past 80 characters because of long function names, inline comments or the like, "the exception proves the rule." Sponsored-by: On-Waves ehi
2015-11-16gtphub: review log levels, add level arg to LOG().Neels Hofmeyr1-141/+133
For maintenance, it is convenient to have the log level explicit at each log statement. Tweak some log levels / message formatting while at it. Sponsored-by: On-Waves ehi
2015-11-16gtphub: add logging labels to bind struct.Neels Hofmeyr2-1/+9
Allow logging the plane (Ctrl/User) and side (SGSN/GGSN) in functions that only have a gtphub_bind* to work with, by adding a constant label to each bind. Sponsored-by: On-Waves ehi
2015-11-16gtphub: don't always try to do GGSN resolution.Neels Hofmeyr2-29/+8
If a GGSN is already known from unmapping, don't invoke a host resolution. In a live working environment, it wouldn't hurt, because the lookups would mostly return from the cache. But in a testing environment without a name server, it barfs on every packet. Sponsored-by: On-Waves ehi
2015-11-16gtphub: fix numerous segfaults, and other stupidities.Neels Hofmeyr3-6/+10
Initialize llist_heads to empty (2 were missing). Move those for struct gtphub instances to gtphub_zero() (one moved, one added). In from_[gs]gsns_read_cb(), use a return type that can actually reflect negative return values. resolved_addr.buf: no need to take the address of a byte array var (cosmetic). Pass the proper user data address to sgsn_ares_query(), not the address of the pointer holding the user data address. Initialize ggsn_lookup->expiry_entry (was missing). Publish the function for that in gtphub.h so gtphub_ext.c can use it. Sponsored-by: On-Waves ehi
2015-11-16gtphub: Add logging for ares queries.Neels Hofmeyr2-15/+28
Looking for a segfault, I added a lot of logging. This may be useful for live testing ares, leaving it in there for now. Note: I still want to clean up the logging concerning log levels etc. once we're out of alpha. Sponsored-by: On-Waves ehi
2015-11-16gtphub: fix handling of sender from nonstandard port.Neels Hofmeyr1-3/+35
Allow a peer sending from an unknown port but a known address, and just create the port (and unmap the seq nr back to this port later to return the response to the sender). Only an SGSN on the Ctrl plane is allowed to make the very first contact from an unknown address. Sponsored-by: On-Waves ehi
2015-11-16gtphub: fix User plane decoding, add unit test.Neels Hofmeyr3-24/+156
Split decoding return code GTP_RC_PDU in GTP_RC_PDU_C and GTP_RC_PDU_U. Don't do IEs in GTP_RC_PDU_U. Add a unit test for User plane data, expected to fail (nonstandard port case). In gtphub_test.c, tweak logging so that it is easily visible which test produced which output. Also add the global resolved_sgsn_addr and ggsn_sender, symmetrically to resolved_ggsn_add and sgsn_sender. Sponsored-by: On-Waves ehi
2015-11-16gtphub: make test code reusable for future tests.Neels Hofmeyr3-179/+246
Generalize to make the PDP ctx message definitions and "sending" of messages from SGSN->gtphub->GGSN and back reusable in future tests. Publish gsn_addr_from_sockaddr() in gtphub.h for use in gtphub_test.c. Use an osmo_sockaddr for resolved_ggsn_addr, because one is needed for comparison in probably every future test. Add LVL2_ASSERT() to print assertion message and return instead of abort, so that functions can be called from several tests without losing the info of which test caused it from which line. Use globals for struct gtphub and time_t now, to reduce nr of args that need to be passed around when writing tests. Add a default test setup function. Sponsored-by: On-Waves ehi
2015-11-16gtphub: add/fix IMSI and APN IE error handlingNeels Hofmeyr2-22/+72
Sponsored-by: On-Waves ehi
2015-11-16gtphub: fix Echo behavior: respond directly.Neels Hofmeyr4-94/+125
Up to now I used the Echo as a test for sequence nr mappings. But Echos should be handled differently: they are scoped on the link and an Echo response should be sent right back to the requester. Sponsored-by: On-Waves ehi
2015-11-16gtphub: add first bits of GRX aresNeels Hofmeyr9-120/+388
For the resolving function, change the function signature to return a gtphub_peer_port. In consequence, publish two functions concerned with gtphub_peer_port instances for use in test and gtphub_ext.c. Add GGSN resolution queue, callback and cache. Simple implementation: if an SGSN asks for a GGSN, it will first get no answer, and I hope it will ask again once the GGSN is in the cache. Within gtphub_ext.c, have a dummy sgsn struct, as the sgsn_ares code currently depends on it (half the functions pass an sgsn instance pointer around, but the other half use the global one). In the unit tests, wrap away the ares initialization so that they can work without a DNS server around. The netcat test breaks because of this, will remove it. Using sgsn_ares, implement the gtphub_resolve_ggsn_addr() function, I hope: untested. Minor cosmetics just to see if you're paying attention... ;) Sponsored-by: On-Waves ehi
2015-11-16Add GTP hub initial code base.Neels Hofmeyr16-1/+3854
First steps towards a new GTP hub. The aim is to mux GTP connections, so that multiple SGSN <--> GGSN links can pass through a single point. Background: allow having more than one SGSN, possibly in various remote locations. The recent addition of OAP to GSUP is related to the same background idea. (This is a collapsed patch of various changes that do not make sense to review in chronological order anymore, since a lot of it has thorougly transmorphed after it was first committed.) Sponsored-by: On-Waves ehf
2015-11-10sgsn_vty.c: fix typoNeels Hofmeyr1-1/+1
2015-11-10gbproxy: Count more GSM 04.08 messagesHolger Hans Peter Freyther4-0/+654
Extend the ul/dl counting to count the usual messages on the Gb interface. Add counters for the attach, routing area update, pdp context activation and deactivation procedures. Update the test result with the new counters.
2015-11-05Fix Warning: openbsc implicit-pointer-decl meas_udp2db.c:50Martin Hauke1-0/+1
2015-11-05Fix no-return-in-nonvoid-function meas_vis.cMartin Hauke1-0/+2
RPM post-build-checks found some issue and marks these as error: [ 38s] I: Program returns random data in a function [ 38s] E: openbsc no-return-in-nonvoid-function meas_vis.c:118
2015-11-02stats/mgcp: Initialize the statistics for MGCP as wellHolger Hans Peter Freyther1-0/+7
There are currently no reate counters but this will hopefully change in the near future.
2015-11-02stats: Set class_id in rate_ctr group descriptionsJacob Erlbeck5-0/+11
This commit adds the class_id initialiser to all rate_ctr_group_desc definitions. Sponsored-by: On-Waves ehf
2015-11-02stats: Enable stats for sgsn, gbproxy, nitb, bsc, natJacob Erlbeck6-1/+19
This commit initialises and enables the stats subsystem for the given binaries. Sponsored-by: On-Waves ehf
2015-11-02mgcp_osmux: available circuit IDs from 0 to 255, not from 0 to 128Pablo Neira Ayuso2-2/+2
Holger reports that the bitmap that accounts for available Osmux circuit IDs is limited to 128, when the maximum number of circuit IDs are determined by the uint8_t field in the header (ie. 256 circuits). [hfreyther: Update the testcase now that we have more ids to allocate]
2015-11-02oap: add OAP config to VTYNeels Hofmeyr1-0/+91
Sponsored-by: On-Waves ehf
2015-11-02gsup/oap: add OAP to GSUP client.Neels Hofmeyr5-8/+62
Trigger an OAP registration upon IPA connect. Feed incoming OAP messages to oap_handle() and send replies returned by it. Add oap_config to sgsn_config (todo: vty). Sponsored-by: On-Waves ehf [hfreyther: Fix coding style]
2015-11-02oap: add OAP API testNeels Hofmeyr2-5/+195
Sponsored-by: On-Waves ehf
2015-11-02oap: add oap testsuite skeletonNeels Hofmeyr7-1/+89
Sponsored-by: On-Waves ehf
2015-11-02oap: implement initial OAP API.Neels Hofmeyr6-2/+586
Add oap.[hc] and oap_messages.[hc]. Sponsored-by: On-Waves ehf
2015-11-02libcommon: soak up three static functions.Neels Hofmeyr7-43/+90
Add new kitchen sink openbsc/utils.h and libcommon/utils.c to make three so far static functions public (so I can use them in the upcoming OAP code). A place to put them could have been the gprs_utils.h, but all general functions in there have a gprs_ prefix, and todo markings to move them away. All other libcommon headers are too specific, so I opened up this kitchen sink header. Replace the implementation of encode_big_endian() with a call to osmo_store64be_ext(). See comments. Apply the change in Makefiles and C files.
2015-11-02sgsn: Fix up the VTY doc stringsHolger Hans Peter Freyther1-2/+2
The documentation needs to end with a \n and T3316 needs to have some text. I think it is the T3316 timer that has no action on the network side. <command id='timer t3312 &lt;0-65535&gt;'> <param name='&lt;0-65535&gt;' doc='(null)' /> Documentation error (missing docs): <command id='timer t3322 &lt;0-65535&gt;'> <param name='&lt;0-65535&gt;' doc='(null)' /> Documentation error (missing docs): <command id='timer t3350 &lt;0-65535&gt;'> <param name='&lt;0-65535&gt;' doc='(null)' /> Documentation error (missing docs): <command id='timer t3360 &lt;0-65535&gt;'> <param name='&lt;0-65535&gt;' doc='(null)' /> Documentation error (missing docs): <command id='timer t3370 &lt;0-65535&gt;'> <param name='&lt;0-65535&gt;' doc='(null)' /> Documentation error (missing docs): <command id='timer t3313 &lt;0-65535&gt;'> <param name='&lt;0-65535&gt;' doc='(null)' /> Documentation error (missing docs): <command id='timer t3314 &lt;0-65535&gt;'> <param name='&lt;0-65535&gt;' doc='(null)' /> Documentation error (missing docs): <command id='timer t3316 &lt;0-65535&gt;'> <param name='&lt;0-65535&gt;' doc='(null)' /> Documentation error (missing docs): <command id='timer t3385 &lt;0-65535&gt;'> <param name='&lt;0-65535&gt;' doc='(null)' /> Documentation error (missing docs): <command id='timer t3386 &lt;0-65535&gt;'> <param name='&lt;0-65535&gt;' doc='(null)' /> Documentation error (missing docs): <command id='timer t3395 &lt;0-65535&gt;'> <param name='&lt;0-65535&gt;' doc='(null)' /> Documentation error (missing docs): <command id='timer t3397 &lt;0-65535&gt;'> <param name='&lt;0-65535&gt;' doc='(null)' />
2015-10-29SGSN: Fix typo in VTY license statement.Harald Welte1-1/+1
It mentioned AGPLv3+ and refers to the hyperlink of v3, but still stated "Version 2 or later". That was a typo at the time.
2015-10-13gprs/gb_proxy: Use RAND_bytes for gbproxy TLLI/TMSI allocationDaniel Willmann6-303/+329
This change has some implications for the test case. It manipulated bss_ptmsi_state and sgsn_tlli_state variables to make the output of rand_r() and thus the TLLI/TMSI used predictable. This possibility is gone when using RAND_bytes() so instead it is overridden by a function that returns a deterministic sequence of values (0x00dead00, 0x00dead01, ...). The test cases are adapted to expect these values instead of the pseudo random values before. The gbproxy_test stdout file changes as well, but only where the TLLI/TMSI is displayed (in the hex dumps as well as the TLLI cache entries). All other output is the same.
2015-10-13gbproxy/test: Add and call cleanup_test functionDaniel Willmann1-0/+20
This (currently empty) function is meant to contain code that cleans up the left-overs of the test functions. This is needed by the next commit to reset the RAND_bytes sequence.
2015-10-13gprs: Use RAND_bytes for p-tmsiDaniel Willmann3-2/+8
[hfreyther: Link to libcrypto, include header, add uint8_t* cast]
2015-10-13sgsn/test: Really parse received DL LLC messagesJacob Erlbeck2-27/+61
Currently just the number of intercepted downlink messages is counted and eventually checked. The contents of the messages is lost. The PTMSI contained in ATTACH/RAU Accept messages is just 'guessed' by resetting the random number generator after reference PTMSIs have been generated. While this works with rand_r, RAND_bytes cannot be forced to recreate a certain number sequence this way (unless the backend is replaced). This commit changes that behaviour so that the last received msgb is kept and decoded. The PTMSI that has been assigned by the SGSN is then taken in the affected test cases and used instead of a 'guessed' one. This is similar to how a real MS would react to the Accept message. Sponsored-by: On-Waves ehf
2015-10-13sgsn/test: Add and call cleanup_test functionJacob Erlbeck1-0/+46
This (currently empty) function is meant to contain code that cleans up the left-overs of the test functions. This will be needed by the next commit that will store the last received msgb for later inspection. Sponsored-by: On-Waves ehf
2015-10-12osmux: Allow to listen to a specific addressHolger Hans Peter Freyther4-1/+16
For a setup with multiple network interfaces be able to pick the one that osmux should be used/visible.