Commit Graph

7 Commits

Author SHA1 Message Date
Harald Welte aa66d91eda user_shell: Dispatch all events via main_fsm.c
... avoid calling server_conn_send_rspro() directly from user code.

Change-Id: I7f589ea1b1610e6d716ed0d9f4078b185bc6401d
2020-05-25 23:07:04 +02:00
Harald Welte e580c93169 avoid talloc abort in simtrace2 frontend_append_script_env()
talloc requires a valid context for the allocation, we cannot use
env[i] as context.

Change-Id: I82b5e6b91b39d6f5c2a7492adb8c6193083e0d70
2020-05-24 16:06:32 +02:00
Harald Welte 0e968cce38 client: major restructuring around new main_fsm
The remsim_client code already used FSMs for the connections
to both remsim-server and remsim-bankd.  However the 'main' part of the
program was not yet implemented as a FSM, making it somewhat difficult
to perform the right actions in every possible situation.

This commit re-structures the code around a central main_fsm, which
gets notified from the per-connection FSMs and which handles the common
processing.  It also handles the execution of external script commands,
and hence further unifies the code base between the different backends
(simtrace2, ifd_handler, shell)

Closes: #4414

Change-Id: I44a430bc5674dea00ed72a0b28729ac8bcb4e022
2020-03-04 18:02:21 +01:00
Harald Welte 44866d501b client: user_shell.c: Don't echo stdin on stdout
This is a debug statement that shouldn't be in the code anymore

Change-Id: I6601e06c843ee7c8d151011af072186bfc5d3efa
2020-02-18 23:02:51 +01:00
Harald Welte 82368402af client: user_shell.c: fflush() after writes to stdout
This is useful if we have external programs interfacing with
stdin/stdout of osmo-remsim-client-shell.  We don't want that output
to hang in some buffer indefinitely, but rather have the lines flushed
immediately.

Change-Id: I6879f9f186ce87e0644b3d7868fc5ea031b82c62
2020-02-18 23:02:51 +01:00
Harald Welte 8e46ab6755 client: Work without global g_client variable
We may want to develop programs that include multiple instances of
a remsim_client.  Let's remove the global variable 'g_client' and
instead de-reference the bankd_client using container_of() macros

Change-Id: I456fb633561b88912be2f78c3e0264794d921255
2020-02-16 15:41:56 +01:00
Harald Welte 1200c820f0 client: Add new osmo-remsim-client-shell binary
This is a remsim-client with an interactive 'shell', where the user
can type in C-APDUs in hex formats, which will be sent to the bankd /
SIM-card.  Responses received from SIM Card via bankd will be printed
in return.

Change-Id: I636505fd9741833ccf5cbd1bcac30f7b9aa94425
2020-02-16 15:41:56 +01:00