From a65e99331a9699a09d2661b595c1723eea51873f Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Fri, 2 Dec 2016 13:54:36 +0100 Subject: gsmtap: Add defintions for GSMTAP based remote logging Often it is useful to have log statements from the osmocom programs synchronized with protocol traces. So rather than having to open the pcap file with GSMTAP or other protocol data side-by-side with the textual log of one or more network elements, we simply pass the log lines around as GSMTAP messages, which can then be displayed in-order and interspersed with the protocol messages inside wireshark. Change-Id: I33ab530e10ef0311b6f80b731e61894f20b4b3e7 --- include/osmocom/core/gsmtap.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'include') diff --git a/include/osmocom/core/gsmtap.h b/include/osmocom/core/gsmtap.h index c35582e1..bcfc7bdd 100644 --- a/include/osmocom/core/gsmtap.h +++ b/include/osmocom/core/gsmtap.h @@ -45,6 +45,7 @@ #define GSMTAP_TYPE_LTE_RRC 0x0d /* LTE interface */ #define GSMTAP_TYPE_LTE_MAC 0x0e /* LTE MAC interface */ #define GSMTAP_TYPE_LTE_MAC_FRAMED 0x0f /* LTE MAC with context hdr */ +#define GSMTAP_TYPE_OSMOCORE_LOG 0x10 /* libosmocore logging */ /* ====== DO NOT MAKE UNAPPROVED MODIFICATIONS HERE ===== */ @@ -255,3 +256,21 @@ struct gsmtap_hdr { uint8_t res; /*!< reserved for future use (RFU) */ } __attribute__((packed)); + +/*! \brief Structure of the GTMTAP libosmocore logging header */ +struct gsmtap_osmocore_log_hdr { + struct { + uint32_t sec; + uint32_t usec; + } ts; + char proc_name[16]; /*!< name of process */ + uint32_t pid; /*!< process ID */ + uint8_t level; /*!< logging level */ + uint8_t _pad[3]; + /* TODO: color */ + char subsys[16]; /*!< logging sub-system */ + struct { + char name[32]; /*!< source file name */ + uint32_t line_nr;/*!< line number */ + } src_file; +} __attribute__((packed)); -- cgit v1.2.3