Harald Welte | faea754 | 2016-12-24 01:21:03 +0100 | [diff] [blame] | 1 | #include <stdio.h> |
| 2 | |
| 3 | #include "diag_log.h" |
Harald Welte | ce2f396 | 2016-12-30 15:48:22 +0100 | [diff] [blame] | 4 | #include "protocol/diag_log_gsm.h" |
Harald Welte | 84ec50f | 2016-12-24 10:16:00 +0100 | [diff] [blame] | 5 | #include "protocol/diag_log_wcdma.h" |
Harald Welte | faea754 | 2016-12-24 01:21:03 +0100 | [diff] [blame] | 6 | |
| 7 | static 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 Welte | ce2f396 | 2016-12-30 15:48:22 +0100 | [diff] [blame] | 15 | static void handle_gmm_ota_msg(struct log_hdr *lh, struct msgb *msg) |
| 16 | { |
| 17 | /* FIXME */ |
| 18 | } |
| 19 | |
Harald Welte | faea754 | 2016-12-24 01:21:03 +0100 | [diff] [blame] | 20 | static const struct diag_log_dispatch_tbl log_tbl[] = { |
| 21 | { UMTS(LOG_WCDMA_SIGNALING_MSG_C), handle_rrc_sig_msg }, |
Harald Welte | ce2f396 | 2016-12-30 15:48:22 +0100 | [diff] [blame] | 22 | { UMTS(LOG_GPRS_SM_GMM_OTA_MESSAGE_C), handle_gmm_ota_msg }, |
Harald Welte | faea754 | 2016-12-24 01:21:03 +0100 | [diff] [blame] | 23 | }; |
| 24 | |
| 25 | static __attribute__((constructor)) void on_dso_load_umts(void) |
| 26 | { |
| 27 | diag_log_reg_dispatch(log_tbl, ARRAY_SIZE(log_tbl)); |
| 28 | } |