Martin Hauke
4e87bebcc7
Fix common misspellings and typos
...
Change-Id: I8152acaccd33a4b646d56cba0748aeefa0c16b35
2019-07-17 22:11:52 +02: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
Harald Welte
9353c607fc
configure.ac: Add --disable-remsim-server
...
This allows builds on small/embedded platforms to avoid all the
dependencies required by remsim-server, including ulfius, yder, etc.
Closes: OS#3896
Change-Id: I2b1ec8a9a88b931ac56a63df88886e37c580a92b
2019-04-03 12:49:10 +02:00
Harald Welte
51cfec03b1
rename executables to include osmo- name prefix
...
Change-Id: I4498a004519499cc4b897a68c7f33efe29a63425
2019-04-03 09:50:04 +02:00
Harald Welte
5345f3d43f
Makefile.am: Fix dependency of server on libosmo-rspro.la
...
Change-Id: I0a1badfa44479ff771be7062a19fd842f3d56b41
2019-04-03 08:42:47 +02:00
Harald Welte
f51166790e
cosmetic: remove some FIXME that actually are already fixed
...
Change-Id: I62ac36aae6da374b83e27b71ff52b0c3d52bf346
2019-04-02 20:56:16 +02:00
Harald Welte
4fa407a750
bankd: Use configured bank_id/nr_slots in ConnectBankReq
...
The code used hard-coded defaults instead of the user-configured values.
Change-Id: I86383aed4d5bb08ac1540eaecc0975a18e560baa
2019-04-01 21:07:02 +02:00
Harald Welte
2513d81625
bankd: move bank_id / num_slots from g_bankd to remsim_srv_conn
...
... and make num_slots configurable via command line argument
Change-Id: Id8f15085b397186d3470f4d943979857b6811a52
2019-04-01 21:07:02 +02:00
Harald Welte
56298ca4e0
server: Fix dependency on libosmo-rspro.la
...
Change-Id: Ia05a5f0f01999b32fd10d76694e95df9b1ccb207
2019-04-01 10:57:08 +02:00
Harald Welte
b6b7bd1dff
remsim_client: Reduce simtrace timeout from 100s to 1s
...
As we're waiting in blocking mode (and hence block things like the
IPA keepalive FSM), we cannot afford to block for 100s in one shot.
Change-Id: If316018d89367d54167fde021649fb3cfe218744
2019-04-01 10:52:17 +02:00
Harald Welte
05dc39e391
rspro_util.c: Disable printf debugging
...
Change-Id: I69b6f62fc3e4fc8aabb230ab9a69891894e3f7a3
2019-04-01 10:52:17 +02:00
Harald Welte
5bae20b64d
bankd: Add command-line arguments for IP/port/etc configuration
...
Change-Id: Ifafdd7ea005347f39d9adad2b50cf81609b41cba
2019-04-01 10:48:17 +02:00
Harald Welte
b54a51eec2
improve talloc memory leak debugging
...
* switch to talloc_report_full() on SIGUSR1
* include asn1-internal allocations in talloc report
Change-Id: I14fff863449971024002e0d5465fb7a964d67095
2019-03-31 15:57:59 +02:00
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
Harald Welte
f4b16f1c11
bankd_main: Introduce g_bankd global variable
...
Change-Id: Ib1a94333f107beb695075b30e41396a6d1f4f29d
2019-03-09 20:58:17 +01:00
Harald Welte
b49ac9c6bb
rspro_util: Add rspro_msgt_name() to get RSPRO message type name + use it
...
Change-Id: I4b270addd024f9766923183a75381b71ffe1cfae
2019-03-09 20:36:07 +01:00
Harald Welte
229e6abce1
Add asn1c_helpers.c file to get type/enum/choice names for printing
...
Change-Id: I478d09776e58c86b84e82251f46f8d778b79a04c
2019-03-09 20:19:28 +01:00
Harald Welte
769ab7d04a
RSPRO: Add ErrorInd
...
Change-Id: I5e5e227d188c5f30ae9be60dd0439ae6f6913b8a
2019-03-09 15:10:36 +01:00
Harald Welte
71752ddd2b
RSPRO: Add two more ResoltCodes
...
Change-Id: I1b665b501106a4aac90e642c11f4123e6a77868d
2019-03-09 15:08:01 +01:00
Harald Welte
a844bb07d8
Introduce {server,bankd}_conn_send_rspro()
...
Change-Id: I8cae6f67567dcbf4b6d62fb5a76f5b7134b16f5d
2019-03-09 13:40:34 +01:00
Harald Welte
3dcdd20343
add missing copyright / license headers everywhere
...
Change-Id: I5c1fceead0ee799a948995f55c6ebee441cfb79a
2019-03-09 13:11:56 +01:00
Harald Welte
3cded63aa6
naming: Distinguish "rspro client" from "remsim client"
...
"remsim-client" is the client program running next to a phone/modem
which is attaching to the SIM slot.
"RSPRO client" is a protocl-level client of the RSPRO protocol:
* the remsim-client connects as RSPRO client to the remsim-server
* the remsim-client connects as RSPRO client to the remsim-bankd
* the remsim-bankd connects as RSPRO client to the remsim-server
Let's clarify this in naming.
Change-Id: I10462d4669a0a30c46f3f8d3df67e9c1d4ce8c4b
2019-03-09 13:11:56 +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
228af8a19b
remsim-client: Add command-line options for server ip/port and client id/slot
...
Change-Id: I26d6e0d2ad92e7164e0d8ac710361f9c5f5200df
2019-03-08 22:20:21 +01:00
Harald Welte
ec628e964e
client: move ClientSlot from bankd_conn to srv_conn
...
If the client uses a locally-configured (static) ClientId, then
the bankd_client_fsm.c code needs access to this information
at time of the connect to the server, not just when connecting
to the bankd.
Change-Id: I8238b4c56c723f9edcf1042f8a7793208c42f15c
2019-03-08 22:18:31 +01:00
Harald Welte
c7995e7112
client: Early call to osmo_init_logging2()
...
Change-Id: I8f6ee5a95c23821efb02872c41b3121ed532a819
2019-03-08 20:45:46 +01:00
Harald Welte
03b24114b3
client: Add IPA Keepalive handling
...
Change-Id: I4acf862bc575741e57ef76c1709d3a00e1850566
2019-03-08 20:43:00 +01:00
Harald Welte
1a17104639
client: Restructure {srvc,bankd}_read_cb()
...
Introduce some switch statements to make code more extensable.
Change-Id: I9d1a6c29cbfc2f01995a2093978fae8577f1771f
2019-03-08 19:18:52 +01:00
Harald Welte
15b75e1e5c
remsim-server: Add support for keepalive
...
This ensures that any RSPRO client (remsim-client or remsim-bankd) is
disconnected if he's no longer responding to IPA PING requests.
Change-Id: I324f0f2a0613d6310e1d191103b136c539b6ec05
Depends: libosmocore Change-Id I2763da49a74de85046ac07d53592c89973314ca6
2019-03-08 17:09:07 +01:00
Harald Welte
7bfcc65227
slotmap: restructure read_cb()
...
Change-Id: I7fb457f028f9aabc7b4b53bf036e5eac9d785299
2019-03-08 16:55:01 +01:00
Harald Welte
e5c7773c7f
client slot
...
Change-Id: I40f0589b2014a1df5ce4de745ec46642c68ad0c5
2019-03-07 23:58:24 +01:00
Harald Welte
f5a0fa37c4
Initial version of remsim-server
...
Change-Id: I1caadc528d5e61a4129c32c53283250cd37f3a3c
2019-03-07 21:35:48 +01:00
Harald Welte
648f4e33b4
slotmap: Introduce slotmap_{rd,wr,un}lock() wrappers for lock debugging
...
Change-Id: I8dde90d62e673e60e026979c74074f7084490467
2019-03-07 21:15:32 +01:00
Harald Welte
4b676bc6f1
slotmap: Log file/line when changing state
...
Change-Id: Idc7b350b464ddc50076f92dae592a0d5ad4d486a
2019-03-07 21:15:32 +01:00
Harald Welte
294298c4af
slotmap: Add _slotmap_del() for callers that already have a lock
...
Change-Id: Id05872c3676d0afe4c7abe74677fee62b4f03e53
2019-03-07 10:09:26 +01:00
Harald Welte
c86568359c
slotmap: Add slotmap_get_id() function to get numeric ID of slot map
...
Change-Id: Ie476244d9ade30eed9215923275aa82a5d10176f
2019-03-07 10:09:26 +01:00
Harald Welte
2bf39e0fe0
slotmap: Add "DELETE_REQ" state
...
Change-Id: I953e72e304d6403b2e47f7546a36abfdf246e44b
2019-03-07 10:09:26 +01:00
Harald Welte
f4e75043de
slotmap: Return newly-created map from slotmap_add()
...
Change-Id: I1bc66fee1f457bcf9693491031d7d4c411fc582e
2019-03-05 15:23:12 +01:00
Harald Welte
91a0a4adda
slotmap: Introduce the concept of a slotmap state
...
... which is required in remsim-server
Change-Id: I56f5ecd6194ef62c87d87d2965ca0315e3d0fc2d
2019-03-05 15:23:12 +01:00
Harald Welte
faef8f06ed
slotmap: Introduce slotmap-printing function and use it
...
... avoid code duplication
Change-Id: I6458b9d222ed9f4113c3bb1c538b4b710559c6b2
2019-03-03 21:59:37 +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
61d98e9f3e
share debug.[ch] across all executables
...
This avoids us having to re-define log_info/log_info_cat for each
program.
Change-Id: I22f4f8a51b91ee09c5be26b1ed1bfca41730c577
2019-03-03 15:43:07 +01:00
Harald Welte
e56f2b9b46
client: Connect to server before connecting to bankd
...
So far we skipped the client->server connection and related
configuration transfer from server to client. Now, the server
instructs the client to which bankd ip/port to connect.
Change-Id: I76c9498089515d1a6190f3e79e143b7df3a531bd
2019-03-02 17:02:13 +01:00
Harald Welte
0eaa0ef796
rspro_util: Add rspro_IpAddr2str() to get stringified version of IpAddr_t
...
Change-Id: Ic6cccb00d1d65bdab84178acb1e0525e11bc1315
2019-03-02 15:12:42 +01:00
Harald Welte
92bd881c23
rspro_util: Add rspro_comp_id_retrieve()
...
This function can be used to obtain an 'sturct app_comp_id' from
received/decoded asn1c ComponentIdentity_t.
Change-Id: I7c68cee171a65cb83a802285531b677cdf37108b
2019-03-02 14:52:17 +01:00
Harald Welte
c0097b1e55
respro_util: Add rspro_gen_ConfigClientRes() function
...
Change-Id: Ib14bc617ed60c64d3b69094f30901f78cafba3b3
2019-03-02 14:22:24 +01:00
Harald Welte
7fc64bc5b2
move osmo_fsm_register() into constructor function
...
This way each application doesn't have to explicitly call it.
Change-Id: I20753d7f7f485e7e495b64fa74b24858cd22ffa9
2019-03-02 12:55:59 +01:00
Harald Welte
c0a4ae4c3b
add rspro_gen_{Remove,Create}Mapping{Req,Res}()
...
Change-Id: If86d34a1e723b7202b5fa2c40ea1d0b152381773
2019-03-02 12:37:30 +01:00
Harald Welte
62e3f5f51c
rspro_util.c: Set pdu version to 2 for all generator functions
...
Change-Id: I83b87875b81491217315390f9ccefeeb39fb610b
2019-03-02 12:37:30 +01:00
Harald Welte
f9995a36fd
rspro_server_conn: Add handle_rx() call-back
...
This call-back receives all already-decoded RSPRO PDUs from the server.
Change-Id: I5f410aa6071c9a987c2811f22fb2f3ff018b3cc1
2019-03-02 12:37:30 +01:00
Kevin Redon
6f074b787a
minor: show USB error message instead of number
...
Change-Id: I272ac1be82b7432934969ea4d204dd20067d9428
2018-11-12 22:53:48 +01:00
Kevin Redon
206c3d7d0a
add ATR as command line argument
...
we could add a function checking the ATR validity
also before updating the (conditional) checksum we should check if
it is actually present in the ATR
Change-Id: Id1084abdf2318e96c22f8e69cc1ef161b12ef5ea
2018-11-12 22:51:42 +01:00
Kevin Redon
f120b64b90
remsim: fix TPDU response size transmission
...
the TDPU response data size can be up to 256.
this length cannot be stored in a uint8_t, which would cause the
length to become 0, no data being send, and the reader reset the
card because of misbehaviour of the card (i.e. no/malformed
response leading to the timeout of the waiting time).
Change-Id: Id38f9e597ffff242e89ea3dd9fbdf0c9f444cc03
2018-10-15 20:02:52 +02:00
Harald Welte
c3632a778f
rspro_gen_ConnectClientReq(): don't dereference optional 'client'
...
Change-Id: Id5ff7f1524bc34576095d6812935557c7f03b545
2018-10-15 00:27:20 +00:00
Harald Welte
098ef8780c
server_conn_fsm_alloc(): add explicit talloc context argument
...
The rspro_server_conn might be a static member of a different struct
and hence not suitable as a talloc context.
Change-Id: I9fd78d558f791d452f2a5279f1af13fd596c1cd6
2018-10-15 00:27:20 +00:00
Harald Welte
7f0e82f9d4
move ipa_client_conn_send_rspro() into remsim_client_fsm.c
...
Change-Id: I805e7dee0e3dd5a591d215ad340da356b19d03dd
2018-10-15 00:27:20 +00:00
Harald Welte
fc0ba94dd6
move 'struct rspro_server_conn' to client.h
...
Change-Id: Iab9183de086e76a214c23b2af340253a0428e445
2018-10-15 00:27:20 +00: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
8bb639ac3b
libusb_util.c: Avoid gcc warning about strncpy()
...
What we're doing is actually legal: We copy the full size of the
destination array, and then overwrite the last byte with NUL. However,
gcc isn't smart enough to see that:
libusb_util.c:162:5: warning: ‘strncpy’ specified bound 20 equals destination size [-Wstringop-truncation]
strncpy(out[out_idx].path, path, sizeof(out[out_idx].path));
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Let's copy one byte less to make it happy.
Change-Id: Iae13f7a4cf89230f308eb0183d993d7c31024907
2018-10-15 01:52:20 +02:00
Martin Hauke
058457542a
Fix compiler warning: no-return-in-nonvoid-function main.c
...
RPM post-build-checks found some issue and marks these as error:
[ 31s] I: Program returns random data in a function
[ 31s] E: osmo-remsim no-return-in-nonvoid-function main.c:49
Change-Id: I18705488d0ef8a445004e6a7e81dd2483afb9bdb
2018-10-13 20:43:57 +02:00
Kevin Redon
3428e415b3
add sim switch and modem reset for OWHW
...
Change-Id: I9d395c2c7e10a0e7e5f7c84bc7d951431bfc68ba
2018-10-12 14:58:20 +02:00
Kevin Redon
fbca97a87e
add client id and slot number as command line argument
...
Change-Id: I832ea69b303bf52561e4245991bb25af62558ea0
2018-10-12 14:58:20 +02:00
Kevin Redon
3ec265bca1
move main print output closer to main (minor)
...
Change-Id: Ib866f8b8b879a3a23bdc31eafe8735c7420bb353
2018-10-12 14:58:20 +02:00
Kevin Redon
19c97ed22a
set client name (minor)
...
Change-Id: Iebb486ede19bd44e49a975c1b5e6c5a26378ba09
2018-10-12 14:58:20 +02:00
Kevin Redon
efbf249e08
remove duplicate print output (minor)
...
the URB content is also shown in process_usb_msg
Change-Id: I3985449daf71d6a450b3339e9feaa26528b86535
2018-10-12 14:58:20 +02:00
Kevin Redon
21e31de068
indicate more clearly SIMtrace traffic in output log
...
Change-Id: Ie18c8aaace7c7f7cfef9119a01140b8f500de213
2018-10-12 14:58:20 +02:00
Kevin Redon
193a8c19c3
remove unused remote UDP variable
...
Change-Id: I3256ead1d6c4b8d64468fe1635b10a47e37e4df8
2018-10-12 14:58:20 +02:00
Kevin Redon
39eb9dce71
add command line arguments to set bankd host and port
...
these replace the remove UDP port not used in this SIMtrace2 host
application.
Change-Id: I16fef1a13da23e5395985320b59647d29680fc9d
2018-10-12 14:58:20 +02:00
Kevin Redon
79126566f5
minor: disable ASN1 debug
...
this removes a large number of compiler warnings
Change-Id: I2cf88280ad1d6407c91ff18f476eb3ca145c3aa5
2018-10-12 14:58:20 +02:00
Kevin Redon
9b69a3f4b9
send response APDU from bankd (card) to SIMtrace (modem)
...
Change-Id: I50270dbba8eb93133d1a48ba62a7f8a7dfc555d0
2018-10-12 14:58:20 +02:00
Kevin Redon
bc08db5cee
send correct APDU to bankd
...
Change-Id: I777f739793dfeec85823519f9d3d43b22090f209
2018-10-12 14:58:20 +02:00
Kevin Redon
9e34247231
add missing library flags to compile simtrace2-remsim_client.c
...
Change-Id: If01aca606ff920941db739baa41de52a1a08c434
2018-10-12 14:58:20 +02:00
Kevin Redon
e0b837cfcb
adapt remsim-client to use simtrace2 cardem
...
simtrace2-remsim_client.c combines simtrace2-remsim and
remsim_client.c.
it compiles but is short of sending the modem APDU from simtrace2
cardem to bankd.
2018-10-12 14:58:20 +02:00
Kevin Redon
70a8486cb3
add simtrace2 host libraries
...
these are copies of files from simtrace2
2018-10-12 14:57:29 +02:00
Harald Welte
d6f051edc8
fix 'make distcheck' by adding missing client.h to noinst_HEADERS
...
Change-Id: Ib2c450c902529f7327a187c612380a1f2b3ca534
2018-10-12 14:57:08 +02:00
Kevin Redon
38cd4f7f63
move ClientSlot_t from fsm to client
...
this allows to reuse the client slot information in as client for
other rspro_utils methods
2018-10-12 14:09:05 +02:00
Kevin Redon
ff5db6e81e
ensure the local asn1c library is used
...
Change-Id: Icc91c8f422965fec9c247aa9006e993c15f86d93
2018-10-12 14:09:04 +02:00
Kevin Redon
6811e4f65c
ensure RsproPDU_t client and bank are not NULL
...
Change-Id: I3ba6cf466e3002911842edff0884b38fee09ba26
2018-10-12 14:07:15 +02:00
Harald Welte
5a3613a57f
bankd: Ignore IPA CCM and don't terminate if we receive it
...
The IPA multiplex has a built-in sub-protocol called "CCM", which
we are not implemnting so far. We still don't implement it, but
at least we don't terminate the TCP connection anymore if any such
unsupported IPA CCM is received.
Change-Id: Ibf7bf2aa973c3f7503479c35adfdc135d7165618
2018-10-12 14:04:19 +02:00
Harald Welte
43ab79f8c2
remove libasn1c dependency and use asn1c without libasn1c
...
TODO: re-introduce talloc integration for asn1 runtime
Change-Id: I2140509c5359727f304470249be2a726b9a8deb1
2018-10-03 23:34:21 +02:00
Harald Welte
8f893ff208
bankd: Add FIXME to the main thread
...
Change-Id: I5d36afdf2417023d09e7029244e2e649f08266b2
2018-10-03 23:23:44 +02:00
Harald Welte
511c51313d
remove rspro_client.c which is not used anyway.
...
This was more or less a copy+paste of other related code we already
have for other IPA based protocols in libosmo*.
Change-Id: I21ade32fec3c1badfcf6bc9cd4ec845efed138e0
2018-10-03 23:21:02 +02:00
Harald Welte
7b41d9c863
bankd: Remove second \n after PC/SC OK statements
...
Change-Id: I80cc727d0260599d8114b1050f04cf17977944f2
2018-10-03 23:15:10 +02:00
Harald Welte
150d6d6788
bankd: more timeout/retry handling, including resolving slotmap
...
Change-Id: I6541456700d2615a391d8163424b3e39561a29c0
2018-10-03 23:13:21 +02: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
31c9eca75a
bankd_main: Set the pthread name for easier debugging
...
Change-Id: Ib1bf2b392ee161ba0d2d01bec927c2c0293a8f3b
2018-10-03 21:03:34 +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
703d686c20
fix double-free of msgb
...
Change-Id: I3eefed9ed2954a378327569949c944847e78dcf3
2018-09-24 17:46:05 +02:00
Harald Welte
9ebbacc801
correctly use asn1c API: PDU pointers must be NULL when calling decoder
...
If the pointers are != NULL, asn1c assumes their memory has already been
allocated, rather than dynamically allocating storage for it.
Change-Id: I6b78be75d8927f032ca4051520a3053b3fbf9e13
2018-09-24 17:46:05 +02:00
Harald Welte
10f6c21736
rspro_util: Add rspro_gen_ConnectClientRes() function
...
Change-Id: I32fe32b24c87e20c57a2e448c2b183050b84adaf
2018-09-24 14:56:04 +02:00
Harald Welte
7585286466
rspro_util: More error messages
...
Change-Id: I5006bbf88df17a6e76954ca51af7f443dcc526f9
2018-09-24 14:55:34 +02:00
Harald Welte
e1176cf510
bankd: Print error messages in more error cases during IPA read
...
Change-Id: I5b9720688ebda8ad37109c0cd32e8804678f46ac
2018-09-24 14:54:58 +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
417b961ef2
client: Generate CLIENT_CONN_RES event to FSM on RSPR rx of ClientConnRes
...
Change-Id: Ic17c72f4fc8bbd43187552892186cdb3e50e2efe
2018-09-24 14:53:41 +02:00
Harald Welte
3e689874ff
bankd: Handle errors during PC/SC open/connect
...
Change-Id: I304b4f73433d6027409aeef7faf04d4e8acd2e54
2018-09-24 14:52:56 +02:00
Harald Welte
fd47119111
use msb->l2h as pointer to the RSPRO part inside msgb
...
Change-Id: Ib8d02047ec64178f9ee235534dab3d9bf4ead296
2018-09-24 14:52:17 +02:00
Harald Welte
293478cf76
RSPRO: don't use "default 1" for protocol version
...
I suspect there may be some bugs in the handling of DEFAULT values
in asn1c (or maybe I don't understand them fully?), so let's simply
make the version field a normal ASN.1 field.
Change-Id: I08077e715a901dfa5193855be7040d550f6fc2e8
2018-09-24 14:49:41 +02:00
Harald Welte
52cc7db6ed
remsim_client_fsm: Handle re-connect timeout and initial connection failure
...
Change-Id: Id229459a8fa484276c0ca0413356c16930269c36
2018-09-24 11:51:51 +02:00
Harald Welte
e72e57383d
bankd: Add hack for hard-coded slotmap
...
As we don't yet have any software that would dynamically install
slot mappings into bankd, let's add a bunch of them as compiled-in
defaults during bankd_init(). This must of course be removed once
the dynamic slot mapping configuration from remsim-server exists.
Change-Id: I04d6ed68c9b9bfb559a41c705884cce4394ea926
2018-09-23 19:31:55 +02:00