Introduce a dedicated structure for the parsed command line options
converted into the configuration for the client. This reduces the
amount of spaghetti code and paves the way for a later VTY / config
Finally, a libosmocore version with per-thread select loop fd sets
has been released, so we can update our version requirement here.
In Change-Id Idf5a861f4dacbec3c664f4ced6e03d8662c73112 we introduced
the use of libosmo-simtrace2 (from simtrace2.git). Our configure
script checks for it properly, but the debian/control wasn't updated.
If a client is sending us a clientSlotStatusInd indicating that
the modem has switched off VCC or activated RST, bankd will
now issue a respective PC/SC command to perform a cold or warm
reset of the card.
* enable generation of CEMU_USB_MSGT_DO_STATUS on IRQ endpoint
* translate that to clientSlotStatusInd towards bankd
This will allow bankd to understand when to reset the card as
requested by the modem.
By using the non-blocking / asynchronous libusb via the newly-
introduced libosmousb (integration to libosmocore select loop),
we can not only get a cleaner code-base, but we also get a
In my tests with a Quectel E25 and a sysmoUSIM-SJS1 card,
I am down from 41.4s to 4.7s for the initial reading of the SIM
Depends: libosmocore.git I656a1a38cbb5b1f3a9145d2869d3b4d0adefcae3
When we call a script for verification of our source code, let'sn
not check the (old, previous) code from the ./deps directory, too.
We should either only verify our own code (solution implemented here)
or alternatively verify only after we updated all dependencies to the
We originally imported a copy of [most of] the code of
simtrace2.git/host into this repository. That was a quick hack to get
things going, but now that simtrace2.git is providing a shared library
of simtrace2 utility functions, let's migrate over to it.
At the same time, some functions (libusb_util) have been migrated to
libosmousb (a new library in libosmocore.git), so we must add that
as new dependency, too.
This performs the minimally required changes and is *not* a proper
port to the libosmousb osmocore select loop integration, whcih will
follow in a separate patch.
Depends: libosmocore.git I656a1a38cbb5b1f3a9145d2869d3b4d0adefcae3
So far the wokrer used to sleep 10s and only check in those intervals
if [finally] a mapping had arrived. Using SIGMAPADD, we can
directly break the worker out of its select() call and hence make
it pick up a new mapping instantaneously.
This also makes RemsimBankd_Tests.TC_removeMapping_connected() pass
We cannot rely on the implicit IPA keepalive FSM termination, as that
somehow gets the termination order wrong and we end up accessing free'd
Let's handle the termination explicitly: We register a callback with
the IPA keepalive FSM, and once that callback gets hit, we ask the
core to *not* terminate the FSM implicitly. We are anyway terminating
it explicitly in st_reestablish_onenter().
There was a lot of similarity between the bankd_client_fsm (for the
client->bankd RSPRO connection) and the rspro_client_fsm (for the
client->server and the bankd->server RSPRO connections).
With the last few commits introducing the missing features to
rspro_client_fsm, we can completely obsolete bankd_client_fsm and
further simplify the codebase.
This way we can easily guarantee that RSPRO transmit will only happen
in the fully established state, and that violations of that rule will
generate error logs by means of osmo_fsm core logging code.
So far, the rspor_client_fsm immediately attempted to establish a
TCP connection to the RSPRO server when calling server_conn_fsm_alloc().
Let's make this implicit auto-connect an explicit request to connect
using the newly-introduced SRVC_E_ESTABLISH.
Let's also change all three existing users of server_conn_fsm_alloc()
to send SRVC_E_ESTABLISH after calling it.
The rationale of this change is to use the same rspro_client_fsm also
for the client->bankd RSPRO connection, where we don't want to
automatically connect at startup, but connect only at a later point, after the
server a has told us to do so.
In Change-Id I77c86455f9c36c16271bc8e7f8f3f72d682d23fd for some
reason libosmo-rspro0.install was not renamed/moved but deleted,
causing failures to build debian packages
These commands are introduced to enable the server to request the
full reset of all state in a client or bankd. This is particularly
useful in TTCN-3 tests, where we typically want to reset the state
Otherwise the loop for SIGMAPDEL delivery code will match any
unused worker for bank_id=0/slot_nr=0, which is not what we want.
This also makes repeated RemsimBankd_Tests.TC_removeMapping_connected
runs work reliably.
It's a bit of a matter of taste whether we should simply log + ignore
if the Client of a removeMappingReq doesn't match what the bankd
currently has configured. I chose to reject it, as a new createMapping
for the same bandk+slot will overwrite any existing mapping anyway,
at least as of I83e319d22896b881c0d882542842f500075aa546
As explained in OS#4278, a remsim-bankd currently doesn't recover after
a remsim-server resetart, since old mappings remain in the bankd, and
the server has no chance of removing them.
To avoid this problem, a createMapping now always implicitly removes
any existing mapping that may exist for the given bankdSlot.
It is customary in the IPA protocol that a a server side
responds with an ID_ACK if the client sends an ID_ACK. Due
to the lack of any protocol specification, it's unclear why
exactly, but we know it does happen.
osmo-remsim-bankd so far failed to implement this, which is
not directly a problem as the only user (osmo-remsim-client)
didn't care. However, when executing TTCN3 test cases,
the IPA_Emulation expects that ID_ACK and related test fail.
ipa_client_conn_destroy() really only destroys the object, but not close
the underlying file descriptor. This leads to old connections
lingering around, which in turn (in case of the remsim client) will
occupy banksim worker threads.
for the osmo-remsim-client-st2 client,
the command line arguments bankd-port and slot-nr have been renamed
to server-port and client-slot in the opts options, but not in the
this is now fixed.
currently the bankId, clientId, and slotNr are passed as strings.
this is not the format expected by the server, which returns 400
the issue was that the python tool did not parse the arguments as
Initially it seemed like a good idea that rspro_dec_msg() takes care
of freeing the input msgb when generating a new decoded output
structure. However, in reality this made the implementation of
every caller more complicated, as it had to treat messages going into
rspro_dec_msg() differently than messages going elsewhere.
Adding to that, not every caller got it right, and the comments were
disagreeing about what happens to msgb ownership in erroneous cases.
We basically must ensure that all code paths *except* the path leading
to rspro_dec_msg() must call msgb_free(msg). This was not the case
in two situations, as fixed now.
respro_dec_msg() takes ownership of the input msgb in both
successful and unsuccessful cases, so we must not call talloc_free
on the resulting msgb.