aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2014-10-26sim: Use autotools for libpcsc-lite linkageHarald Welte2-4/+18
2014-10-26sim: add copyright notices and merge file_codec.c into core.cHarald Welte9-45/+186
2014-10-26sim: osmo-sim-test: Also dump binary filesHarald Welte1-10/+39
2014-10-26initial checkin of 'libosmosim'Harald Welte17-2/+2147
2014-10-26msgb: make msgb_get() finally work as expectedHarald Welte1-1/+1
2014-10-25misc: Ignore the new test file as wellHolger Hans Peter Freyther1-0/+1
2014-10-25bssgp: Include sys/socket.h for AF_INET on FreeBSDHolger Hans Peter Freyther1-0/+1
2014-10-23gprs: Don't discard SUSPEND/RESUME in bssgp_rcvmsgJacob Erlbeck3-20/+30
Currently sending SUSPEND/RESUME messages to this function (like it is done in the osmo-sgsn) results in STATUS messages complaining about an unknown BVCI. The reason is, that these messages rely on a TLLI/RAI pair to identify the context and do not contain an explicit BVCI. This patch modifies bssgp_rcvmsg() to only complain about and unknown BVCI if one is given but a matching context is not found (except for RESET messages). The ctx argument is removed from the functions handling SUSPEND and RESUME since it will always be NULL then. Sponsored-by: On-Waves ehf
2014-10-23gprs/test: Add BSSGP testsJacob Erlbeck4-2/+168
This patch adds a test suite for the BSSGP protocol. The first (and only) test checks the handling of BSSGP SUSPEND/RESUME. Sponsored-by: On-Waves ehf
2014-10-13Move common socket routine into separate functionMax1-29/+24
Signed-off-by: Max <max.suraev@fairwaves.co>
2014-10-10bssgp: Free msgb in case of error when calling into gprs_ns_sendmsgHolger Hans Peter Freyther2-4/+11
In the OsmoSGSN we have a crash with a DEAD/BLOCKED GPRS-NS and segmented SN-UNITDATA. For the caller it is not easy to know if the passed msg buffer has been freed or not. The most easy solution is to always take the ownership and either pass it on or free it in case of an error. Adjust indirect and direct callers of gprs_ns_sendmsg. I found the following call-chains with an external msgb parameter. gprs_ns_sendmsg <- _bssgp_tx_dl_ud <- bssgp_fc_in <- bssgp_tx_dl_ud Update the test to allocate a real msgb because for the test with '1000' we will msgb_free it right away. Sponsored-by: On-Waves ehf
2014-10-09gprs-ns/test: Check the nsvc state explicitelyJacob Erlbeck1-0/+7
This patch extends test_sgsn_reset_invalid_state by assertions to check that nscv->state and nsvc->remote_state have been set as expected. Sponsored-by: On-Waves ehf
2014-10-09gprs-ns/test: Re-add return value check for gprs_nsvc_resetHolger Hans Peter Freyther1-1/+3
The return value check has been removed in the commit 'Use gprs_nsvc_reset instead of gprs_ns_tx_reset', because gprs_nsvc_reset had no return value then. Since a compatible return value has been added by 'Let gprs_nsvc_reset return a value', the former patch is partly reverted by this commit. The printf is now an OSMO_ASSERT. The commit message was taken from Jacob. Sponsored-by: On-Waves ehf
2014-10-09gprs-ns: Fix reset state handlingJacob Erlbeck3-11/+27
Currently the NS-VC's state is updated from within gprs_ns_tx_reset, which can lead to an inconsistent state when the RESET_ACK is lost. In this state, the NSE_S_RESET bit is set but the Tns-reset timer is not started. This patch moves the state update into gprs_nsvc_reset. This way, the state flags are consistent with the timer. Addresses: SGSN -> BSS NS_ALIVE BSS -> SGSN NS_ALIVE_ACK BSS -> SGSN BVC_RESET SGSN -> BSS NS_STATUS, Cause: NS-VC blocked, NS VCI: 0x65 and there is no BSS->SGSN NS_ALIVE Ticket: OW#1213 Sponsored-by: On-Waves ehf
2014-10-09gprs-ns: Let gprs_nsvc_reset return a valueJacob Erlbeck2-3/+8
Currently gprs_nsvc_reset does not return any value. This patch changes the function to return an integer, where a value less than zero indicates an error. The value is taken from the gprs_ns_tx_reset function. In case of failure, an error message is logged. Sponsored-by: On-Waves ehf
2014-10-09gprs-ns/test: Add test_sgsn_reset_invalid_stateJacob Erlbeck2-0/+163
This tests the behaviour for a certain combination of messages and packet losses that can put the NS-VC object into an undefined state. In that state, the peer's ALIVE messages are properly answered, but the local test procedure has stopped, incoming unitdata PDUs are answered by STATUS(NS-VC blocked) and the unblocking procedure is not initiated. Ticket: OW#1312 Sponsored-by: On-Waves ehf
2014-10-09gprs-ns/test: Add expire_nsvc_timerJacob Erlbeck1-0/+15
This function forces the expiration of the timer within struct gprs_nsvc. It is meant to be used for controlled (and faster) timer expiration in unit tests. The timer_mode of the expired timer is returned (or -1 if the timer wasn't active). Sponsored-by: On-Waves ehf
2014-10-09gprs-ns/test: Save the last PDU type sentJacob Erlbeck1-0/+4
This records the PDU type of the last message sent to the remote peer in the global variable sent_pdu_type, which can then be used in assertions. Note that sent_pdu_type will remain unchanged if no message has been sent via sendto. Sponsored-by: On-Waves ehf
2014-10-09gprs-ns/test: Use gprs_nsvc_reset instead of gprs_ns_tx_resetJacob Erlbeck2-22/+13
Currently gprs_ns_tx_reset is used to let the NS stack generate NS_RESET message. This is not adjusting the nsvc state properly. This patch uses gprs_nsvc_reset instead which starts the full reset procedure. Sponsored-by: On-Waves ehf
2014-10-04build: resolve compiler warning about implicit delcarationJan Engelhardt1-0/+1
CC msgfile_test.o msgfile/msgfile_test.c: In function "main": msgfile/msgfile_test.c:48:2: warning: implicit declaration of function "talloc_free" [-Wimplicit-function-declaration] talloc_free(entries); ^
2014-10-03build: fix linker error with kasumi_testJan Engelhardt1-2/+1
When the osmocore package is configured with --disable-static, building of kasumi_test fails. This seems quite legit, given the function _kasumi_kgcore is not exported. Don't try to workaround the build system. Include the code. CCLD kasumi/kasumi_test kasumi_test.o: In function `test_expansion': ~tests/kasumi/kasumi_test.c:25: undefined reference to `_kasumi_key_expand' kasumi_test.o: In function `main': ~tests/kasumi/kasumi_test.c:56: undefined reference to `_kasumi' ~tests/kasumi/kasumi_test.c:100: undefined reference to `_kasumi_key_expand' ~tests/kasumi/kasumi_test.c:112: undefined reference to `_kasumi_kgcore' [...]
2014-10-03build: remove unused all_includes and use AM_CPPFLAGSJan Engelhardt8-8/+14
Preprocessor flags are best placed in AM_CPPFLAGS. Remove use of the unused all_includes variable, which is never set.
2014-10-03utils: resolve compiler warnings on implicit declarationsJan Engelhardt1-0/+1
CC osmo-auc-gen.o osmo-auc-gen.c: In function 'main': osmo-auc-gen.c:216:3: warning: implicit declaration of function 'time' [-Wimplicit-function-declaration]
2014-09-25misc: Look into the build directory for generated filesHolger Hans Peter Freyther4-4/+4
the bits/crc files are not inside the sourcedirectory but will end in the build directory. Go and look there as well. This somehow doesn't fail with make distcheck but when building for Yocto Dizzy.
2014-09-23gprs: Set bssgph field in bssgp_msgb_alloc()Jacob Erlbeck1-1/+3
Currently the bssgph field is not set when using the bssgp_tx_* functions. This hinders unit testing of generated messages. This patch initializes the bssgph field directly after allocation a new bssgp msgb in bssgp_msgb_alloc() so that it is set by default. Sponsored-by: On-Waves ehf
2014-09-23gprs: Fix bssgp_rcvmsg to handle signalling msgs with BVCI IEJacob Erlbeck1-3/+7
Currently BSSGP messages with an NS BVCI of 0 (signalling) are discarded if they aren't RESET messages. Thus valid signalling messages (e.g. BLOCK) are not handled properly, because the BVCI IE is ignored if it present. Instead a STATUS message referring to BVCI 0 (instead of the BVCI used in the BLOCK message) is returned. This patch changes the implementation to use the BVCI contained in the BVCI IE if that is present in a signalling message. It fixes BSSGP BLOCK/UNBLOCK for the osmo-sgsn. Note that signalling messages without an BVCI IE (e.g. SUSPEND/RESUME) are still rejected. Ticket: OW#1205 Sponsored-by: On-Waves ehf
2014-09-23gprs: Fix and check BVCI in BSSGP STATUS messagesJacob Erlbeck2-1/+15
Currently the BVCI is not set in all invocations to bssgp_tx_status() when the cause is UNKNOWN_BVCI. This patch adds the argument where it is missing. It also adds a check for compliance (GSM 08.18, 10.4.14.1) to bssgp_tx_status() to emit errors when the following requirement is not fulfilled: The BVCI must be included if (and only if) the cause is either "BVCI blocked" or "BVCI unknown". Sponsored-by: On-Waves ehf
2014-09-11Fix copyright header in gan.cHarald Welte1-4/+4
When I wrote the gan.c, I used the wrong copyright/license header (AGPLv3+ intead of GPLv2+). This was a mistake and is fixed hereby.
2014-09-11add missing copyright statements to source code filesHarald Welte5-0/+106
Some source code files didn't have the usual copyright and licence statement at their top. I'm adding them baesed on information in the commitlog.
2014-09-08debian: Depend on the right version of libosmogsm as wellHolger Hans Peter Freyther1-1/+1
2014-09-08debian: Depend on libosmocore5 for the legacy packageHolger Hans Peter Freyther1-1/+1
2014-09-08debian: fix build errors with libosmogsm and libosmoctrlCiaby3-2/+9
libosmogsm: the transition from 5 to 6 wasn't done properly. Fixed version number. libosmoctrl: missing definition in debian/control and also missing libosmoctrl0.install.
2014-09-02logging: Document the ABI breakage in the release todoHolger Hans Peter Freyther1-0/+1
In commit fb84f325b8e672ba7ca1a961f4ef01f4d011e33d the ABI was broken, let's add the required entry.
2014-08-29msgfile: Fix memleak in the test and release the listHolger Hans Peter Freyther1-0/+1
2014-08-25logging: Add ability to save/print current log filtersHarald Welte3-3/+23
This enables the persistent configuration of let's say 'log filter imsi 012345678' for a given log file in the config file.
2014-08-24gsm48.h: define the reserved TMSI in libosmocore, not openbscHarald Welte1-0/+3
2014-08-24add port number 4238 for BTS control interfaceHarald Welte2-0/+2
2014-08-24libctrl: Add support for 'deferred control commands'Harald Welte3-0/+92
Sometimes a control interface command cannot be processed and responded immediately, but we need to process it asynchronously. In order to support this, we introduce the 'ctrl_cmd_def', which represents such a deferred command. It is created by the service implementing the command using ctrl_cmd_def_make(), and a response is later sent using ctrl_cmd_def_send(). ctrl_cmd_def_is_zombie() must be called to handle the case where the control connection has disconnected/died between receiving the command and sending the response.
2014-08-21ctrl: Attempt fix the build on FreeBSD and add include fileHolger Hans Peter Freyther1-0/+1
IPPROTO_TCP is defined in netinet/in.h. Include it and hope the build is fixed for FreeBSD.
2014-08-21prepare for 0.7.0 release0.7.0Harald Welte5-5/+11
2014-08-21Convert recently-introduced header files to #pragma onceHarald Welte3-13/+3
2014-08-21New <osmocom/ctrl/ports.h> file listing tcp ports for CTRL interfaceHarald Welte2-0/+8
2014-08-21rename controlif_setup() to ctrl_interface_setup()Harald Welte2-4/+4
which means that all control interface related functions now have the common ctrl_ prefix.
2014-08-21libctrl: Make two internal helper functions staticHarald Welte1-2/+2
2014-08-21libctrl: Move bulk of control node lookup inti libosmoctrlHarald Welte2-7/+134
The control interface user now only has to register a very short node lookup function callback. This function is optional, and only required if hierarchical command lookup should be supported.
2014-08-21libctrl: remove 'struct gsm_network' referencesHarald Welte2-9/+6
libctrl doesn't need any knowledge about the type of the user-private data that it gets passed upon setup time and includes on callbacks.
2014-08-21libctrl: remove bsc-specific declarationHarald Welte1-1/+0
this was moved by accident when importing the code from openbsc.
2014-08-21libctrl: adopt to recent ipaccess/ipa naming changeHarald Welte1-2/+3
2014-08-21libctrl: autotools build system integrationHarald Welte5-7/+27
Now we actually build the recently-imported libctrl
2014-08-21libctrl: Add DLCTRL as logging context for the control interfaceHarald Welte4-29/+35
... and make libctrl code use it