aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/tests/channel
AgeCommit message (Collapse)AuthorFilesLines
2015-04-29sub: Remove the queue from the subscriber codeHolger Hans Peter Freyther1-5/+7
The idea of "subscriber_get_channel" was that different requests would be coordinated. At the same time we have seen that the "queue" can get stuck at both 31C3 and the rhizomatica installations. Voice calls and SMS do not need coordination. We should be able to send SMS on a voice channel and switch the MS from a SDCCH to a TCH in case we establish a voice call. The SMS code itself needs to coordinate to obey the limit of one SMS per direction but this should be enforced in the sms layer and not on the subscriber. Modify the code to have a simple paging coordination. The subscriber code will schedule the paging and register who would like to know about success/failure. This allowed to greatly simplify the paging response handling for the transaction code (and in fact we could move the transaction list into the subscriber structure now). The code gained to support to cancel the notification of a request (but not the paging itself yet). TODO: Cancel paging request in case no one cares about it anymore.
2014-12-05msc: Add and use gsm_subscriber_groupJacob Erlbeck1-1/+4
Currently every subcriber object directly refers to the gsm_network which contains a flag shared by every related subscriber (keep_subscr). This adds a dependency on gsm_network even if only the function defined in gsm_subscriber_base.c are used. This patch adds a new struct gsm_subscriber_group which contains the keep_subscr flag and a back reference to the network object. The latter is not dereferenced in gsm_subscriber_base.c, so it can safely be set to NULL when only that part of the gsm_subscriber API is being used. It also changes that API to use gsm_subscriber_group instead of gsm_network parameters. Since there are some places where a pointer to the gsm_network is needed but where only a gsm_subscriber is available, a 'net' back pointer is added to the group struct, too. Nevertheless subscr group and network could be separated completely, but this is not the topic of this commit. Sponsored-by: On-Waves ehf
2014-11-11bsc: Move gsm_network_init function to libbscJacob Erlbeck1-3/+5
Currently libcommon depends on libbsc, because gsm_network_init (libcommon/gsm_data.c) directly calls gsm_net_update_ctype (libbsc/gsm_04_08_utils.c). This patch moves gsm_network_init to a new file libbsc/net_init.c. Sponsored-by: On-Waves ehf
2014-05-28channel_test: Return a positive number to claim it was pagedHolger Hans Peter Freyther1-1/+4
This addresses an ASAN issue where the request was already deleted by our callback function. (gdb) where #0 0xb69e7810 in __asan_report_error () from /usr/lib/i386-linux-gnu/libasan.so.0 #1 0xb69e0aff in __asan_report_store4 () from /usr/lib/i386-linux-gnu/libasan.so.0 #2 0x0804ea64 in subscr_send_paging_request (subscr=subscr@entry=0xb5103cb0) at gsm_subscriber.c:212 #3 0x0804edac in subscr_get_channel (subscr=subscr@entry=0xb5103cb0, type=type@entry=2, cbfn=cbfn@entry=0x804969d <subscr_cb>, param=param@entry=0x2342) at gsm_subscriber.c:246 #4 0x080498f7 in main (argc=1, argv=0xbffff804) at channel_test.c:77 Breakpoint 3, subscr_paging_dispatch (hooknum=hooknum@entry=101, event=event@entry=200, msg=msg@entry=0x1323, data=<optimized out>, data@entry=0x8063900 <s_conn>, param=<optimized out>, param@entry=0xb5103cb0) at gsm_subscriber.c:126 126 llist_del(&request->entry); (gdb) b llist_del (gdb) bt #0 subscr_paging_dispatch (hooknum=hooknum@entry=101, event=event@entry=200, msg=msg@entry=0x1323, data=<optimized out>, data@entry=0x8063900 <s_conn>, param=<optimized out>, param@entry=0xb5103cb0) at gsm_subscriber.c:126 #1 0x0804e8a9 in subscr_paging_cb (hooknum=101, event=200, msg=0x1323, data=0x8063900 <s_conn>, param=0xb5103cb0) at gsm_subscriber.c:187 #2 0x080497e9 in paging_request (bts=0xb5b03e70, subscriber=subscriber@entry=0xb5103cb0, type=2, cbfn=cbfn@entry=0x804e881 <subscr_paging_cb>, data=data@entry=0xb5103cb0) at channel_test.c:51 #3 0x0804ea39 in subscr_send_paging_request (subscr=subscr@entry=0xb5103cb0) at gsm_subscriber.c:207 #4 0x0804edac in subscr_get_channel (subscr=subscr@entry=0xb5103cb0, type=type@entry=2, cbfn=cbfn@entry=0x804969d <subscr_cb>, param=param@entry=0x2342) at gsm_subscriber.c:246 #5 0x080498f7 in main (argc=1, argv=0xbffff804) at channel_test.c:77 (gdb) q
2013-12-27db: Avoid crash we have seen with the dbi code when reading a SMSHolger Hans Peter Freyther1-0/+1
Avoid a crash when reading a SMS and a Subscriber could not be resolved. It is not clear why the read was failing. The sender_id and the receiver_id was valid for the given sms. I assume that the database has been locked due external access to it. The side-effect is that in case of such a failure the sms_queue will start to deliver starting from subscriber id = 0 again. #1 0x0000000000428bec in sms_from_result (net=0x156a270, result=0x15eda30) at db.c:1146 #2 0x000000000042a8e0 in db_sms_get_unsent_by_subscr (net=0x156a270, min_subscr_id=<optimized out>, failed=<optimized out>) at db.c:1255 #3 0x000000000042e900 in take_next_sms (smsq=<optimized out>) at sms_queue.c:193 #4 sms_submit_pending (_data=0x158e300) at sms_queue.c:227 #5 0x00007f3fd30de3bc in osmo_timers_update () at timer.c:243 #6 0x00007f3fd30de69b in osmo_select_main (polling=0) at select.c:133 #7 0x0000000000406fbc in main (argc=9, argv=<optimized out>) at bsc_hack.c:346 (gdb) frame 1 #1 0x0000000000428bec in sms_from_result (net=0x156a270, result=0x15eda30) at db.c:1146 1146 strncpy(sms->src.addr, sms->sender->extension, sizeof(sms->src.addr)-1); (gdb) p *sms (gdb) p sms->sender $1 = (struct gsm_subscriber *) 0x0 (gdb) p sender_id $2 = <optimized out>
2013-12-13build: channel_test does not use dlopen/dlsym remove LIBRARY_DL depHolger Hans Peter Freyther1-1/+1
2013-12-13freebsd: dlopen/dlsym/dlerror is part of libc, use LIBRARY_DL for linkingNikola1-1/+1
In FreeBSD there is no spearate library for dlopen, dlsym and dlerror. Use LIBRARY_DL to check for this condition.
2013-07-27expiration: Speculative fixes for the periodic expiring handlingHolger Hans Peter Freyther1-0/+1
We were expiring subscribers during active calls. This is because the T3212 is stopped under certain conditions but we didn't stop that timer at all. Remember if T3212 timer was stopped due something done by NITB and update the expiration time at the end of the radio connection, as the phone should restart it when returning to MM Idle. It is a bit difficult to decide when we should set the flag. E.g. in a CM Service Request we don't know if we accept the service and during a LU we already send MM messages before we accept or reject the subscriber. The easiest is to set the flag when receiving a paging response on known subscribers and at the end of the authentication process. Do not expire a subscriber that has an active connection that is marked with the flag, e.g. we would still expire a subscriber that is being paged. Manual tests executed/passed: * gst LUTest.st verified that a expiration date was set * gst SMSTest.st (doing another LU but forcing a timeout on the SMS sending). Verified that the expire_lu was updated.
2013-06-12Makefile.am: Use AM_CPPFLAGSAlexander Huemer1-1/+1
Since automake 1.13 INCLUDES is depricates and causes a warning
2012-01-15abis: gsm_data_shared.h includes libosmo-abis header, add abis to cflagsHolger Hans Peter Freyther1-1/+1
gsm_data_shared.h includes e1_input.h of libosmo-abis, add the LIBOSMOABIS_CFLAGS to Makefile.am, remove AM_LDFLAGS at the same time as we only build .a archives.
2012-01-06tests: Introduce running tests with GNU autotest in OpenBSCHolger Hans Peter Freyther2-0/+4
The quality of the tests is of different value but it is good to get started and improve from here.
2012-01-06channel: Make the test not crash again.Holger Hans Peter Freyther1-4/+15
* Initialize logging * The callback expects NULL or a subscriber connection
2011-06-30misc: Link to libosmogsm after adding our static librariesHolger Hans Peter Freyther1-2/+2
GCC 4.6.0 and LD.BFD 2.21 on ARM somehow fail to resolve the dbi symbols when we have the library in front of the static libraries, move them to the back. Without this patch the tlv_def_patch symbol and the gsm48_construct_ra.
2011-06-30misc: Link to -ldbi after adding our static librariesHolger Hans Peter Freyther1-2/+2
GCC 4.6.0 and LD.BFD 2.21 on ARM somehow fail to resolve the dbi symbols when we have the library in front of the static libraries, move them to the back.
2011-06-26make channel_test build againHarald Welte1-1/+1
2011-05-06src: use namespace prefix osmo_fd* and osmo_select*Pablo Neira Ayuso1-1/+1
Summary of changes: s/struct bsc_fd/struct osmo_fd/g s/bsc_register_fd/osmo_fd_register/g s/bsc_unregister_fd/osmo_fd_unregister/g s/bsc_select_main/osmo_select_main/g
2011-03-23src: use new library libosmogsm and new path to headers in libosmocorePablo Neira Ayuso2-3/+3
libosmogsm is a new library that is distributed in the libosmocore. Now, openbsc depends on it. This patch gets openbsc with this change. This patch also rewrites all include path to the new osmocom/[gsm|core] Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
2011-03-04prefix sub-directories containing libraries with 'lib'Harald Welte1-11/+5
... and make sure tests work again after restructuring
2011-02-11[BSC] Move the BTS-type specific code from bcs_init.c to bts_*.cHarald Welte2-2/+2
bsc_init.c was a big mess even only for two supported BTS models, so before adding more BTS types, this needs a cleanup. All the BTS specific code from bsc_init.c has now moved into bts_{siemens_bs11,ipaccess_nanobts}.c This has required that input_event() and nm_state_event() get both converted to proper libosmocore signals instead of referencing external symbols.
2011-01-06subscr: Dump the pending requests to help with debugging state.Holger Hans Peter Freyther1-0/+1
2011-01-06subscr: Stop all paging requests if one is failing.Holger Hans Peter Freyther1-0/+1
If one paging request is timing out the others will timeout soon as well. With the current code the next timeout would expire the next request in the queue. We will now stop all paging requests and then issue a next paging request. So for both paging success and failure we will now stop all the other requests. This is mostly a workaround, one should count on how many BTSes we are paging and wait for all failures before we remove the item from the queue.
2011-01-01License change: We are now AGPLv3+ instead of GPLv2+Harald Welte1-5/+4
The reason for this is quite simple: We want to make sure anyone running a customized version of OpenBSC to operate a network will have to release all custom modifiations to the source code.
2010-12-21test: Make it compile but it is segfaulting on start nowHolger Hans Peter Freyther1-0/+2
2010-09-18janitor: Move the * to the variable nameHolger Hans Peter Freyther1-1/+1
2010-09-06chan: Store the to be assigned channel type in the GSM Network.Holger Hans Peter Freyther1-0/+1
Store the mapping from request to channel type in the GSM Network struct as there is some policy involved with handling the request. E.g. in a half rate network we don't want emergy calls to be getting a TCH/F, or we want to have a different policy for early/late assignment of phone calls. Update the table when creating the network and when the neci is changed.
2010-02-26[misc] Add LIBOSMOCORE_CFLAGS to the includesHolger Hans Peter Freyther1-1/+1
2010-02-20finish openbsc / libosmocore separationHarald Welte2-9/+3
* use pkg-config from openbsc to find header and library * move sms and timer tests to libosmocore itself * ensure "make distcheck" works on both packages
2010-01-11misc: Fix compilation of the test cases.Holger Hans Peter Freyther2-1/+6
2009-12-23[channel] Compile statistics.c into the test.Holger Hans Peter Freyther1-1/+2
2009-08-20[subscr] Change the signature... the gsm_network is in the subscrHolger Hans Peter Freyther1-1/+2
Remove the extra parameter from the method, the network can be taken from the subscriber.
2009-08-17[subscr] Split gsm_subscriber.c in BSC and MSC partHolger Hans Peter Freyther1-0/+1
For the BSC part we still assign a gsm_subscriber to lchan but it might only contain the TMSI of this subscriber. For the MSC part we will need the HLR/VLR feature of the gsm_subscriber, specially the lookup's by number... So if libbsc.a/libmsc.a are compiled in one app and used the subscribers will be shared, and if only libbsc.a gets used we will have more empty gsm_subscriber.c..
2009-08-10misc: Firs round of fixing compilation of test casesHolger Hans Peter Freyther2-1/+3
Next round should be using them again
2009-06-26make tests compile again after talloc branch changesHarald Welte2-4/+10
2009-06-10[channel] Add a test case for the request foo in gsm_subscriber.cHolger Hans Peter Freyther2-0/+86
This is simulating a successfull request and is causing a segfault. The test is done with a "mock object" in this case a minimalistic paging implementation which is enough to show the crash. Compare that the callback data is supposed to be the same....