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
f1d7016397
RSPRO.asn: Clarify use of optional ClientSlot in ConnectClientReq
...
Change-Id: Icca78725d64627b40d589bdeacc33390e5522ae2
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
7b94dc231d
add ffasn1c example for RSPRO
...
This can help us for debugging using an independent decoder compared to asn1c
Change-Id: I15293014cddb75190e7f848fff6d07a3401461ff
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
Harald Welte
796a7492c7
bankd: Add code to handle TPDUs in rx and tx direction
...
Change-Id: Icb35ad28939392e75a17b732834d9d570452164f
2018-09-23 19:31:28 +02:00
Harald Welte
57593f0ce9
bankd_main: Missing state transition to BW_ST_CONN_CLIENT_MAPPED_CARD
...
After we opened the card, we need to transition in this state.
Change-Id: I2de62045bae6313620e81b24d883cec9e4b6017f
2018-09-23 19:30:31 +02:00
Harald Welte
48865c284b
bankd_main: Fix SCardConnect(): Needs dwActiveProtocol output param
...
Change-Id: I4d07d75966afbf4af7ac592ecdef61074a329186
2018-09-23 19:30:07 +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
1266952242
bankd_slotmap: Fix debug statements
...
Change-Id: Ia383c851f16967893e3ed50acd18199d848bd1b3
2018-09-23 19:26:09 +02:00
Harald Welte
5d16b1c865
rspro_util: Add functions to generate TDPU transfer messages
...
Change-Id: I35daf740724e4914b09e3c7eaaac4f933116f48d
2018-09-23 19:25:46 +02:00
Harald Welte
84ba234c2c
More progress on code of the server_conn_fsm
...
Change-Id: Ibad10383fe9c4ab9e6b94382114747c21dae6c31
2018-08-24 22:20:20 +02:00
Harald Welte
f29e0d0c26
client: bankd_send_rspro -> ipa_client_conn_send_rspro
...
Change-Id: Ib481401f8b201719fe1edf76a6d73359947fda15
2018-08-24 21:42:22 +02:00
Harald Welte
24173fbba7
client: Introduce FSMs for managing connections to server + bankd
...
Change-Id: I705d2dde6d7285bbb1be328181c6d09bccaf26fb
2018-08-24 20:37:28 +02:00
Harald Welte
2ff0ab98d2
Add initial remsim-client skeleton
...
Doesn't rally do much but to connect to bankd and send a
ConnectClientReq to it.
Change-Id: Ia67011ca690d90b7b670eb85dd0bc507d6c96d49
2018-08-17 22:10:49 +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
a2b23c3c50
rspro_util: Print error message in case of encoder errror
...
Change-Id: Ia2eabd86dd143d5241756f406aa5388cf49d3ba1
2018-08-17 22:09:06 +02:00
Harald Welte
6b8d4f82de
rspro_util.c: Fix encoding to msgb. Use tailroom, not length!
...
Change-Id: I955b76499b1370a9453a50204ccee0e9e8769468
2018-08-17 22:06:24 +02:00
Harald Welte
57555aa60c
rspro_util: Add ASN_ALLOC_COPY macro and add clientSlot to ConnectClientReq
...
Change-Id: I0bc2ba7b7e7787fc5ef9d730af35767b00137513
2018-08-17 22:05:06 +02:00
Harald Welte
d5c5c0b790
rspro_util: DER encoder returns size in bytes, no need to divide by 8
...
Change-Id: I559afe17981a77024b6d14058f89c5f103767939
2018-08-17 22:04:01 +02:00
Harald Welte
137c4402d9
rspro_util: Add header file
...
Change-Id: I2f66531008943fa6bdc3c286aee2afd254384018
2018-08-17 21:26:49 +02:00
Harald Welte
371d026c6b
RSPRO: Use ClientSlot in ConnectClientReq, ConfigClientReq
...
Change-Id: I33b44009eea338627b0ccbe69b9e4114e4fb85d8
2018-08-16 15:30:41 +02:00
Harald Welte
415e8f66ce
bankd: Re-initialize client.peer_addr when recycling the thread
...
Change-Id: I56ed45bda4323326c42283f160f4b99a4138add1
2018-08-16 14:47:38 +02:00
Harald Welte
ceb3e68fab
bankd: Include worker state and file/line in LOGW output
...
Change-Id: I00974d7f567ec1d3142727d455549c76ec974a03
2018-08-16 14:47:11 +02:00
Harald Welte
d6dfb8c045
bankd: use getnameinfo() to print client IP/port on connect
...
Change-Id: Ia721f993b4e4c0addf429fbd6179d7d379c0ccd0
2018-08-16 14:46:53 +02:00
Harald Welte
fe3df992fe
RSPRO.asn: Add optional ClientId field to ConnectClientReq
...
This is required when the client connects to the bankd, so the bankd
can figure out who the client is.
Change-Id: Ie87b775d2996a62128e2506ad4b0e48e2f704561
2018-08-16 14:45:49 +02:00
Harald Welte
f0614dfd33
RSPRO.asn: Improve comments/description
...
Change-Id: I66e62b69a32382703f809160997825bd4405c5b2
2018-08-16 14:45:23 +02:00
Harald Welte
cce2aadbb3
bankd: Add client.id to bankd_worker
...
Change-Id: I1461f626b579d92621df21b53bbbe8062fb97d72
2018-08-16 14:44:37 +02:00