aboutsummaryrefslogtreecommitdiffstats
path: root/include/osmocom
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2016-12-02 13:54:36 +0100
committerHarald Welte <laforge@gnumonks.org>2016-12-09 17:59:58 +0100
commita65e99331a9699a09d2661b595c1723eea51873f (patch)
tree11a93acca747aeb655b556a1e5efcc6adacacd8b /include/osmocom
parenta24be85dc41885ee77072af9f079c69c575061e9 (diff)
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
Diffstat (limited to 'include/osmocom')
-rw-r--r--include/osmocom/core/gsmtap.h19
1 files changed, 19 insertions, 0 deletions
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));