summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2016-12-02 15:30:02 +0100
committerHarald Welte <laforge@gnumonks.org>2016-12-09 17:59:58 +0100
commitaa00f99be2e4cc64ede20d8c9548b83054696581 (patch)
treed18f900b36987bfaa990268b5f4902cf6a704810 /include
parenta65e99331a9699a09d2661b595c1723eea51873f (diff)
Implement GSMTAP log target
This target wraps the to-be-logged string (With metadata) into a GSMTAP packet and sends it to the configured destination address. Change-Id: I9a7e72b8c9c6f6f2d76d1ea2332dcdee12394625
Diffstat (limited to 'include')
-rw-r--r--include/osmocom/core/logging.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/osmocom/core/logging.h b/include/osmocom/core/logging.h
index 581ebcec..ad775b9b 100644
--- a/include/osmocom/core/logging.h
+++ b/include/osmocom/core/logging.h
@@ -9,6 +9,7 @@
#include <stdio.h>
#include <stdint.h>
#include <stdarg.h>
+#include <stdbool.h>
#include <osmocom/core/linuxlist.h>
/*! \brief Maximum number of logging contexts */
@@ -122,6 +123,7 @@ typedef int log_filter(const struct log_context *ctx,
struct log_info;
struct vty;
+struct gsmtap_inst;
typedef void log_print_filters(struct vty *vty,
const struct log_info *info,
@@ -156,6 +158,7 @@ enum log_target_type {
LOG_TGT_TYPE_FILE, /*!< \brief text file logging */
LOG_TGT_TYPE_STDERR, /*!< \brief stderr logging */
LOG_TGT_TYPE_STRRB, /*!< \brief osmo_strrb-backed logging */
+ LOG_TGT_TYPE_GSMTAP, /*!< \brief GSMTAP network logging */
};
/*! \brief structure representing a logging target */
@@ -204,6 +207,12 @@ struct log_target {
struct {
void *rb;
} tgt_rb;
+
+ struct {
+ struct gsmtap_inst *gsmtap_inst;
+ const char *ident;
+ const char *hostname;
+ } tgt_gsmtap;
};
/*! \brief call-back function to be called when the logging framework
@@ -254,6 +263,7 @@ void log_set_print_filename(struct log_target *target, int);
void log_set_print_category(struct log_target *target, int);
void log_set_log_level(struct log_target *target, int log_level);
void log_parse_category_mask(struct log_target *target, const char* mask);
+const char* log_category_name(int subsys);
int log_parse_level(const char *lvl);
const char *log_level_str(unsigned int lvl);
int log_parse_category(const char *category);
@@ -267,6 +277,10 @@ struct log_target *log_target_create_stderr(void);
struct log_target *log_target_create_file(const char *fname);
struct log_target *log_target_create_syslog(const char *ident, int option,
int facility);
+struct log_target *log_target_create_gsmtap(const char *host, uint16_t port,
+ const char *ident,
+ bool ofd_wq_mode,
+ bool add_sink);
int log_target_file_reopen(struct log_target *tgt);
int log_targets_reopen(void);