blob: 609e09d8445b4cdb10970dbc4fee978e0dc4f2da [file] [log] [blame]
Harald Weltefaea7542016-12-24 01:21:03 +01001#include <stdio.h>
2
3#include "diag_log.h"
Harald Weltece2f3962016-12-30 15:48:22 +01004#include "protocol/diag_log_gsm.h"
Harald Welte84ec50f2016-12-24 10:16:00 +01005#include "protocol/diag_log_wcdma.h"
Harald Weltefaea7542016-12-24 01:21:03 +01006
7static void handle_rrc_sig_msg(struct log_hdr *lh, struct msgb *msg)
8{
9 struct diag_umts_rrc_msg *rrm = (struct diag_umts_rrc_msg *) msgb_data(msg);
10
11 printf("RRC: %u %u %u: %s\n", rrm->chan_type, rrm->rb_id, rrm->length,
12 osmo_hexdump(msgb_data(msg), rrm->length));
13}
14
Harald Weltece2f3962016-12-30 15:48:22 +010015static void handle_gmm_ota_msg(struct log_hdr *lh, struct msgb *msg)
16{
17 /* FIXME */
18}
19
Harald Weltefaea7542016-12-24 01:21:03 +010020static const struct diag_log_dispatch_tbl log_tbl[] = {
21 { UMTS(LOG_WCDMA_SIGNALING_MSG_C), handle_rrc_sig_msg },
Harald Weltece2f3962016-12-30 15:48:22 +010022 { UMTS(LOG_GPRS_SM_GMM_OTA_MESSAGE_C), handle_gmm_ota_msg },
Harald Weltefaea7542016-12-24 01:21:03 +010023};
24
25static __attribute__((constructor)) void on_dso_load_umts(void)
26{
27 diag_log_reg_dispatch(log_tbl, ARRAY_SIZE(log_tbl));
28}