Harald Welte
3f09f634e0
fixup warnings
...
Change-Id: I73262ebf04640782859c5fa43b9172de3c788e3d
2019-03-31 15:51:13 +02:00
Harald Welte
13d0f8c3d3
disable slotmap debugging
...
Change-Id: I7f672adc1fef6616d7244f73214273236b42a0ca
2019-03-31 15:13:29 +02:00
Harald Welte
35ded29788
rspro_server: Fix Warnings about unused variables
...
Change-Id: Id8615062772c09d7396254fa5d1f42dd029e8a22
2019-03-31 15:13:09 +02:00
Harald Welte
4c37f66048
rspro_server: Configure client's bankd parameters (nr/slot/ip/port)
...
Change-Id: I821d0b2ba4390b9772097ddd3d610ba2c9393399
2019-03-31 15:00:00 +02:00
Harald Welte
a8b86ceff2
client/server: log failed attempts to transmit/encode RSPRO
...
Change-Id: Iac56ddf7417fdee637660db34a7f0e6bdb9c4ab5
2019-03-31 14:59:20 +02:00
Harald Welte
24a3e32db7
bankd: Don't fail on RsproPDUchoice_PR_setAtrRes
...
Change-Id: Iaacd1d46a646de469ea5bb2c75323472cfe3635d
2019-03-31 13:08:30 +02:00
Harald Welte
736e831cc3
bankd: log incoming RSPRO
...
Change-Id: I276fffd6f7bad3fc38a0151ba935fd39ac1245d9
2019-03-31 13:08:16 +02:00
Harald Welte
10f7a76373
rspro_server: Treat keepalive timeouts (by closing connection)
...
Change-Id: I42f2d5c6c7a4387cb61cb8b46d01b7dfb86b927b
2019-03-31 12:38:47 +02:00
Harald Welte
1c691b173a
rspro_server: Give proper name to IPA_KEEPALIVE FSMs
...
Once we know the Client / Bankd Identity, update not only the connection
FSM with that identity, but also the IPA keepalive FSM. This will
provide proper context when logging.
Change-Id: I92bf47b6b0072c8062449ed3bb51ddf0b7aaf9a1
2019-03-31 10:58:11 +02:00
Harald Welte
19dee08862
rspro_server: Print human-readable message type instead of numeric value
...
Change-Id: I0c26e1be1ae9ddee663fee582a44d4449e6beea7
2019-03-31 10:53:45 +02:00
Harald Welte
f30ff9eeb0
rspro_server: Add client_conn_by_slot() API function
...
Change-Id: Ie2eefad358b45541cf90d0cacac2d03953f0c367
2019-03-30 19:17:37 +01:00
Harald Welte
697141223e
rspro_util: We don't deal with network byte order, asn1c takes care of that
...
Change-Id: I12523c748298a23c23bba81acc97e5f6d346dbef
2019-03-30 19:16:30 +01:00
Harald Welte
0a64da6e2d
rspro_server: Split CONNECTED into CLIENT and BANKD specific states
...
Change-Id: I5b2205393de62b16439b49fb7a39ee640f750cc5
2019-03-30 17:38:04 +01:00
Harald Welte
1b07f7fbc9
rspro_server: Add more comments
...
Change-Id: Iafe8674161a117b70e97ffeac4e988ba9a45db93
2019-03-30 17:33:07 +01:00
Harald Welte
ba781c065f
rspro_server: Fix log output in client_conn_send()
...
Change-Id: I4b089011dcdc261837d1d9a7dc184568027f6df0
2019-03-30 17:32:53 +01:00
Harald Welte
eae30c3e3f
rspro_util: Fix typo in rspro_gen_ConfigClientIdReq()
...
Change-Id: I40bdbc714b975bace89b196f24d02a476c060d10
2019-03-30 17:32:37 +01:00
Harald Welte
72cde1052b
client: Allow specification of clientId / slotNr as command line arguments
...
Change-Id: I0a96a49af8bceb5f14db056f11619a12ef42f4f1
2019-03-30 12:01:51 +01:00
Harald Welte
fd5a62ab47
client: Sort getopt-long like getopt like help message
...
Change-Id: I150bf89c3b0652c860a90d728dc7a6e1d23f2961
2019-03-30 12:01:51 +01:00
Harald Welte
2f89b965a6
client: transmit RSPRO via bankd_conn_fsm
...
This fixes a crash where the modem/phone would sent APDUs at a time
when there is no connection to the bankd yet. If we transmit the
RSPRO PDUs via the FSM, this cannot happen.
Change-Id: I965666ae4622c403e63c060deaa4d80e9249d155
2019-03-30 12:01:51 +01:00
Harald Welte
2eee4507ca
bankd/client: Fix memory leak if rspro_enc_msg() fails
...
Change-Id: Ib72b077d82939be0627b9dd7c905fb2a33db9ca5
2019-03-30 08:50:35 +01:00
Harald Welte
972a1e892e
client: Fix initialization order: logging first
...
otherwise some sub-system might want to log without the logging being
initialized first.
Change-Id: I179d937bd4eae0e82d9ebdb07748a0663a244756
2019-03-30 08:34:30 +01:00
Harald Welte
7817b20e04
client: Default server port is 9998, not 9999
...
Change-Id: Ifd19cb2aaff7e53c0d142cea07ca75c064a7ee12
2019-03-30 08:34:14 +01:00
Harald Welte
2ea20b92fd
client: Use stack instead of heap when possible
...
Change-Id: If555d7cf2d7ef2152dd9d78e7ed1ba65e83ed59b
2019-03-30 08:33:49 +01:00
Harald Welte
9bfc6b3ba6
remsim_client: Use bankd_conn_send_rspro() where applicable
...
Change-Id: I63b3b07379ae66208a03d3a27500e7973ddfb9e7
2019-03-28 20:29:53 +01:00
Harald Welte
f14dc04627
cosmetic: fix typo in comment
...
Change-Id: I3a1be1b8adc74a2f2ef51b766ef4e17ac88a7ce9
2019-03-28 20:29:36 +01:00
Harald Welte
fa365593cb
remsim_client: Process SetAtrReq() and set ATR in SIMtrace2 firmware
...
Change-Id: Iddcb13c8f4e98aac4e44bda32b8ad4cdeead50e7
2019-03-28 20:28:57 +01:00
Harald Welte
297d72ef47
bankd: Move all PC/SC specific code to bankd_pcsc
...
Change-Id: I435b42982b54d74447c435dcefa26d1e317d15e0
2019-03-28 18:58:21 +01:00
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
e57334ed9d
rspro_client_fsm: Use osmocom logging API instead of direct printf
...
Change-Id: Iaf004e1839340371052d4e36baed4faee9f3744e
2019-03-27 22:58:10 +01:00
Harald Welte
8d8d4f162b
remsim_client: Use osmocom logging instead of printf
...
Change-Id: I7e695335b4c4652a534cefa073dcea9f424d6744
2019-03-27 22:53:47 +01:00
Harald Welte
94ba99b5d0
bankd_main: Add more logging in error situations
...
Change-Id: I48e01d4517da1ac2983946d84c7a95ea9797e5b8
2019-03-27 22:42:11 +01:00
Harald Welte
eb971b5209
bankd_main: don't use fprintf if we can use osmocom logging API
...
Change-Id: I0b6ed933ffb3e3d689b344bd215357577e3120aa
2019-03-27 22:41:45 +01:00
Harald Welte
e1d3289ed9
bankd: Verify bankd/client slot in tpduModemToCard rx handler
...
Change-Id: I58fce1392f418b36f5f61f224e03a9dbbe34f01f
2019-03-27 20:47:42 +01:00
Harald Welte
4e7a285427
rspro_client_fsm: Disconnect if Connect{Client,Bank}Res != ok
...
Change-Id: Id199f9c4cb4c86fd0dba8939334ac69878f4a3f5
2019-03-17 21:01:50 +01:00
Harald Welte
ce638d8fd7
client, bankd: Add SIGUSR1 handling for talloc context debugging
...
Change-Id: I9153f4cc89b3911a4f9ea4f02fe1b108420d2eed
2019-03-17 09:36:04 +01:00
Harald Welte
75f560338c
bankd_client_fsm: Fix ESTABLISH signal handling
...
Change-Id: Ib7a09ff6cad0b0eba17908cba733df35b7ee767d
2019-03-17 09:35:41 +01:00
Harald Welte
7a950888f5
client: Don't ntohs() integer values from asn1 decoder
...
The ASN1 decoder takes care of endianness for us.
Change-Id: I9c3127b4fb195db5e81702e043e4fe595474b561
2019-03-17 09:35:16 +01:00
Harald Welte
9cf013a343
remsim_client: Store and use BankSlot received in ConfigClientBankReq
...
Change-Id: I6858b68590789d38741e541b9028d2b9b142e0c0
2019-03-11 22:19:19 +01:00
Harald Welte
cf8b89ad84
Move client/bank slot conversion functions to rspro_util.c
...
Change-Id: I18f1d1cb1fb712b01a0991419743db52338688af
2019-03-11 22:16:22 +01:00
Harald Welte
d571a3e2e1
RSPRO: split ConfigClient into ConfigClientId and ConfigClientBank
...
The point is that the ClientId is only set once at start-up (and
also only optionally), while the Bank IP/port/ID/slot can be changed
any number of times during a RSPRO connection.
Change-Id: Ic76207c7dd7c18fe93bc5133b29c5f9438a9fb0e
2019-03-11 22:09:50 +01:00
Harald Welte
19f881a373
bankd: respond to IPA PING from client with IPA PONG
...
The bankd worker threads handle the RSPRO connection from the
remsim-clients outside of our usual osmo* infrastructure and hence
they don't inherit the common IPA CCM handling. This means we need
to explicitly implement the keep-alive PONG support.
What this doesn't add is any outbound keepalive handling towards
the client.
Change-Id: I86f8ca28ece62c33ccbf45c9c65172be8a647407
2019-03-11 18:39:13 +01:00
Harald Welte
653d6a0b38
bankd: Disconnect client if we enter state BW_ST_CONN_CLIENT_UNMAPPED
...
Change-Id: Ifc1741610fc8a3c0413844e0c37a6fcbb2c55067
2019-03-11 18:38:44 +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
458e01b611
bankd: Return ConnectClientRes in error paths of worker_handle_connectClientReq
...
Change-Id: Ic0d3119c1c5fa412a9d14bb26da5f84ba6f55ae3
2019-03-10 11:14:43 +01:00
Harald Welte
942f1ff162
bankd: Actually send the RemoveMappingRes we prepare
...
Change-Id: I01d1216ab9461a7e3c51c55a1ab33229bd920da7
2019-03-09 21:49:08 +01:00
Harald Welte
a025e7008d
rspro_client_fsm: Ensure close + reconnect on missing Connect*Res from server
...
Change-Id: I7f9bbdf246eb206342bd94be0b13ae45dd40084e
2019-03-09 21:39:09 +01:00
Harald Welte
454f5e2543
bankd: Don't use hard-coded slotmaps but receive them from remsim-server
...
Change-Id: I642476c2935fbaa96ce5986e3e6708eed0d2ffe2
2019-03-09 21:38:34 +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