Commit Graph

31 Commits

Author SHA1 Message Date
Vadim Yanitskiy d7e2337361 Revert "mobile: fix vty bind ip override"
This reverts commit c8de8cb1e1
(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-21 09:35:21 +07:00
Max c8de8cb1e1 mobile: fix vty bind ip override
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-11-19 17:20:11 +01:00
Vadim Yanitskiy d3394d13f2 mobile: use osmo_init_logging2 with proper talloc context
Change-Id: I231ac9987ff3c13fafcd272b7d9aae3938ab5972
2018-07-17 05:14:56 +07:00
Holger Hans Peter Freyther 32dec4236e mobile: Add LUA as debug category to the applications
Change-Id: Id2d266c48d30c06dfdc3b8c84d875038b43f2ad8
2017-12-03 12:58:52 +00:00
Holger Hans Peter Freyther a8726d977a mobile: Begin with a primitive interface on top of the code
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-12-03 12:58:52 +00:00
Holger Hans Peter Freyther 42888ed947 mobile: Switch from printf to LOGP statements
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-27 09:48:39 +00:00
Holger Hans Peter Freyther 52fbe66ca7 mobile: Do not exclude DGPS from the list of default categories
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-09 03:45:24 +00:00
Vadim Yanitskiy b7ff8b5893 mobile/main.c: fix deprecated call to msgb_set_talloc_ctx()
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-11-02 14:21:16 +00:00
Vadim Yanitskiy ae31c37d2b mobile/main.c: clean up config file selection logic
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-09 00:40:43 +03:00
Max 903e2515f5 Add arbitrary config file location support
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-09-07 18:08:03 +02:00
Harald Welte f95d518c63 mobile: Finally fix copyright notice
After 7 years it is about time...
2017-01-15 20:46:26 +01:00
Sylvain Munaut fc20a37cb3 host/mobile: Finish working support for the SAP interface
Patch mostly written by Nico Golde
and some cleanup/testing by Domonkos Tomcsanyi

Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-04-28 15:57:54 +02:00
Andreas Eversberg 25c5e8221d mobile: Improved exit of mobile process, reset phone
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.
2013-01-07 10:39:59 +01:00
Tim 43c588b6c6 l23: Add option for mobile-app to bind to other interfaces than localhost
Signed-off-by: Tim Ehlers <osmocom@ehlers.info>
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2012-03-01 22:45:51 +01:00
Holger Hans Peter Freyther 950f7d15e8 layer23: Call talloc_free unconditionally
talloc_free will check for NULL and return -1.

_talloc_free(void *pyr)
{
        if (unlikely(ptr == NULL)) {
                return -1;
        }
...
2011-12-11 15:47:30 +01:00
Andreas Eversberg 3426063f56 host/mobile: Adding (partly implemented) supplementary service support
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-13 20:25:20 +01:00
Andreas Eversberg fb7be589e6 host/mobile/sms: Adding SMS support for osmocomBB/mobile
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-13 20:25:20 +01:00
Andreas Eversberg 0be0680ab5 host/mobile: Adding memory leak debugging
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-11-13 20:25:19 +01:00
Andreas Eversberg 4d077b0e4c [mobile] Adding option to run as daemon 2011-09-04 19:37:57 +02:00
Andreas Eversberg c9927c72ea [mobile] Using socket application interface with mobile application
Use "-m" with mobile app, to use it in conjunction with LCR or other
applications.
2011-09-04 10:02:43 +02:00
Andreas.Eversberg aa4a819d68 layer23: Adapt to new logging API: fix calls to log_init
Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2011-07-28 21:30:50 +02:00
Andreas Eversberg af06f00219 [layer23] Adding "neighbour cell" logging category: DNB 2011-07-17 10:03:34 +02:00
Harald Welte 308f9e506e layer23: update to new GSMTAP API in libosmocore >= 0.3.1 2011-05-22 12:36:55 +02:00
Pablo Neira Ayuso 404f634406 src: use namespace prefix osmo_signal*
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-15 14:39:39 +02:00
Pablo Neira Ayuso ffcc29b5fb src: use namespace prefix osmo_fd* and osmo_select*
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-05-15 14:39:33 +02:00
Pablo Neira Ayuso ade79a0083 src: use new libosmogsm and include/osmocom/[gsm|core] path to headers
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-04-26 02:55:30 +02:00
Harald Welte cde3f7d2c6 mobile: Store N.ba files in same directory as config file
This should remove the last dependency to hard-coded system-wide /etc/osmocom
2011-03-02 11:00:59 +01:00
Harald Welte 4be57b9afd mobile: Use config file in ~/.osmocom/bb/mobile.cfg
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>
2011-03-02 10:35:39 +01:00
Andreas.Eversberg ee4fe18cda [layer23] Bugfix: Exit, if init function fails 2010-11-20 08:19:38 +00:00
Andreas.Eversberg f8903f06d1 [layer23] Cleanup of mobile application
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-14 11:52:57 +00:00
Andreas.Eversberg 6f2b172780 [layer23] Added support for multiple MS instances
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.
2010-11-13 18:45:09 +00:00