- Use gsmtap_inst_fd2() because gsmtap_inst_fd() is deprecated
- Add TODO-RELEASE file
Related: OS#6213
Change-Id: I2a7736d6fba795b2c479b2a0bc371b90f838ed61
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
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
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
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
>>> 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
>>> 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
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
- 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
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
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
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
- 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
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
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
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
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
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
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
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
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
If something goes wrong during startup (missing CSV file, ...)
let's print a more human-readable error message than just asserting.
Change-Id: I95222d44eefc60ad3857fa70ccebbacce60820df
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
If a bankd connects to the server from 127.0.0.0/8, then clients will
not be able to reach it unless they also run on localhost. Warn the
user.
Change-Id: I5446752961b039dad54aec981c1df4814779f765
If one component connects to another component, verify that the
remote component type (bank/server/client) matches our expectation.
This is important in order to detect a misconfiguration of port numbers,
for example.
Closes: OS#5548
Change-Id: I89a4fc4331e8a0622f8f146c7fc235d34d990497
The RSPRO.asn protocol defines the ranges 0..1023 for slot, bank
and client IDs. Don't make misleading claims in manual and/or
help messages.
Change-Id: Id383b2bea4c014e7b61ae02e7062ba4db5c2dc20
Remove the paragraph about writing to the Free Software Foundation's
mailing address. The FSF has changed addresses in the past, and may do
so again. In 2021 this is not useful, let's rather have a bit less
boilerplate at the start of source files.
Change-Id: I2e98f89f6738d03c45a2106820af0912692093f3
When osmo-remsim was originally developed, libosmocore logging was
not yet thread-safe. This meant that the worker threads of remsim-bankd
and remsim-server could not log via the libosmocore logging framework
but directly used stderr/stdout, which produced rather inconsistent log
output.
However, since 1.3.0, libosmocore has received support for
multi-threaded applications. Let's make use of this and consistently
use it in remsim-server and remsim-bankd. This obviously also means
adding some more log categories.
Change-Id: I7bd5264c559b756927046563a2d00c54826bee9b