summaryrefslogtreecommitdiffstats
path: root/src/host/layer23/src/mobile/main.c
AgeCommit message (Collapse)AuthorFilesLines
2018-11-21mobile: use VTY bind addr from config, deprecate cmd line optionsVadim Yanitskiy1-16/+12
This change revives the main idea of: Change-Id: I32517567847fd5c54b1742f18bf409ff81e316fa to stop ignoring the VTY bind address from the config file. Furthermore, it deprecates (and disables) both 'u' and 'v' command line options, because they are redundant. Change-Id: I99e0ec1717edd29b3be231be86616cc7effe5d95
2018-11-21mobile: abort in case of argv handling errorsVadim Yanitskiy1-3/+10
The process should be aborted if a non-existing command line option or an incorrect parameter value is passed. Change-Id: Ib656ad12f12429ed15dc2a1554901ffa51148ff6
2018-11-21Revert "mobile: fix vty bind ip override"Vadim Yanitskiy1-4/+3
This reverts commit c8de8cb1e126a18c0269571fba38310589dd9273 (Change-Id I32517567847fd5c54b1742f18bf409ff81e316fa by Max), because several problems were introduced, in particular: a) Help message of mobile application is broken: "The VTY IP to telnet to. (default (null))", "The VTY port number to telnet to. (default 127.0.0.1)". b) Default VTY bind addres != parsed from the config file. c) The (vty_ip == NULL) is resolved only when an external MNCC handler is used, otherwise NULL is passed to l23_app_init(). Change-Id: Ic63a4eb828ff32d3744886b4f5f6f5019c798620
2018-11-19mobile: fix vty bind ip overrideMax1-3/+4
Previously the vty bind config parameter was always ignored. Fix this by using proper default value from the config unless it's explicitly set via command-line parameter. Change-Id: I32517567847fd5c54b1742f18bf409ff81e316fa
2018-07-17mobile: use osmo_init_logging2 with proper talloc contextVadim Yanitskiy1-13/+5
Change-Id: I231ac9987ff3c13fafcd272b7d9aae3938ab5972
2017-12-03mobile: Add LUA as debug category to the applicationsHolger Hans Peter Freyther1-1/+1
Change-Id: Id2d266c48d30c06dfdc3b8c84d875038b43f2ad8
2017-12-03mobile: Begin with a primitive interface on top of the codeHolger Hans Peter Freyther1-1/+1
We want the script interface to interface through a primitive interface. This will allow to move it to a different thread or a process in the future. The script interface will just use the primitives. It is not clear how "sap" will be used here. I am keeping it at 0 right now. The first primitive is starting a timer with a request and then getting an indication as a response. Change-Id: Id2456b7fae35546553c4805f12a40c0812d9255c
2017-11-27mobile: Switch from printf to LOGP statementsHolger Hans Peter Freyther1-1/+1
Add a mobile application logging category and replace printf with a LOGP. The code is sadly still using exit in the middle of handling. Change-Id: I71e7f6e6375a485b45bad76ada2be17b0901577d
2017-11-09mobile: Do not exclude DGPS from the list of default categoriesHolger Hans Peter Freyther1-1/+1
I don't remember why we parse the categories like this. First if the mobile doesn't use a subsystem there is no harm to have it enabled, second the default levels can be adjusted for all apps and third we have the VTY to reconfigure these logging targets. Change-Id: Ia874b7ed127026b8395072a3bac2aed9944b1cce
2017-11-02mobile/main.c: fix deprecated call to msgb_set_talloc_ctx()Vadim Yanitskiy1-1/+2
The usage of msgb_set_talloc_ctx() was deprecated many days ago, so it's time to use the proper replacement. Change-Id: I56440d8e2152c4bb2e5ad677f88c61742d2ad9ca
2017-09-09mobile/main.c: clean up config file selection logicVadim Yanitskiy1-9/+15
The 903e2515 introduced the following problems: - The home variable is allocated dynamically by talloc, but not being freed. There is no need for dynamical memory allocation, as the getenv() returns a pointer to a value in the environment or NULL. - In case of custom configuration file, a pointer to a part of stack (not heap) is passed to talloc_free(). This may cause unexpected behaviour of segfault. Let's fix both of them. Change-Id: I79cc3b954c3018b7e780f6351c3030c3062470b5
2017-09-07Add arbitrary config file location supportMax1-10/+14
All other Osmocom projects use '-c' command line option to specify the location of config file. Let's do the same with fallback to existing implicit config file name logic. Also print config file path and vty host on startup. Change-Id: Idaac3ff8d1f8541e00c45290db948a67bb899311
2017-01-15mobile: Finally fix copyright noticeHarald Welte1-2/+2
After 7 years it is about time...
2015-04-28host/mobile: Finish working support for the SAP interfaceSylvain Munaut1-1/+1
Patch mostly written by Nico Golde and some cleanup/testing by Domonkos Tomcsanyi Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-01-07mobile: Improved exit of mobile process, reset phoneAndreas Eversberg1-12/+35
If mobile phone has started, it is reset after shutdown. This ensures that the phone is not transmitting anymore, especially while shutting down in dedicated mode. Using CTRL+c: The first signal causes initiating of shutdown with detach procedure. The second signal causes initiating of shutdown without detach procedure. The third signal will exit process immidiately. (in case it hangs) Using CTRL+z: The first signal causes initiating of shutdown without detach procedure. A subsequent CTRL+c would exit process immidiately.
2012-03-01l23: Add option for mobile-app to bind to other interfaces than localhostTim1-3/+10
Signed-off-by: Tim Ehlers <osmocom@ehlers.info> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-12-11layer23: Call talloc_free unconditionallyHolger Hans Peter Freyther1-5/+2
talloc_free will check for NULL and return -1. _talloc_free(void *pyr) { if (unlikely(ptr == NULL)) { return -1; } ...
2011-11-13host/mobile: Adding (partly implemented) supplementary service supportAndreas Eversberg1-1/+1
Use VTY to request your extension number form OpenBSC: en service 1 *100# Written-by: Andreas Eversberg <jolly@eversberg.eu> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-13host/mobile/sms: Adding SMS support for osmocomBB/mobileAndreas Eversberg1-2/+6
Both MO and MT SMS are supported. Transmission an reception can be controlled via VTY: en sms 1 <destination> <text> All received SMS are stored in "~/.osmocom/bb/sms.txt". SMS transmission is performed on SAPI 3 datalink, using DCCH or ACCH. Written-by: Andreas Eversberg <jolly@eversberg.eu> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-11-13host/mobile: Adding memory leak debuggingAndreas Eversberg1-7/+35
When mobile exits, a list of allocated memory chunks are dumped to stderr. This helps to find talloc_free / msgb_free leaks. During process, a SIGUSR1 or SIGUSR2 can be used to dump currently allocated memory chunks. Written-by: Andreas Eversberg <jolly@eversberg.eu> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-09-04[mobile] Adding option to run as daemonAndreas Eversberg1-1/+15
2011-09-04[mobile] Using socket application interface with mobile applicationAndreas Eversberg1-2/+14
Use "-m" with mobile app, to use it in conjunction with LCR or other applications.
2011-07-28layer23: Adapt to new logging API: fix calls to log_initAndreas.Eversberg1-1/+1
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-07-17[layer23] Adding "neighbour cell" logging category: DNBAndreas Eversberg1-2/+2
2011-05-22layer23: update to new GSMTAP API in libosmocore >= 0.3.1Harald Welte1-9/+7
2011-05-15src: use namespace prefix osmo_signal*Pablo Neira Ayuso1-1/+1
Summary of changes: s/signal_cbfn/osmo_signal_cbfn/g s/register_signal_handler/osmo_signal_register_handler/g s/unregister_signal_handler/osmo_signal_unregister_handler/g s/dispatch_signal/osmo_signal_dispatch/g
2011-05-15src: 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-04-26src: use new libosmogsm and include/osmocom/[gsm|core] path to headersPablo Neira Ayuso1-4/+4
This patch changes include paths to get osmocom-bb working with the current libosmocore tree. Among all these renames, you can notice several tweaks that I added on purpose, and that require some explanation, they are: * hexdump() in osmocon.c and osmoload.c has been renamed to avoid clashing with hexdump() defined in libosmocore. * gsmmap now depends on libosmogsm. Actually I had to cleanup Makefile.am because I was experiencing weird linking problems, probably due to a bug in the autotools. With the change included in this patch, I got it compiled and linked here correctly. This patch has been tested with the phone Motorola C123 and the following images files: * firmware/board/compal_e88/hello_world.compalram.bin * firmware/board/compal_e88/layer1.compalram.bin Using the osmocon, bcch_scan and mobile tools. Signed-off-by: Pablo Neira Ayuso <pablo@gnumonks.org>
2011-03-02mobile: Store N.ba files in same directory as config fileHarald Welte1-1/+6
This should remove the last dependency to hard-coded system-wide /etc/osmocom
2011-03-02mobile: Use config file in ~/.osmocom/bb/mobile.cfgHarald Welte1-2/+15
We don't need root permission and a system-wide config file in /etc/osmocom Based on a patch by Pierre Pronchery <khorben@defora.org>
2010-11-20[layer23] Bugfix: Exit, if init function failsAndreas.Eversberg1-1/+3
2010-11-14[layer23] Cleanup of mobile applicationAndreas.Eversberg1-144/+10
All functions for handling mobile instances and mobile relevant parts are moved to mobile/app_mobile.c, the mobile/main.c and mobile/mncc.c become a simple out-of-the-box mobile application. (making calls) The mobile/main.c can be replaced easily by a different application now. this application may have it's own call control implementation (layer 4). Full configurations via VTY is still possible and required in this case.
2010-11-13[layer23] Added support for multiple MS instancesAndreas.Eversberg1-0/+325
To create another instance: 'ms <name> create' To remove an instance: 'no ms <name>' If no instance exists, 'ms 1' is created automatically on startup. Each instance can be enabled / disabled by using 'shutdown' or 'no shutdown'. Multiple instances may share the same layer2 socket (same phone hardware), but in this case only one instance can be enabled at the same time. This makes it much easier to select different settings without modifying them. A 'shutdown' initiates the IMSI detach procedure before shutdown is completed. A 'shutdown force' will immidiately shutdown. There is no need to restart the software anymore, if fundamental settings are changed. In this case, a 'shutdown' followed by a 'no shutdown' will do the job. If you already have an old osmocom.cfg, you need to "no shutdown" it. Everything else behaves as before.