summaryrefslogtreecommitdiffstats
path: root/src/host/layer23/src/mobile
AgeCommit message (Collapse)AuthorFilesLines
2017-11-27mobile: Use bool to show started can only be true or falseHolger Hans Peter Freyther1-3/+3
The state handling is complicated and maybe it gets better by moving started to bool and then the rest to an enum. Change-Id: I6aef22e7bf954a8a4ecda980c2c558eb8c9180b7
2017-11-27mobile: Switch from printf to LOGP statementsHolger Hans Peter Freyther3-12/+12
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-24mobile/vty_interface.c: fix Kc / Ki confusionVadim Yanitskiy1-2/+2
Change-Id: Ibbd1d080896b5cadc3d4281fe8f839a103a35088
2017-11-14layer23 vty: fix prompts: insert space after '#'Neels Hofmeyr1-3/+3
"All" our VTY prompts have a space after the prompt. Also do that for '(ms)', '(test-sim)' and '(support)' prompts. Change OsmocomBB(ms)#exit to OsmocomBB(ms)# exit Change-Id: Id437279e0fa9845630a306958b404efa3b94b492
2017-11-09mobile: Make VTY logging commands available to the mobile appHolger Hans Peter Freyther1-0/+2
So far logging_vty_add_cmds wasn't called. The main.c might be shared with other apps so place it into the routine that is setting up the VTY. Change-Id: I3db9cf288bce12f51e36caad44e9bc34094638f4
2017-11-09mobile/gsm322.c: prevent buffer over-/under-runVadim Yanitskiy1-0/+3
Change-Id: Ic12587a6c6456b8663e5357cf68a22c6d1927a07
2017-11-09mobile/gsm322.c: prevent calling memset() with zero lengthVadim Yanitskiy1-0/+4
This change prevents a possibility of calling memset() with constant zero length parameter, and the corresponding compiler warning. Change-Id: I2d8d78474614939659a7f24d5007b1c890776b1a
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-09vty: skip installing cmds now always installed by defaultNeels Hofmeyr1-3/+0
vty_install_default() and install_default() will soon be deprecated. Depends: I5021c64a787b63314e0f2f1cba0b8fc7bff4f09b Change-Id: I300a4b34a2031fd09d110ef18375d140a6dca7ba
2017-11-08host/mobile: use osmocom_ms as talloc contextVadim Yanitskiy8-32/+21
As we use talloc, it's absurdly not to use the main feature of the library - hierarchical memory management. This change sets talloc context of all sub-allocated objects to related osmocom_ms instance. So, as soon as osmocom_ms instance is destroyed, all sub-allocated chunks are getting destroyed too. Change-Id: I6e3467ff739f3e6dc8dd60cc6d1fcd3f8e490ce9
2017-11-05mobile: get rid of unused variables / functionsVadim Yanitskiy3-28/+19
Change-Id: Id867ffed9b2b67025320d002e1e009e19c759a23
2017-11-05mobile/gsm411_sms.c: use secure gsm_7bit_(en|de)code_nVadim Yanitskiy1-2/+4
Since some 'gsm_7bit_*' functions were deprecated and replaced by more secure ones with the '_n_' postfix in names, it's better to use the updated functions. Change-Id: I58150e9b74699e5f54b9a83416ad8efcb2eccd8e
2017-11-05mobile/gsm48_mm.c: use secure gsm_7bit_decode_nVadim Yanitskiy1-4/+1
Since some 'gsm_7bit_*' functions were deprecated and replaced by more secure ones with the '_n_' postfix in names, it's better to use the updated functions. Change-Id: I4499b592a0dfea71462aed19fe641419d79b3cbd
2017-11-05mobile/gsm480_ss.c: use secure gsm_7bit_(en|de)code_n_ussdVadim Yanitskiy1-6/+2
Since some 'gsm_7bit_*' functions were deprecated and replaced by more secure ones with the '_n_' suffix in names, it's better to use the updated functions. Change-Id: If8a1983592f5800e3981f29962eb333ac9473f40
2017-11-05mobile/vty_interface.c: fix incompatible pointer type warningVadim Yanitskiy1-1/+1
According to the vty_app_info struct definition, the go_parent_cb() should return an integer, but not enum. So, this change fixes the following compiler warning: > warning: initialization from incompatible pointer type > .go_parent_cb = ms_vty_go_parent, Change-Id: Ib55e43eaaebdd9fe0d74a030b1057ae82804a77e
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-11-02mobile/vty_interface.c: add missing 'vty/misc.h' headerVadim Yanitskiy1-0/+1
This header contains declaration of the osmo_talloc_vty_add_cmds(). Change-Id: Icdafb22758897cfb67e249f37991f4af4213a5fa
2017-10-29mobile: register the talloc context introspection commandVadim Yanitskiy2-0/+4
This change registers the command, which is now implemented in libosmocore since the 463deef8c209dd7eb023ac70bf41fa9893ad35ed and allows to introspect mobile application's talloc context directly from the VTY interface. Change-Id: I979d64ae63d385f4fd082a4e3f981cbf5ab28338
2017-10-23mobile: clean up and share example configsVadim Yanitskiy1-0/+2
It is better to have a shared example config files directory, like other Osmocom projects do. Change-Id: I903f31a8afc518ac258cdaeaf76430de07f7edea
2017-10-23mobile/vty_interface.c: do not write 'exit' to configVadim Yanitskiy1-3/+0
Since we use indenting as means to implicitly exit child nodes, no need to write 'exit' at the end of each child node. Change-Id: I73b0f3926d766d21ca68c8e01b7fc70b2b4636c9
2017-10-23mobile/vty_interface.c: do not install default commandsVadim Yanitskiy1-50/+0
Since in recent version of libosmocore default commands (such as 'exit' and 'end') are being installed by default, no need to install them twice. This will crash the program. Change-Id: I82c8d04ccc7dc3f19589a79b859a2c993bd1d39c
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 supportMax2-11/+16
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-07-27vty_interface.c: use RPLMN from settings if presetVadim Yanitskiy1-0/+15
Previously, when testcard was attached via VTY interface, the initial values were used for MCC / MNC, LAC and TMSI, even if correct RPLMN settings were set. Change-Id: Ic70889cdb6be95f06d0c2df710524b4128b5f72b
2017-05-25host/mobile: use talloc for ms->name allocationVadim Yanitskiy3-25/+31
The approach of talloc memory management reduces memory usage, and prevents some buffer overflows, which were possible before. Change-Id: Icd6706117fdd7f1b3481b0e3817bbb3b31f12f60
2017-05-25mobile/gsm48_mm.c: strip unused variableVadim Yanitskiy1-2/+0
Change-Id: I2708628263bec4bc6bf53a357928e23609b40c64
2017-05-25mobile/gsm480_ss.c: gsm480_mmss_ind: return rcVadim Yanitskiy1-1/+2
Change-Id: Iabaccdbdfc5a5eb6424bd1603f405241650f13d8
2017-05-25mobile/gsm48_rr.c: fix BA range exceed checkVadim Yanitskiy1-1/+3
Change-Id: Ic2ebe9faeeda7ce812527962d209e6049f2dfc75
2017-05-25mobile/gsm480_ss.c: fix copy-paste errorVadim Yanitskiy1-2/+2
Change-Id: I23287c0f31bee9c1b710f17f932633d2c621dab0
2017-05-25mobile/gsm322.c: fix mcc/mnc typoVadim Yanitskiy1-1/+1
Change-Id: I4a3aaa0465598b17ccd30ec4cbeb90429216540e
2017-05-25mobile/gsm322.c: check fwrite() return valueVadim Yanitskiy1-9/+12
Change-Id: I74ad6e540c98ab4914e7a2ea725dd23f5a2fd034
2017-05-25host/app_mobile.c: do not exit in mobile_new()Vadim Yanitskiy1-6/+7
Previously, if there was any error during a new osmocom_ms structure allocation, the mobile_new() used to call exit() directly. Since we always check return value of this function it would be more correct to return NULL in any bad case. Change-Id: I9a594dd1d133f0c0740dc3bff41633f94099b593
2017-01-15Support Early Classmark SendingHarald Welte2-1/+7
If SI3 rest octets indicate early CM Sending is allowed, and the 'support' indicates we support it (which we now do by default), then send the classmark change message every time a LAPDm link layer is established.
2017-01-15Fix encoding of padding at end of CLASSMARK 3 IEHarald Welte1-2/+2
Contrary to e.g. SI rest octets, the padding at the end of a CLASSMARK 3 Information Element is padded with zeros, not with L. There is no 0x2b padding in this case.
2017-01-15mobile.c: Don't register 'end' command to CONFIG_NODEHarald Welte1-1/+0
The CONFIG_NODE already has an 'end' command, and recent versions of libosmocore actualyl check for conflicting/duplicate command registrations and make the application crash in this case.
2017-01-15mobile: Finally fix copyright noticeHarald Welte1-2/+2
After 7 years it is about time...
2016-01-18host/mobile: Improved SAP interface integrationЯницкий Ва дим3-3/+93
1) Now the SAP interface is selectable as SIM source using the 'sim sap' command in VTY. 2) SAP connection starts only if it is configured as SIM source. 3) Fixed sap_socket_path configuration r/w errors. Written-by: Яницкий Ва дим <axilirator@gmail.com> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2016-01-18mobile: Fix for "Added runtime selection of gps device"Яницкий Ва дим1-5/+4
The 'gps host HOST:PORT' line in the config file now is generated correctly. So that it is parsed correctly when loading the config on next startup. Also the gpsd port now is parsed as it should without a colon. Written-by: Яницкий Ва дим <axilirator@gmail.com> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2015-12-31autoconf: Migrate from INCLUDES to AM_CPPFLAGSHarald Welte1-1/+1
2015-04-28host/mobile: Finish working support for the SAP interfaceSylvain Munaut2-1/+5
Patch mostly written by Nico Golde and some cleanup/testing by Domonkos Tomcsanyi Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2014-06-15mobile: Use osmocom auth API instead of direct callsMax2-22/+20
Submitted-by: Max <max.suraev@fairwaves.co> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-12-24mobile/SS: Fixed bug in parsing of known supplemenary service codesAndreas Eversberg1-5/+5
Use correct variable to check if supplementary service code is known or not.
2013-05-23host/mobile: Fixup in error checking path of l23_app_initBhaskar1-3/+6
From: Bhaskar <niceguy108@gmail.com> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-05-23host/mobile: Fix trans_assign_trans_id() users error checkingSylvain Munaut2-2/+2
The returned value of trans_assign_trans_id() must be stored into a 'int' rather than uint8_t to allow proper testing of negative return values (errors). Thanks to Bhaskar <niceguy108@gmail.com> for the original patches. Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-05-23gsm48_mm.c: Bugfix: payload_len should be signed intBhaskar1-1/+1
As we later check if payload_len < 0, it should be signed, not unsigned.
2013-04-14host/mobile: Remove duplicate A5/1 support indication in vty 'show support'Sylvain Munaut1-1/+0
Patch-by: Martin Hauke <mardnh@gmx.de> Signed-off-by: Sylvain Munaut <tnt@246tNt.com>
2013-03-07support.c: fix typo in commentHarald Welte1-1/+1
2013-01-13layer23: Be sure to close mncc socket on exit of mobile instanceAndreas Eversberg1-5/+5
2013-01-10mobile: Fixed CLIR invokation / suppressionAndreas Eversberg1-2/+4
If "clip" is given at vty, CLIR must be suppressed, which results in presentation of caller ID digits, even if suppressed by network. If "clir" is given at vty, CLIR must be invoked, which results in restriction of caller ID digits, even if not suppressed by network. Note: This only work for outgoing caller ID. Incomming caller ID restriction cannot be suppressed.
2013-01-08misc: Fix typosDario Lombardo1-1/+1