X-Git-Url: https://git.octo.it/?p=collectd.git;a=blobdiff_plain;f=src%2Fdaemon%2Ffilter_chain.h;h=5cc06fc50be6a1cdcbeaa85b085db6afc269e7b5;hp=2db90dbb6938f99eb83e280fc611834f13eeceae;hb=7111bb6df7628edce3a8e538b386fbe27633a191;hpb=abc30f241619b3eb66c801c324390e1e9e6e001f diff --git a/src/daemon/filter_chain.h b/src/daemon/filter_chain.h index 2db90dbb..5cc06fc5 100644 --- a/src/daemon/filter_chain.h +++ b/src/daemon/filter_chain.h @@ -28,45 +28,44 @@ #define FILTER_CHAIN_H 1 #include "collectd.h" + #include "plugin.h" -#define FC_MATCH_NO_MATCH 0 -#define FC_MATCH_MATCHES 1 +#define FC_MATCH_NO_MATCH 0 +#define FC_MATCH_MATCHES 1 #define FC_TARGET_CONTINUE 0 -#define FC_TARGET_STOP 1 -#define FC_TARGET_RETURN 2 +#define FC_TARGET_STOP 1 +#define FC_TARGET_RETURN 2 /* * Match functions */ -struct match_proc_s -{ - int (*create) (const oconfig_item_t *ci, void **user_data); - int (*destroy) (void **user_data); - int (*match) (const data_set_t *ds, const value_list_t *vl, - notification_meta_t **meta, void **user_data); +struct match_proc_s { + int (*create)(const oconfig_item_t *ci, void **user_data); + int (*destroy)(void **user_data); + int (*match)(const data_set_t *ds, const value_list_t *vl, + notification_meta_t **meta, void **user_data); }; typedef struct match_proc_s match_proc_t; -int fc_register_match (const char *name, match_proc_t proc); +int fc_register_match(const char *name, match_proc_t proc); /* * Target functions */ -struct target_proc_s -{ - int (*create) (const oconfig_item_t *ci, void **user_data); - int (*destroy) (void **user_data); - int (*invoke) (const data_set_t *ds, value_list_t *vl, - notification_meta_t **meta, void **user_data); +struct target_proc_s { + int (*create)(const oconfig_item_t *ci, void **user_data); + int (*destroy)(void **user_data); + int (*invoke)(const data_set_t *ds, value_list_t *vl, + notification_meta_t **meta, void **user_data); }; typedef struct target_proc_s target_proc_t; struct fc_chain_s; typedef struct fc_chain_s fc_chain_t; -int fc_register_target (const char *name, target_proc_t proc); +int fc_register_target(const char *name, target_proc_t proc); /* * TODO: Chain management @@ -90,17 +89,15 @@ int fc_rule_delete (const char *chain_name, int position); /* * Processing function */ -fc_chain_t *fc_chain_get_by_name (const char *chain_name); +fc_chain_t *fc_chain_get_by_name(const char *chain_name); -int fc_process_chain (const data_set_t *ds, value_list_t *vl, - fc_chain_t *chain); +int fc_process_chain(const data_set_t *ds, value_list_t *vl, fc_chain_t *chain); -int fc_default_action (const data_set_t *ds, value_list_t *vl); +int fc_default_action(const data_set_t *ds, value_list_t *vl); -/* +/* * Shortcut for global configuration */ -int fc_configure (const oconfig_item_t *ci); +int fc_configure(const oconfig_item_t *ci); #endif /* FILTER_CHAIN_H */ -/* vim: set sw=2 sts=2 et : */