aboutsummaryrefslogtreecommitdiffstats
path: root/src/diag_io.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/diag_io.c')
-rw-r--r--src/diag_io.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/diag_io.c b/src/diag_io.c
index 9309774..46af445 100644
--- a/src/diag_io.c
+++ b/src/diag_io.c
@@ -23,6 +23,9 @@
#include <string.h>
#include <unistd.h>
+#include <osmocom/core/gsmtap.h>
+#include <osmocom/core/gsmtap_util.h>
+
#include "protocol/protocol.h"
#include "diag_io.h"
#include "diag_cmd.h"
@@ -45,6 +48,11 @@ int diag_transmit_msgb(struct diag_instance *di, struct msgb *msg)
struct diag_send_desc_type send;
struct diag_hdlc_dest_type enc = { NULL, NULL, 0 };
+ if (di->flags & DIAG_INST_F_GSMTAP_DIAG && di->gsmtap) {
+ gsmtap_send_ex(di->gsmtap, GSMTAP_TYPE_QC_DIAG, 0, 0, 0,
+ 0, 0, 0, 0, msgb_l2(msg), msgb_l2len(msg));
+ }
+
if (di->flags & DIAG_INST_F_HEXDUMP)
printf("Tx: %s\n", msgb_hexdump(msg));
@@ -146,6 +154,13 @@ struct msgb *diag_read_msg(struct diag_instance *di)
if (di->flags & DIAG_INST_F_HEXDUMP)
printf("Rx: %s\n", msgb_hexdump(msg));
+ if (di->flags & DIAG_INST_F_GSMTAP_DIAG && di->gsmtap) {
+ gsmtap_send_ex(di->gsmtap, GSMTAP_TYPE_QC_DIAG,
+ GSMTAP_ARFCN_F_UPLINK, 0, 0, 0,
+ 0, 0, 0, msgb_l2(msg),
+ msgb_l2len(msg));
+ }
+
return msg;
}