aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2024-03-23Add funding link to github mirrorHEADmasterHarald Welte1-0/+1
see https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/customizing-your-repository/displaying-a-sponsor-button-in-your-repository Change-Id: Ieedad968300828acd23a398ea088c3e2d8a336be
2024-03-23README.md: Major update / meaningful contentHarald Welte1-86/+75
Change-Id: Iec6a38bc34fdb0f9f0427df1c0fa53d513655a2a
2024-03-19debian/rules: don't compress pdfsOliver Smith1-0/+4
Adjust debian packaging as in other Osmocom projects to not compress the pdf files. Related: SYS#6855 Change-Id: I4372c2d93b317a9deaed3650941c7438accf9211
2023-10-30bankd: Use gsmtap_inst_fd2()arehbein2-1/+11
- Use gsmtap_inst_fd2() because gsmtap_inst_fd() is deprecated - Add TODO-RELEASE file Related: OS#6213 Change-Id: I2a7736d6fba795b2c479b2a0bc371b90f838ed61
2023-07-21bankd: Don't use 127.0.0.1 as default IP address for the serverHarald Welte2-7/+16
If remsim-bankd connects via 127.0.0.1 or any other loopback-routed IP address to the remsim-server, then the getpername() of remsim-server for the bankd will also render 127.0.0.1, and subsequently that IP address will be provided to remsim-client as address to connect to. In almost all setups, remsim-client will be running on a remote node and hence not able to reach remsim-bankd at 127.0.0.1. Let's turn the server-IP into a mandatory command line argument of remsim-bankd and not use a problematic default value. Change-Id: I3deb05e31cdf35232cf9a118d5a5fcdb5d0ab601
2023-07-18user_simtrace2: Fix uninitialized ifm->pathHarald Welte1-0/+1
Let's memset the entire ifm before calling osmo_libusb_open_claim_interface() Fixes: CID#307510: Uninitialized scalar variable (UNINIT) Change-Id: I2bd0dac76b6d028d10f12f3f58a2aee123ca8562
2023-07-18user_shell: Fix unchecked return value of osmo_fd_register()Harald Welte1-1/+5
Fixes: CID#307519: Unchecked return value (CHECKED_RETURN) Change-Id: I68ed44464573b9a6fecd07cf13fd2d6f4a1013bb
2023-07-18user_ifdhandler: Fix missing check of osmo_fd_register return valHarald Welte1-1/+2
Fixes: CID#307514: Unchecked return value (CHECKED_RETURN) Change-Id: I99d7254b6cc3bf5ead800dafabc77a965857911c
2023-07-18rspro_client_fsm: Fix integer overflow calculating re-establishment delayHarald Welte1-1/+1
Fixes: CID#307493: Unintentional integer overflow (OVERFLOW_BEFORE_WIDEN) Change-Id: Ib1cca5ac0d27807936a52e0c013f0442350ecc00
2023-07-17checkpatch.conf: ignore rspro generated filesOliver Smith1-0/+2
Change-Id: I6e5d57f6669f7d1aff00898f1375843b53cd9b9f
2023-07-17src/rspro: regenerate to fix misleading indentsOliver Smith5-7/+7
After upgrading our CI environment to use Debian 12 with GCC 12, it complains about the following misleading indentations. Regenerate the rspro code with asn1c I2260df8f8ab8eaf5c2aac3c330f87dba4691c01e to be able to compile with --enable-werror again. The asn_internal.h file is left unchanged to preserve changes from I14fff863449971024002e0d5465fb7a964d67095. Related: OS#6057 Change-Id: Icc2e8da7232a93b04ac8f23800380ca9317bd60f
2023-06-11another csv example for our usb CCID readerStephan Skrodzki1-0/+6
Change-Id: Iec17af23ee9c752facb88b4a497b42678af6065d
2023-05-31remsim_client: Fix custom ATR '-a' optionDaniel Willmann1-0/+1
So far the option only parsed the hexstring into the atr buffer, but failed to update the length (from the default value of 2). Also set atr.len so sending custom ATRs works. Change-Id: I5deb0a432c05ab0bab5081a2812f6718d4a2ac33
2023-05-26systemd: depend on networking-online.targetOliver Smith3-0/+6
Related: SYS#6400 Change-Id: Ifbac18a38e086e42c67499b7818cdf08629d0000
2023-04-25debian: set compat level to 10Oliver Smith2-3/+3
Related: OS#5958 Change-Id: Ib45ad7c44cdefa4c5acab2da09f24796253a133d
2023-02-06bankd_main: Avoid uninitialized variableHarald Welte1-0/+1
There's not really any ResultCode for the kind of error we encounter, but sending some uninitialized memory clearly is not the right way either. >>> CID 307528: Uninitialized variables (UNINIT) >>> Using uninitialized value "res". Closes: CID#307528 Change-Id: I29f911cb2c8ad67cf1ce4486e1583612fb0b98a6
2023-02-06rspro_server: Handle ipa_server_link_open() error caseHarald Welte1-5/+14
>>> CID 307530: Error handling issues (CHECKED_RETURN) >>> Calling "ipa_server_link_open" without checking return value (as is done elsewhere 4 out of 5 times). while at it, also add a missing pthread_rwlock_destroy() call which was missing in the existing ipa_server_link_create() error path. Closes: CID#307530 Change-Id: Ic32d53a236b80711651fb4ee196ac3b95148e61f
2023-02-06remsim_server: handle osmo_fd_register() failure caseHarald Welte1-2/+6
>>> CID 307531: Error handling issues (CHECKED_RETURN) >>> Calling "osmo_fd_register" without checking return value (as is done elsewhere 83 out of 97 times). Closes: CID#307531 Change-Id: I7c2448303fba7caa27df65ac5f4d91ddf232ceb6
2023-02-06rest_api: strtoul canot return negativeHarald Welte1-1/+1
>>> CID 307538: Control flow issues (NO_EFFECT) >>> This less-than-zero comparison of an unsigned value is never true. "map_id < 0UL". Closes: CID#307538 Change-Id: Ic5019e216dd7b26be0bd988df218a2cb5775e411
2023-02-03Fix various 'uninitialized variable' bugs reported by coverityHarald Welte1-0/+2
The asn1c-generated struct definitions have an automatic _asn_ctx member, and we never initialize that so far. Let's do an explicit memset(). Closes: CID#307545, CID#307543, CID#307541, CID#307536, CID#307536 Closes: CID#307534 Change-Id: I217ebbc92935aefaf55d19a14c93a24e5b8fce64
2022-12-08packaging: osmo-remsim-apitool needs py3-requestsOliver Smith2-1/+2
Related: OS#5817 Change-Id: I3b8f86b03aee145e0b0faf0394ab641666710bea
2022-11-19rspro_client: implement re-establish delayJames Tavares2-12/+118
- add new SRVC_ST_REESTABLISH_DELAY state with delay stipulated by table k_reestablish_delay_s[], that implements a simple exponential-like back-off with an upper bound. - new function srvc_do_reestablish() is used to initiate a reestablish, and apply the appropriate delay, if any. - takes external delays (such as TCP connect() delay) into account, and does not double-penalize. - delay is reset to shortest possible if there has been no reestablish initiated in a long time (2x greater than our longest delay). Allows for fast reconnects even if a delay was used to connect. - addresses issues https://osmocom.org/issues/5348 and https://osmocom.org/issues/5610 Change-Id: I86cdc3ba37482e6577b429194d273a2399f32208
2022-11-19bankd, client, server: add -L option to disable log coloringJames Tavares3-7/+22
When the stderr of these services is sent to syslog, for example by using systemd's StandardError=syslog, syslog's escaping of ANSI color ESC sequences in log messages really clutter the log files. This option allows log coloring to be disabled on the command line. Change-Id: I6955b0af1ceb11a4029383e32bb298ee8da7503f
2022-11-19bankd: Add GSMTAP functionality for SIM trafficJames Tavares7-15/+175
If a --gsmtap-host (-g) address is specified on the command line, trace SIM ATRs and APDUs to the given IP. If --gsmtap-slot (-G) is provided, limit tracing to the specified bank slot number. This feature may be useful when diagnosing issues with the remote SIM framework. Added new log category: DGSMTAP Also, cleaned up alignment in bankd --help output and removed unused -o option. Change-Id: I05b599858d8758633aa56c3f12f258c27cf42d08
2022-11-15remsim-client-st2: Proper error if not all endpoints can be foundHarald Welte1-0/+6
Let's avoid a segfault and rather print a proper error message in case we cannot find all the required USB endpoints when opening the user-specified interface/config/device. This can happen if the device is currently in DFU mode, or a completely wrong device/interface was specified. Before this patch: Assert failed rc == 0 user_simtrace2.c:305 After this patch: DMAIN ERROR user_simtrace2.c:448 specified USB dev/config/interface doesn't have at least one IN, OUT and IRQ_IN endpoint Closes: OS#5416 Change-Id: Icfcc482fff106a232c5125ed8ab463ecc13824ae
2022-11-14client: set the local/remote mode before inserting cardJames Tavares1-4/+4
- avoids a race with the modem Change-Id: I7b0640b929e174e8dfdcc86947fa409e4acf338f
2022-11-14bankd: edge detect RESET and VCC indicationsJames Tavares2-4/+28
- perform edge detection on RESET and VCC client indications to filter out duplicate resets - prior to this change, unrelated changes in the client slot status indication (such as CLK change) could trigger duplicate resets - these resets could happen in rapid succession and lead to reader libusb communication errors that lock-up the PC/SC daemon - a drop in VCC will always induce a cold reset, even if a warm reset is already in progress. - overall, this change better matches what the hardware would do Change-Id: I36d30d176c0a03d97554112ca712d658d986c752
2022-11-14ignore libtool artifacts from cross-compile environmentsJames Tavares1-0/+1
Change-Id: I549ee65e72fed2d1599b3e2dfc7a37f02a8f80e6
2022-11-13bankd: add missing -p short form optionJames Tavares1-2/+2
Change-Id: I44969c70612a25184fc51b695c7dbf97865fb116
2022-07-24bankd: Don't log an "Error" if slotmap is removedHarald Welte1-1/+4
removing a slotmap and the related client disconnect are perfectly normal operation. Don't print the word Error in the log in such cases, it just confuses the user. Closes: OS#5629 Change-Id: Ie39d35fd348fdf3dd53c860dc830aac794a3ead5
2022-07-24client: Option to ignore any ATR sent by bankdHarald Welte5-5/+24
This introduces an --atr-ignore-rspro command line argument, which will make the remsim-client ignore any RSPRO setAtrReq it receives from the remote bankd. The purpose of this is to modify the capabilities advertised by the card towards the UE (modem/phone). For example, by modifying the ATR one can disable/constrain the UE from using higher bit rate support, or disable the use of logical channels. Change-Id: I930293f7b637dba60d9dd6d2254f4524f831b491
2022-07-24client: Fix '-a' command-line argument for ATRHarald Welte1-1/+2
The argument existed (as a long option), and was documented in the user manual - but it wasn't printed in the help message, nor was it present in the getopt_long() string. Let's fix that. Change-Id: Icfb74597dd813cee8b48b8dcf520fdd1c954338a
2022-07-15bankd: Open PC/SC by default in EXCLUSIVE modeHarald Welte4-3/+31
Let's open the cards in EXCLUSIVE mode, we don't want other applications tinkering with the card state while we have a bankd worker running on it. This change also means that no two bankd workers can trip on each other accidentially anymore. Related: OS#5527 Change-Id: I43a1c8c7bd1c0124ee5f605e2e5b04ed8f7836ab
2022-07-15client: Log TPDU/ATR/PTS/slotStatus at INFO or NOTICE levelHarald Welte1-0/+18
Closes: OS#5615 Change-Id: I9b54a53ef2809c9bfd110636a9ccb0c0d8c90cda
2022-07-15fix rpm spec file for packacing of apitoolHarald Welte1-1/+1
[ 62s] RPM build errors: [ 62s] line 222: multiple %files for package 'osmo-remsim-server' This fixes a bug introduced in I11d779f66833b5294ffeb422ce6b2a705719a899 Related: OS#5612 Change-Id: If8460b41f0e9fa988215acdf3bda829540c8d599
2022-07-13debian/control: Don't use misc:PackageHarald Welte1-2/+2
dpkg-gencontrol: warning: package osmo-remsim-doc: substitution variable ${misc:Package} used, but is not defined dpkg-gencontrol: warning: package osmo-remsim-doc: substitution variable ${misc:Package} used, but is not defined and indeed, the variable seems to substitute to an empty string, resulting in $ apt-cache search osmo-remsim-doc osmo-remsim-doc/unknown 1.0.0 all PDF documentation Change-Id: I58d267ea61dd9d71e7b9e630e71fd2f64f274569
2022-07-13Install + package remsim-apitool as separate sub-packageHarald Welte8-20/+45
As the script depends on python3, let's put it into a new osmo-remsim-apitool package. As we're installing the tool system-wide, rename it from remsim-apitool.py to osmo-remsim-apitool. Closes: OS#5612 Change-Id: I11d779f66833b5294ffeb422ce6b2a705719a899
2022-07-11bankd: Log not just ModemToCard but also CardToModemHarald Welte1-0/+1
This way we'll get a full trace of commands and repsonses. Right now the log only shows one direction which is a bit odd. Related: OS#5615 Change-Id: Ia2de0b850ce78074a411cf0edebfb3ad19253d34
2022-07-11main_fsm: Log bankd config (ip/port/bank_id/slot_nr) + disconnectHarald Welte1-0/+3
Closes: OS#6513 Change-Id: I30a814ba95eb9c545220a1513805f41ccb5acb42
2022-07-11bankd: log BankID:SlotNr in every log lineHarald Welte1-1/+1
It's relatively inconvenient having to mentally map the slot-number to a thread-id on every (re)connect to correlate the logs. The logs should contain the Bank/Slot number they relate to. Closes: OS#5611 Change-Id: I84879609781a301338dacde7ff495632e3af08b9
2022-06-18update git URLs (git -> https; gitea)Harald Welte2-3/+3
Change-Id: I780bfbcd4afefdc9122bfe696006dec2fdccd3f4
2022-05-05rspro_client_fsm: Log clientConnectResult != okHarald Welte2-0/+4
This should aid debugging. Related: SYS#5950 Change-Id: I8f584640758be0cceab61dcb333c81374da3288b
2022-05-05bankd: Log more clearly if we fail to open a PC/SC readerHarald Welte1-1/+7
Related: SYS#5950 Change-Id: I424f585a8a37f21806898e59e350201119645a21
2022-05-03server: Fix various error paths if startup failsHarald Welte3-1/+7
Don't segfault or use heap after free if osmo-remsim-server cannot fully initialize, e.g. due to ports already in use. Change-Id: I558e6a0ea089a779f916aa5576341d1c55da1271
2022-05-03cosmetic: various typo/spelling fixesHarald Welte4-6/+6
Change-Id: Idc4db138d83be0c7c0b0ff6dfbb9f094b21d6fa9
2022-05-03encode actual hostname in RSPROHarald Welte3-6/+16
The RSPRO ComponentIdentity includes a 'name' for each remsim component. So far we always used "fixme-name" instead of something meaningful. Let's use the hostname of the system instead. Change-Id: I14925f16ae242dae89fa853a2fe31c5c1b32981d
2022-05-03bankd: Better error messages during start-upHarald Welte2-5/+16
If something goes wrong during startup (missing CSV file, ...) let's print a more human-readable error message than just asserting. Change-Id: I95222d44eefc60ad3857fa70ccebbacce60820df
2022-05-03server: Detect duplicate client/bankd connection; drop new onesHarald Welte4-13/+61
we're dropping the current (new) connection as we don't really know which is the "right" one. Dropping the new gives the old connection time to timeout, or to continue to operate. If we were to drop the old connection, this could interrupt a perfectly working connection and opens some kind of DoS. Related: OS#5527 Change-Id: I00387dbc19d689415470e2f08df08a47a78b81c0
2022-05-03server: Fix segfault in error path (client component ID != client)Harald Welte1-0/+2
When we terminate the FSM instance, we must immediately return. Change-Id: I8dff45daa6584ed111a8469e7b3bf90e7c939612
2022-04-27bankd: Differentiate log levels, not everything is DEBUGHarald Welte1-4/+4
Change-Id: If3699642fee2d5d92fb164f7f9c41ccff02007cc