aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/libmsc/ctrl_commands.c
AgeCommit message (Collapse)AuthorFilesLines
2014-12-05msc: Add and use gsm_subscriber_groupJacob Erlbeck1-3/+3
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-10-28nitb/ctrl: Fix access to freed memory in verify_subscriber_modifyJacob Erlbeck1-7/+9
Currently the temporary string 'tmp' is freed before parts of it are referenced. This lets address sanitizer complain when evaluating strlen(imsi), where imsi points into the 'tmp' data block. This patch moves the talloc_free to the end of the function and uses a rc variable instead of using early returns. Addresses: testSubscriberAddRemove (__main__.TestCtrlNITB) ... Launch: ./src/osmo-nitb/osmo-nitb -c ./doc/examples/osmo-nitb/nanobts/openbsc.cfg -l test_hlr.sqlite3 Connecting to host 127.0.0.1:4249 Sending "SET 1000 subscriber-modify-v1 2620345,445566" Decoded replies: {} ERROR Sponsored-by: On-Waves ehf
2014-08-21move libctrl from openbsc to libosmoctrl (libosmocore.git)Harald Welte1-1/+1
2014-03-23nitb/ctrl: Implement a command to list all active subscribersHolger Hans Peter Freyther1-0/+29
This is only useful for small networks. List the IMSI and MSISDN of all active subscribers. Fixes: SYS#266
2014-03-23nitb/ctrl: Implement creating and deleting subscribersHolger Hans Peter Freyther1-0/+44
Sadly there is no proper foreign key relationship on the tables that related to the Subscriber. This means we can't use a DELETE with Cascade and need to delete everything by hand. To make things worse maybe the SMS/Paging code is still using the subscriber making the operation more dangerous. I had added NULL checks for sender_id/receiver_id at 30C3 so we should not crash in this situation. Fixes: SYS#274
2014-03-23nitb/ctrl: Add command to add/modify a subscriber to the databaseHolger Hans Peter Freyther1-0/+106
The test has been manually verified. Executing the select for the subscribers showed: sqlite> select * from Subscriber; 1|2014-03-23 12:12:46|2014-03-23 12:19:09|2620345||445567|1||0| This created a subscriber with the right IMSI, MSISDN and has it authorized. Fixes: SYS#275