25 #ifndef LOGPIPE_H_INCLUDED
26 #define LOGPIPE_H_INCLUDED
36 #define NC_READ_ERROR 2
37 #define NC_WRITE_ERROR 3
38 #define NC_FILE_MOVED 4
40 #define NC_REOPEN_REQUIRED 6
41 #define NC_FILE_DELETED 7
42 #define NC_FILE_MODIFIED 8
44 #define NC_LOGROTATE 10
48 #define NR_ERROR 0x0001
49 #define NR_STOP_ON_EOF 0x0002
52 #define PIF_INITIALIZED 0x0001
54 #define PIF_INLINED 0x0002
62 #define PIF_SOURCE 0x0004
65 #define PIF_BRANCH_FINAL 0x0008
66 #define PIF_BRANCH_FALLBACK 0x0010
67 #define PIF_BRANCH_PROPERTIES (PIF_BRANCH_FINAL + PIF_BRANCH_FALLBACK)
70 #define PIF_HARD_FLOW_CONTROL 0x0020
73 #define PIF_CONDITIONAL_MIDPOINT 0x0040
76 #define PIF_JUNCTION_END 0x0080
79 #define PIF_CONFIG_RELATED 0x0100
83 #define PIF_PRIVATE(x) ((x) << 16)
227 #define LOG_PATH_OPTIONS_INIT { TRUE, FALSE, NULL, NULL }
228 #define LOG_PATH_OPTIONS_INIT_NOACK { FALSE, FALSE, NULL, NULL }
233 static inline LogPathOptions *
234 log_path_options_chain(LogPathOptions *local_path_options,
const LogPathOptions *lpo_previous_hop)
236 *local_path_options = *lpo_previous_hop;
237 return local_path_options;
249 log_path_options_push_junction(LogPathOptions *local_path_options,
251 const LogPathOptions *lpo_parent_junction)
253 *local_path_options = *lpo_parent_junction;
254 local_path_options->matched = matched;
255 local_path_options->lpo_parent_junction = lpo_parent_junction;
264 log_path_options_pop_conditional(LogPathOptions *local_path_options)
266 if (local_path_options->lpo_parent_junction)
267 local_path_options->matched = local_path_options->lpo_parent_junction->matched;
284 log_path_options_pop_junction(LogPathOptions *local_path_options)
286 log_path_options_pop_conditional(local_path_options);
288 if (local_path_options->lpo_parent_junction)
289 local_path_options->lpo_parent_junction = local_path_options->lpo_parent_junction->lpo_parent_junction;
315 gboolean (*
init)(LogPipe *
self);
326 const gchar *(*generate_persist_name)(
const LogPipe *
self);
327 GList *(*arcs)(LogPipe *
self);
333 LogPipe *(*clone)(LogPipe *
self);
336 gint (*
notify)(LogPipe *
self, gint notify_code, gpointer user_data);
348 G_STATIC_ASSERT(G_STRUCT_OFFSET(LogPipe, queue) - G_STRUCT_OFFSET(LogPipe, flags) <= 4);
362 static inline GlobalConfig *
363 log_pipe_get_config(LogPipe *s)
370 log_pipe_set_config(LogPipe *s, GlobalConfig *
cfg)
376 log_pipe_reset_config(LogPipe *s)
378 log_pipe_set_config(s, NULL);
381 static inline gboolean
382 log_pipe_init(LogPipe *s)
386 if (s->pre_init && !s->pre_init(s))
388 if (!s->init || s->init(s))
400 static inline gboolean
401 log_pipe_deinit(LogPipe *s)
405 if (!s->deinit || s->deinit(s))
420 static inline gboolean
421 log_pipe_pre_config_init(LogPipe *s)
423 if (s->pre_config_init)
424 return s->pre_config_init(s);
428 static inline gboolean
429 log_pipe_post_config_init(LogPipe *s)
431 if (s->post_config_init)
432 return s->post_config_init(s);
436 static inline LogPipe *
437 log_pipe_clone(LogPipe *
self)
439 g_assert(NULL !=
self->clone);
440 return self->clone(
self);
444 log_pipe_notify(LogPipe *s, gint notify_code, gpointer user_data)
447 return s->notify(s, notify_code, user_data);
452 log_pipe_append(LogPipe *s, LogPipe *next)
469 static inline GList *
470 log_pipe_get_arcs(LogPipe *s)
void cfg_tree_register_initialized_pipe(CfgTree *self, LogPipe *s)
Definition: cfg-tree.c:676
void cfg_tree_deregister_initialized_pipe(CfgTree *self, LogPipe *s)
Definition: cfg-tree.c:696
void log_pipe_forward_msg(LogPipe *self, LogMessage *msg, const LogPathOptions *path_options)
Definition: logpipe.c:32
void log_pipe_attach_expr_node(LogPipe *self, LogExprNode *expr_node)
Definition: logpipe.c:114
#define NR_OK
Definition: logpipe.h:47
LogPipe * log_pipe_new(GlobalConfig *cfg)
Definition: logpipe.c:159
void log_pipe_forward_notify(LogPipe *self, gint notify_code, gpointer user_data)
Definition: logpipe.c:211
gboolean log_pipe_is_internal(const LogPipe *self)
Definition: logpipe.c:243
const gchar * log_pipe_get_persist_name(const LogPipe *self)
Definition: logpipe.c:224
#define PIF_INITIALIZED
Definition: logpipe.h:52
G_STATIC_ASSERT(G_STRUCT_OFFSET(LogPipe, queue) - G_STRUCT_OFFSET(LogPipe, flags)<=4)
void log_pipe_init_instance(LogPipe *self, GlobalConfig *cfg)
Definition: logpipe.c:145
void log_pipe_detach_expr_node(LogPipe *self)
Definition: logpipe.c:120
void log_pipe_add_info(LogPipe *self, const gchar *info)
Definition: logpipe.c:249
gboolean(* pipe_single_step_hook)(LogPipe *pipe, LogMessage *msg, const LogPathOptions *path_options)
Definition: logpipe.c:29
void log_pipe_free_method(LogPipe *s)
Definition: logpipe.c:168
LogPipe * log_pipe_ref(LogPipe *self)
Definition: logpipe.c:174
void log_pipe_set_internal(LogPipe *self, gboolean internal)
Definition: logpipe.c:237
gboolean log_pipe_unref(LogPipe *self)
Definition: logpipe.c:197
void log_pipe_set_options(LogPipe *self, const LogPipeOptions *options)
Definition: logpipe.c:231
void log_pipe_set_persist_name(LogPipe *self, const gchar *persist_name)
Definition: logpipe.c:217
EVTTAG * log_pipe_location_tag(LogPipe *pipe)
Definition: logpipe.c:108
void log_pipe_clone_method(LogPipe *dst, const LogPipe *src)
Definition: logpipe.c:138
void log_pipe_queue(LogPipe *s, LogMessage *msg, const LogPathOptions *path_options)
Definition: logpipe.c:83
#define self
Definition: rcptid.c:38
Definition: stats-counter.h:67
Definition: logpipe.h:197
gboolean ack_needed
Definition: logpipe.h:207
const LogPathOptions * lpo_parent_junction
Definition: logpipe.h:224
gboolean flow_control_requested
Definition: logpipe.h:221
gboolean * matched
Definition: logpipe.h:223
Definition: logpipe.h:295
Definition: logpipe.h:300
void(* queue)(LogPipe *self, LogMessage *msg, const LogPathOptions *path_options)
Definition: logpipe.h:304
LogPipeOptions options
Definition: logpipe.h:312
gint32 flags
Definition: logpipe.h:302
void(* free_fn)(LogPipe *self)
Definition: logpipe.h:335
void(* post_deinit)(LogPipe *self)
Definition: logpipe.h:317
GlobalConfig * cfg
Definition: logpipe.h:306
gboolean(* pre_init)(LogPipe *self)
Definition: logpipe.h:314
GAtomicCounter ref_cnt
Definition: logpipe.h:301
gchar * plugin_name
Definition: logpipe.h:311
GList * info
Definition: logpipe.h:337
gint(* notify)(LogPipe *self, gint notify_code, gpointer user_data)
Definition: logpipe.h:336
gboolean(* deinit)(LogPipe *self)
Definition: logpipe.h:316
LogExprNode * expr_node
Definition: logpipe.h:307
StatsCounterItem * discarded_messages
Definition: logpipe.h:309
const gchar * persist_name
Definition: logpipe.h:310
gboolean(* pre_config_init)(LogPipe *self)
Definition: logpipe.h:319
gboolean(* init)(LogPipe *self)
Definition: logpipe.h:315
LogPipe * pipe_next
Definition: logpipe.h:308
gboolean(* post_config_init)(LogPipe *self)
Definition: logpipe.h:324
GlobalConfig * cfg
Definition: test_batched_ack_tracker.c:34
LogMessage * msg
Definition: test_rename.c:35
LogPathOptions path_options
Definition: test_wildcard_file_reader.c:62