Commit Graph

19 Commits

Author SHA1 Message Date
Harald Welte 7cd8b76577 bankd: Avoid useless dependency to libosmosim
Change-Id: I015b1a49dbdd19d030acd929b5a935021b77cefa
dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/osmo-remsim-bankd/usr/bin/osmo-remsim-bankd was not linked against libosmosim.so.0 (it uses none of the library's symbols)
2020-03-04 19:15:32 +01:00
Harald Welte 73b6d703ad Avoid useless dependency on libcsv
We don't want to link everything against libvsv.  Only bankd needs it.

Change-Id: I288c27611b042fef76101e247b41c7a2f6c7483b
dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/libosmo-rspro1/usr/lib/x86_64-linux-gnu/libosmo-rspro.so.1.0.0 was not linked against libcsv.so.3 (it uses none of the library's symbols)
dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/osmo-remsim-server/usr/bin/osmo-remsim-server was not linked against libcsv.so.3 (it uses none of the library's symbols)
dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/osmo-remsim-client/usr/bin/osmo-remsim-client-shell debian/osmo-remsim-client/usr/bin/osmo-remsim-client-st2 were not linked against libcsv.so.3 (they use none of the library's symbols)
dpkg-shlibdeps: warning: package could avoid a useless dependency if debian/libifd-osmo-remsim-client0/usr/lib/pcsc/drivers/libifd-osmo-remsim-client.bundle/Contents/Linux/libifd_remsim_client.so.0.0.0 was not linked against libcsv.so.3 (it uses none of the library's symbols)
2020-03-04 19:15:32 +01:00
Harald Welte f7598fe417 remsim-client: move from common 'src' directory to 'src/client'
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
2020-02-16 15:41:12 +01:00
Harald Welte bbd18bd7fe bankd: Implement card reset based on clientSlotStatusInd
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
2019-12-17 13:31:20 +01:00
Harald Welte 0fd77a5790 bankd: Introduce SIGMAPADD to tell worker about new mapping
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
2019-12-15 00:11:43 +01:00
Harald Welte a49678309d bankd: Factor out signal-sending from bankd_srvc_remove_mapping()
This way we can also deliver other signals to workers.

Change-Id: I86744554187d5bcee75592427990d404889f29fe
2019-12-15 00:11:43 +01:00
Harald Welte d2192e27ce rspro_client_fsm: Disable automatic connect on FSM allocation
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.

Change-Id: Icd882405f2ef54e10a66054829c089e4985f1d1f
2019-12-05 08:56:27 +01:00
Harald Welte a8d945e191 bankd: No need to handle SIGMAPDEL if we're not mapped yet
Change-Id: I187b833a9b7ec3d3763e21b5c88a3fa39ba0c4c7
2019-12-04 22:25:37 +01:00
Harald Welte f34fb79cc1 bankd: Implement new ResetStateReq
Change-Id: Ib794e605162903a2b2c4f4516887ec91fc8d139a
2019-12-04 22:25:37 +01:00
Harald Welte cd7fcd717c Add "--version" to all executables to print compile-time version info
Change-Id: I9ae504ff95beeefb9e90e02a576861351ea9e143
2019-12-04 21:13:24 +00:00
Harald Welte 602b6f7763 bankd: initialize bank_id/slot_nr to 0xffff for unmapped workers
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.

Change-Id: I6976eb96feae6a3b66bacf787e436a2df29f9ce0
2019-12-04 21:52:58 +01:00
Harald Welte d9fb93991b bankd: Reject removeSlotmap when ClientID doesn't match
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

Change-Id: I892282821f4650614d1d08ed4bdf11eaabf947c0
2019-12-04 21:24:10 +01:00
Harald Welte e6fa46acd5 bankd: createMapping should implicitly delete existing mappings
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.

Change-Id: I83e319d22896b881c0d882542842f500075aa546
Closes: OS#4278
2019-12-04 21:24:10 +01:00
Harald Welte 550b2958d3 bankd: Fix log print during removeMapping
We need to dereference 'rreq' nor 'creq' in the remove handling.

Change-Id: I04e9e2447336f7d1aaeb932928a79bb705aa0c5a
2019-12-04 21:24:10 +01:00
Harald Welte c650a4daec bankd_main: Refactor code: bankd_srvc_remove_mapping()
Change-Id: Iceb1d015e0ea760cce2cd99bc22ae0149bdb42f1
2019-12-04 15:08:10 +01:00
Harald Welte 667d694a38 bankd: send IPA CCM ID_ACK after receiving ID_ACK
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.

Change-Id: Ie55c9d5c435df786e97ec3900837bb21ab80140a
2019-12-03 16:42:47 +01:00
Joachim Steiger 9c963dca66 osmo-remsim-bankd: Fix typo in help for --num-slots
Change-Id: If09833f0d0ba46d7bb204ac9b3b7f8128b4b3799
2019-05-25 00:49:32 +02:00
Harald Welte e89fecda6a bankd: Don't read CSV file until _after_ handling options
Otherwise "--help" won't work if the CSV cannot be found/read.

Change-Id: I162c40e267ea64a52baf2b5c819d9d2658daf77d
2019-05-08 17:23:58 +02:00
Harald Welte d7468e0b8c configure.ac: Add --disable-remsim-bankd
This allows builds on small/embedded platforms to avoid all the
dependencies required by remsim-bankd, including libpcsc-lite

Change-Id: I29a1a0131fdfea6742ec12d81228879066b1ff7e
2019-04-03 13:11:57 +02:00