aboutsummaryrefslogtreecommitdiffstats
path: root/src/diag_log_umts.c
blob: 4826548aa71a4548d7cca7a34ac26d18ad095bc9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#include <stdio.h>

#include "diag_log.h"
#include "protocol/diag_log_umts.h"

static void handle_nas_msg(struct log_hdr *lh, struct msgb *msg)
{
	struct diag_umts_nas_ota_msg *nas = (struct diag_umts_nas_ota_msg *) msgb_data(msg);

	printf("NAS: %cL %u: %s\n", nas->direction ? 'U':'D', nas->msg_length,
		osmo_hexdump(msgb_data(msg), nas->msg_length));
}

static const struct diag_log_dispatch_tbl log_tbl[] = {
	{ UMTS(LOG_UMTS_NAS_OTA_MESSAGE_LOG_PACKET_C), handle_nas_msg },
};

static __attribute__((constructor)) void on_dso_load_umts(void)
{
	diag_log_reg_dispatch(log_tbl, ARRAY_SIZE(log_tbl));
}