For some strange reason, 'make distcheck' wants to do a 'make install'
without using DESTDIR. In this case, asking pkg-config for the
various directories as described in the libpcsclite.pc is of course
not working.
Change-Id: I87c68e8d14f8ddb6054178118ff1f96216483f5c
This adds a "libifd_remsim_client.so" PC/SC driver that can be
used to make normal PC/SC client programs (like pySim, sysmo-usim-tool,
osmo-sim-test, osmo-usim-auth, ...) talk to a remote SIM bank.
Change-Id: Ib8707c6e0e46407ab39a693adfec2fa71892f6ee
This ensures that libosmo-rspro is first built/installed, before the
programs that depend on it are.
This resolves warnings like
libtool: warning: '../../src/libosmo-rspro.la' has not been installed in '/tmp/osmo-remsim/osmo-remsim-0.2.2.59-2f5c/_inst/lib'
during the build process.
Change-Id: I928ff36406986cd0d3fe493f258864a38ce37798
This is a sample event-script that can be used in conjunction
with osmo-resim-client to trigger certain board-specific functions
such as modem reset on the OWHW.
Change-Id: I69f7f9b0c09421b8c14b909627ffe7b9f1acec77
I can occasionally see osmo-remsim-client-st2 get stuck when the Modem
(in this case a Quectel EC20) is performing PTS with the card.
In the log of osmo-remsim-client-st2 I can see:
SIMtrace => PTS req: ff 10 94 7b 00 00
SIMtrace -> 01 07 00 00 00 00 15 00 04 ff 10 94 7b 00 00 ff 10 94 7b
SIMtrace => PTS req: ff 10 94 7b 00 00
SIMtrace IRQ 01 04 00 00 00 00 15 00 13 00 00 00 00 00 09 04 0a 80 25 00 00
after which the communication doesn't proceed. After a long time, the
modem seems to retry without PTS and then proceeds with normal SIM card
communication.
Interestingly, both the firmware and a usbmon trace agree that the first
APDU header after the PTS is actually sent in an USB IN transfer:
-I- 0: computed Fi(1) Di(1) ratio: 372
-I- 0: computed Fi(9) Di(4) ratio: 64
-I- 0: send_tpdu_header: 00 a4 00 04 02
-I- 0: flush_rx_buffer (5)
usbmon shows 010600000000130001000000050000a4000402
It's unclear why the host program doesn't get the data from the IN
transfer. However, if multiple asynchronous IN EP URB are submited,
the problem can be reproducibly avoided. Let's do that.
Change-Id: I2fa5f71869b124b73e0c312befce1ca268e9a9a2
Closes: OS#4409
This is useful if we have external programs interfacing with
stdin/stdout of osmo-remsim-client-shell. We don't want that output
to hang in some buffer indefinitely, but rather have the lines flushed
immediately.
Change-Id: I6879f9f186ce87e0644b3d7868fc5ea031b82c62
If the server sends us ConfigClientBankReq with bankd_port == 0, then
this means that we shall disconnect from the bankd. Translate this to
the SRVC_E_DISCONNECT event towards the RSPRO connection FSM.
Change-Id: Idbfbfa0e84fa14dcb913b4dcbd943bc80ec175ac
Related: OS#4399
This is in preparation of other patches which will actually issue the
SRVC_E_DISCONNET event towards this FSM.
Related: OS#4399
Change-Id: I080f9e85987bbbe7aef84c32ce84b69d949ff561
If a slotmap is deleted via the REST API, don't only remove it from
the bankd, but also remove it from the client.
Change-Id: Ia2fc2a098471add56cb35e74639417d865704989
Closes: OS#4399
We may want to use the entire client code independent of the current
'main' portion, so let's introduce separation via API.
Change-Id: I6456317c3968551cd69ba379c746e4dd9690d02d
We may want to develop programs that include multiple instances of
a remsim_client. Let's remove the global variable 'g_client' and
instead de-reference the bankd_client using container_of() macros
Change-Id: I456fb633561b88912be2f78c3e0264794d921255
This is a remsim-client with an interactive 'shell', where the user
can type in C-APDUs in hex formats, which will be sent to the bankd /
SIM-card. Responses received from SIM Card via bankd will be printed
in return.
Change-Id: I636505fd9741833ccf5cbd1bcac30f7b9aa94425
There were quite a bit of API changes that hadn't yet been applied
to remsim_client.c (which was disabled and hence not compiled for
quite some time).
Change-Id: I0b3733f6851a951ee24ae87aa5db0ee8daa7a841
There are some situations where remsim-client would want to make its
surrounding system aware of, e.g. to take specific action.
This is particularly important on platforms where the simtrace2 firmware
doesn't have direct control over modem reset/poweron or the like.
Change-Id: I61cf4d93c669db137de801f8b147dcffaa6f3abd
Depends: libosmocore.git Ib24ac8a083db32e55402ce496a5eabd8749cc888
Closes: OS#4332
While the user may have specified a USB path at the command line
(or not), let's make sure we obtain the actual path after opening
the respective USB device.
Change-Id: I7e707c74647f4c5db06d495d369b2e69e2fc7c97
Rather, pass it around between functions and attach it to other state.
Also, make it a talloc contxt so other objects can be allocated off it.
Change-Id: I25f592581382238d5640c1f6326dec745f8d1d40
When introducing asynchronous USB support in Change-Id
Ic18690b3c2cbc5e99de0665c0b68b7555433b3cd, we accidentially
broke the --keep-running behavior, where even a disappearing USB
device will not terminate the remsim-client process.
Change-Id: I19cca9f7953d61058a36856b2fc4c97a3b93e15d
As both the bankd and the server already are in src/bankd and
src/server, respectively: Let's unify this and have the client
also in its own sub-directory.
Change-Id: I67a3a5941434f09f7099c2cdb19c126cea305a73
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
file.
Change-Id: I59980a78f0344602f9fa5b2277c99dfbf0b7815c
Finally, a libosmocore version with per-thread select loop fd sets
has been released, so we can update our version requirement here.
Change-Id: Ic2654b18fd1f00aa4c1ab01892ecaa48ad2ba29f
Closes: OS#4250
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.
Change-Id: I875f9d6d06d806fb9f9264840a65934fb0e99972
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.
Change-Id: Ifa615d239ec3ad6daebd8e99e4f7d5b99d32c0e1
Closes: OS#4330
* 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.
Change-Id: Ibe2266ffa473823e925d4e3afcf168353b11cdd8
Related: OS#4330
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
considerable speed-up.
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
at start-up.
Change-Id: Ic18690b3c2cbc5e99de0665c0b68b7555433b3cd
Closes: OS#4299
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
latest stage.
Change-Id: I20e6a3b7b4109b99c91a4921285cacb168c5796b
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.
Change-Id: Idf5a861f4dacbec3c664f4ced6e03d8662c73112
Closes: OS#4298
Related: OS#4299
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
Change-Id: If0130ab4b49ffcae6ab7a8b9926a6d9477eb3981
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
memory.
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().
Change-Id: Ia745ccb44c0d0224d1e7ab6b6da3713474111d41
rspro_client_fsm.c:180:9: warning: ‘rc’ may be used uninitialized in this function [-Wmaybe-uninitialized]
180 | return rc;
| ^~
Change-Id: I64b275b06b2aa40bd7c6e1dd42afba5ffebd7b00
Since Change-Id I55d5d61922053fd94e2b5a8cdf0d799b29feec98,
rspro_dec_msg() is no longer taking ownership of the msgb.
Change-Id: Ic1e9f35a2ae82b28dbb4b2ba850c257fa9629cbf
They were both called "server", which can be confusing. Now the
bankd-facing FSM has the identity of "bankd"
Change-Id: I2626f92202717880c678ce219a14872538713f4e