From 9088ca86ff55910a3c5fc53394b3a9e29d201624 Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Tue, 5 Apr 2022 19:18:46 +0200 Subject: [PATCH] simtrace2-cardem-pcsc.c: Send APDUs via GSMTAP Previously, only simtrace2-sniff generated GSMTAP protocol traces. Let's add the same functionality to simtrace2-cardem-pcsc. Change-Id: Iba6adf41b480d127bf11ee361c66d80fe8296313 Closes: OS#5494 --- host/src/simtrace2-cardem-pcsc.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/host/src/simtrace2-cardem-pcsc.c b/host/src/simtrace2-cardem-pcsc.c index b7d41bda..4820f369 100644 --- a/host/src/simtrace2-cardem-pcsc.c +++ b/host/src/simtrace2-cardem-pcsc.c @@ -189,6 +189,9 @@ static int process_do_rx_da(struct osmo_st2_cardem_inst *ci, uint8_t *buf, int l msgb_free(tmsg); return rc; } + /* send via GSMTAP for wireshark tracing */ + osmo_st2_gsmtap_send_apdu(GSMTAP_SIM_APDU, tmsg->data, msgb_length(tmsg)); + msgb_apdu_sw(tmsg) = msgb_get_u16(tmsg); ac.sw[0] = msgb_apdu_sw(tmsg) >> 8; ac.sw[1] = msgb_apdu_sw(tmsg) & 0xff;