summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* sim: further updates/fixesHarald Welte2014-10-264-3/+16
|
* sim: add decoding of status wordsHarald Welte2014-10-261-2/+54
|
* sim: replaced function/structure comments with doxygen commentsKevin Redon2014-10-261-8/+12
| | | | | affected files: sim.h, sim/core.c affected funtions/strucutres: osim_new_apdumsg, osim_apdu_case,osim_apdu_cmd_hdr, osim_msgb_cb
* sim: renamed case to the one defined in ISO7816-3Kevin Redon2014-10-262-18/+18
| | | | | | | | | APDU_CASE_2 becomes APDU_CASE_2S APDU_CASE_2_EXT becmoes APDU_CASE_2E APDU_CASE_3 becomes APDU_CASE_3S APDU_CASE_3_EXT becmoes APDU_CASE_3E APDU_CASE_4 becomes APDU_CASE_4S APDU_CASE_4_EXT becmoes APDU_CASE_4E
* sim: comment/explain signature of osim_new_apdumsgKevin Redon2014-10-261-2/+9
|
* sim: strip the SW from the returned data, as SW is passed in msgb->cbHarald Welte2014-10-261-2/+5
|
* sim: Use autotools for libpcsc-lite linkageHarald Welte2014-10-261-4/+8
|
* sim: add copyright notices and merge file_codec.c into core.cHarald Welte2014-10-268-39/+163
|
* initial checkin of 'libosmosim'Harald Welte2014-10-2610-0/+1487
|
* gprs: Don't discard SUSPEND/RESUME in bssgp_rcvmsgJacob Erlbeck2014-10-231-18/+26
| | | | | | | | | | | | | | | 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
* Move common socket routine into separate functionMax2014-10-131-29/+24
| | | | Signed-off-by: Max <max.suraev@fairwaves.co>
* bssgp: Free msgb in case of error when calling into gprs_ns_sendmsgHolger Hans Peter Freyther2014-10-101-0/+3
| | | | | | | | | | | | | | | | | | | | | 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
* gprs-ns: Fix reset state handlingJacob Erlbeck2014-10-091-5/+4
| | | | | | | | | | | | | | | | | | | | 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
* gprs-ns: Let gprs_nsvc_reset return a valueJacob Erlbeck2014-10-091-2/+7
| | | | | | | | | | 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
* build: remove unused all_includes and use AM_CPPFLAGSJan Engelhardt2014-10-035-5/+10
| | | | | Preprocessor flags are best placed in AM_CPPFLAGS. Remove use of the unused all_includes variable, which is never set.
* misc: Look into the build directory for generated filesHolger Hans Peter Freyther2014-09-254-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.
* gprs: Set bssgph field in bssgp_msgb_alloc()Jacob Erlbeck2014-09-231-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
* gprs: Fix bssgp_rcvmsg to handle signalling msgs with BVCI IEJacob Erlbeck2014-09-231-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
* gprs: Fix and check BVCI in BSSGP STATUS messagesJacob Erlbeck2014-09-232-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
* Fix copyright header in gan.cHarald Welte2014-09-111-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.
* add missing copyright statements to source code filesHarald Welte2014-09-115-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.
* logging: Add ability to save/print current log filtersHarald Welte2014-08-252-3/+7
| | | | | | This enables the persistent configuration of let's say 'log filter imsi 012345678' for a given log file in the config file.
* libctrl: Add support for 'deferred control commands'Harald Welte2014-08-242-0/+77
| | | | | | | | | | | | | | 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.
* ctrl: Attempt fix the build on FreeBSD and add include fileHolger Hans Peter Freyther2014-08-211-0/+1
| | | | | IPPROTO_TCP is defined in netinet/in.h. Include it and hope the build is fixed for FreeBSD.
* prepare for 0.7.0 releaseHarald Welte2014-08-213-3/+3
|
* rename controlif_setup() to ctrl_interface_setup()Harald Welte2014-08-211-2/+2
| | | | | which means that all control interface related functions now have the common ctrl_ prefix.
* libctrl: Make two internal helper functions staticHarald Welte2014-08-211-2/+2
|
* libctrl: Move bulk of control node lookup inti libosmoctrlHarald Welte2014-08-211-3/+127
| | | | | | 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.
* libctrl: remove 'struct gsm_network' referencesHarald Welte2014-08-211-4/+4
| | | | | 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.
* libctrl: adopt to recent ipaccess/ipa naming changeHarald Welte2014-08-211-2/+3
|
* libctrl: autotools build system integrationHarald Welte2014-08-211-5/+10
| | | | Now we actually build the recently-imported libctrl
* libctrl: Add DLCTRL as logging context for the control interfaceHarald Welte2014-08-213-28/+33
| | | | ... and make libctrl code use it
* libctrl: Avoid using external tall_bsc_ctxHarald Welte2014-08-211-6/+6
| | | | | | Instead of using one flat talloc context (and one that is specific to openbsc), we should attach the objects to whatever parent context they are being used in.
* libctrl: remove openbsc headers, convert from make_sock to libosmocoreHarald Welte2014-08-212-19/+9
|
* libctrl: Remove reference to 'DNAT' in favor of 'DCTRL'Harald Welte2014-08-211-1/+1
|
* libctr: rename/move control interface to libosmocore naming schemeHarald Welte2014-08-213-0/+1071
|
* gsm0808: Fix copy and paste pointed out by clangHolger Hans Peter Freyther2014-08-211-1/+1
| | | | | | | | | | | | | | | The element following the identifier list was the GSM0808_IE_LSA_INFORMATION. It is a TLV type as well and the issue got introduced in 92107dfd3b99ab0dbb0f4770286454ad94a36de2. Fixes: gsm0808.c:316:40: warning: initializer overrides prior initialization of this subobject [-Winitializer-overrides] [GSM0808_IE_LSA_IDENTIFIER_LIST] = { TLV_TYPE_TLV }, ^~~~~~~~~~~~ gsm0808.c:315:40: note: previous initialization is here [GSM0808_IE_LSA_IDENTIFIER_LIST] = { TLV_TYPE_TLV },
* macaddr: Add some code for FreeBSD (it should work on the others too)Holger Hans Peter Freyther2014-08-211-0/+41
| | | | | | | | There doesn't seem to be a way to share this code with Linux as it doesn't have the sockaddr_dl concept inside the getifaddrs. I manually verified this on a FreeBSD10 box and hex decoding gave me the correct mac address and rc was 0.
* ipa: use %z as format string whne printing sizeof() resultHarald Welte2014-08-211-1/+1
| | | | thanks to Holger for reminding me
* ipa: fix compiler warning regarding printf (%d -> %lu)Harald Welte2014-08-211-1/+1
|
* macaddr: add #include unistd.h for close() functionHarald Welte2014-08-211-0/+1
| | | | this fixes a compile warning
* ipa: rename functions for consistencyHarald Welte2014-08-203-24/+39
| | | | | | | | As we are breaking builds by moving functions from libosmo-abis to libosmocore anyway, we might as well give functions more appropriate names. ipaccess is a company, while IPA is the multiplex protocol, and CCM is the protocol used for establishing identities on the IPA multiplex.
* import various generic IPA related functions from libosmo-abisHarald Welte2014-08-202-1/+448
| | | | | | | | | libosmo-abis is about forming A-bis interfaces/lines by means of E1 or the IPA multiplex (or possibly other link layers). The IPA multiplex is used in other contexts, such as the Control interface, or the A interface. In that context, it makes sense to have generic IPA related functions in libosmocore.
* Add osmo_get_macaddr() function to obtain etherent mac addressHarald Welte2014-08-181-0/+26
| | | | | This used to be private in osmo-bts/common/abis.c, where it really didn't belong.
* osmocore: Add function osmo_macaddr_parse() to parse ETH MAC addressHarald Welte2014-08-182-1/+27
|
* abis_nm: add abis_nm_msg_disc_names[] value_stringHarald Welte2014-08-172-0/+10
|
* abis_nm: introduce abis_nm_{osmo,ipa}_magic[]Harald Welte2014-08-172-0/+5
| | | | ... used to be oml_{osmo,ipa}_magic in osmo-bts
* gprs-ns: Re-initialize the list head and free the unknown_nsvcHolger Hans Peter Freyther2014-07-071-0/+3
| | | | | | | | | | | | | | | | | Fix re-initialize issue of the GPRS NS. This was found while working on the GB Proxy tests. ==27800== Invalid write of size 4 ==27800== at 0x403C263: rate_ctr_group_alloc (linuxlist.h:65) ==27800== by 0x4050974: gprs_nsvc_create (gprs_ns.c:209) ==27800== by 0x405320D: gprs_ns_instantiate (gprs_ns.c:1330) ==27800== by 0x804B212: main (gbproxy_test.c:797) ==27800== Address 0x434173c is 52 bytes inside a block of size 784 free'd ==27800== at 0x4029DA8: free (in /usr/lib/valgrind/vgpreload_memcheck-x86-linux.so) ==27800== by 0x4041BBD: _talloc_free (talloc.c:609) ==27800== by 0x40432B2: talloc_free (talloc.c:578) ==27800== by 0x40532D3: gprs_ns_destroy (gprs_ns.c:1363) ==27800== by 0x804B1FE: main (gbproxy_test.c:791)
* write_queue: Use EBADF instead of EBABDFD for portabilityHolger Hans Peter Freyther2014-07-013-5/+5
| | | | | EBADFD is linux specific while EBADF is POSIX. Fix the build on FreeBSD and use EBADF throughout the file.
* vty: Avoid use-after-free in VTY telnet interfaceDaniel Willmann2014-06-222-4/+4
| | | | | | If the read callback closes the connection conn is already freed so we can't derefernce it. Instead return -EBADFD in the read function if it closed the connection and check for that.