Commit Graph

17 Commits

Author SHA1 Message Date
Harald Welte 1f699b405a bankd_main: Obtain ATR of card via PC/SC API
Change-Id: Ie73806e2190e604cab96b3f632b4bbfffb7d0112
2019-03-28 18:58:21 +01:00
Harald Welte 2507597c42 bankd: Implement thread-safe SIGUSR1 talloc context reporting
If the main thread receives SIGUSR1, we dump its talloc report and
then signal all worker threads so each can dump their own talloc
report.

Change-Id: I89e7e22de5557376bd5a9625662d99ac0badf00c
2019-03-11 17:39:29 +01:00
Harald Welte 286a2beaa9 bandk: store the worker name as part of 'struct bankd_worker'
Change-Id: Ife981a4d555f96b63aeaedf27c3ebe513191b0c7
2019-03-11 17:39:29 +01:00
Harald Welte 00a9673ac2 bankd: terminate bankd connection once map is deleted
This implements a signal based mechanism by which the main thread can
inform worker threads that their mapping has just been removed and
they should hence terminate the connection and return themselves to the
pool.

Change-Id: Id932810d59e9e5d8994629d57aaf180bc96f90f5
2019-03-11 17:18:02 +01:00
Harald Welte a0f395043e bankd: Don't create 10 workers, but 'num_slots' workers
Change-Id: Ie86321e3f61ed86bbbe2ca8cfbd9edde6060bb9f
2019-03-09 21:01:31 +01:00
Harald Welte 707c85a49b Split "RSPRO client FSM" from "BANKD client FSM"
This allows the RSPRO client FSM to be used by both remsim-client
as well as remsim-bankd -- both of which connect as RSPRO client to
remsim-server.

Change-Id: I57b5f8dc9de522b6ae8ceb030e639b5b8001b55a
2019-03-09 13:11:48 +01:00
Harald Welte cbd18960e7 generalize slotmap to make use of it outside of bankd
Change-Id: I0ca7feaa38dfd0468814ef5a1eff997ce854cedf
2019-03-03 19:38:40 +01:00
Harald Welte a4e0a2396b move DMAIN definition to new debug.h
This way both client.h and bankd.h don't conflict with each other

Change-Id: I68ffd64e1f32b90206f98c7f3ea707d7b2e11e61
2018-10-15 00:20:42 +00:00
Harald Welte 694df83f35 bankd: Implement re-opening/connecting to card/reader
Change-Id: I5f4b12a76f82776cfd929bd56a4a1f0d4217be65
2018-10-03 22:47:52 +02:00
Harald Welte f94b9ee67b bankd: Initialize logging early.
In case libosmocore wants to log e.g. a failure to bind the port,
we must have initialized logging before that point.

Change-Id: I86e805a66da6269748e6bd3164e5c0342e014f77
2018-09-25 15:04:21 +02:00
Harald Welte f1dd16291e bankd: Add app_comp_id to use repro_util helpers
Change-Id: Ie981388220ed0612e427d076f8741fec73e6026b
2018-09-24 14:54:23 +02:00
Harald Welte 45c948cc10 bankd_pcsc: Add CSV based mapping of bank-id/slot-nr to PC/SC reader name
In the PC/SC world, each slot is associated with a string name. In the
bankd for PC/SC readers, we need to establish a mapping which
bank_id/slot_nr maps to which given string name.  We use a minimalistic
CSV file for defining those mappings.  The file is read only once at
bankd startup time.

Change-Id: Ifd2caab670625e2e3fbc57b966dce2f43b690417
2018-09-23 19:29:51 +02:00
Harald Welte af61473729 bankd: Resolve slot mapping after client identifies itself.
If mapping cannot be resolved, transition to new
BW_ST_CONN_CLIENT_WAIT_MAP state

Change-Id: I27b4bc301a784712808881a40636e9299816fe72
2018-08-17 22:10:05 +02:00
Harald Welte 371d026c6b RSPRO: Use ClientSlot in ConnectClientReq, ConfigClientReq
Change-Id: I33b44009eea338627b0ccbe69b9e4114e4fb85d8
2018-08-16 15:30:41 +02:00
Harald Welte cce2aadbb3 bankd: Add client.id to bankd_worker
Change-Id: I1461f626b579d92621df21b53bbbe8062fb97d72
2018-08-16 14:44:37 +02:00
Harald Welte 8d85829821 bankd: Log worker number; Add formal state + state transition function
Change-Id: Ib18e3ad79657e9423a1c1ac75438abcd2e4fdbbd
2018-08-15 23:36:46 +02:00
Harald Welte 77911b0091 Add initial remsim-bankd skeleton
This is not a complete program yet, but a rough initial skeleton with
the key data structures in place, as well as the thread / locking model
in place.

Change-Id: I5ad5a1a4918b8eacdaeb7e709ff05dc056346752
2018-08-15 08:56:31 +02:00