aboutsummaryrefslogtreecommitdiffstats
path: root/src/main.h
diff options
context:
space:
mode:
authorVsevolod Stakhov <vsevolod@highsecure.ru>2014-07-23 12:57:31 +0100
committerVsevolod Stakhov <vsevolod@highsecure.ru>2014-07-23 12:57:31 +0100
commit379055dbbb4af997b4d3ffb161d447872d7ca357 (patch)
tree3774553d470f93e12ddeb454aad9b3b607cf8918 /src/main.h
parent602ae7a0b7e215ba2677131b8fdc70abc156b3ca (diff)
downloadrspamd-379055dbbb4af997b4d3ffb161d447872d7ca357.tar.gz
rspamd-379055dbbb4af997b4d3ffb161d447872d7ca357.zip
Unify style without sorting headers.
Diffstat (limited to 'src/main.h')
-rw-r--r--src/main.h128
1 files changed, 66 insertions, 62 deletions
diff --git a/src/main.h b/src/main.h
index df3792d13..577cd5c42 100644
--- a/src/main.h
+++ b/src/main.h
@@ -43,21 +43,21 @@
#define CR '\r'
#define LF '\n'
-/**
- * Worker process structure
+/**
+ * Worker process structure
*/
struct rspamd_worker {
- pid_t pid; /**< pid of worker */
- gboolean is_initialized; /**< is initialized */
- gboolean is_dying; /**< if worker is going to shutdown */
- gboolean pending; /**< if worker is pending to run */
- struct rspamd_main *srv; /**< pointer to server structure */
- GQuark type; /**< process type */
- struct event sig_ev_usr1; /**< signals event */
- struct event sig_ev_usr2; /**< signals event */
- GList *accept_events; /**< socket events */
- struct rspamd_worker_conf *cf; /**< worker config data */
- gpointer ctx; /**< worker's specific data */
+ pid_t pid; /**< pid of worker */
+ gboolean is_initialized; /**< is initialized */
+ gboolean is_dying; /**< if worker is going to shutdown */
+ gboolean pending; /**< if worker is pending to run */
+ struct rspamd_main *srv; /**< pointer to server structure */
+ GQuark type; /**< process type */
+ struct event sig_ev_usr1; /**< signals event */
+ struct event sig_ev_usr2; /**< signals event */
+ GList *accept_events; /**< socket events */
+ struct rspamd_worker_conf *cf; /**< worker config data */
+ gpointer ctx; /**< worker's specific data */
};
/**
@@ -73,40 +73,40 @@ struct mime_part;
struct rspamd_dns_resolver;
struct rspamd_task;
-/**
+/**
* Server statistics
*/
struct rspamd_stat {
- guint messages_scanned; /**< total number of messages scanned */
- guint actions_stat[METRIC_ACTION_NOACTION + 1]; /**< statistic for each action */
- guint connections_count; /**< total connections count */
- guint control_connections_count; /**< connections count to control interface */
- guint messages_learned; /**< messages learned */
- guint fuzzy_hashes; /**< number of fuzzy hashes stored */
- guint fuzzy_hashes_expired; /**< number of fuzzy hashes expired */
+ guint messages_scanned; /**< total number of messages scanned */
+ guint actions_stat[METRIC_ACTION_NOACTION + 1]; /**< statistic for each action */
+ guint connections_count; /**< total connections count */
+ guint control_connections_count; /**< connections count to control interface */
+ guint messages_learned; /**< messages learned */
+ guint fuzzy_hashes; /**< number of fuzzy hashes stored */
+ guint fuzzy_hashes_expired; /**< number of fuzzy hashes expired */
};
/**
* Struct that determine main server object (for logging purposes)
*/
struct rspamd_main {
- struct rspamd_config *cfg; /**< pointer to config structure */
- pid_t pid; /**< main pid */
+ struct rspamd_config *cfg; /**< pointer to config structure */
+ pid_t pid; /**< main pid */
/* Pid file structure */
- rspamd_pidfh_t *pfh; /**< struct pidfh for pidfile */
- GQuark type; /**< process type */
- guint ev_initialized; /**< is event system is initialized */
- struct rspamd_stat *stat; /**< pointer to statistics */
+ rspamd_pidfh_t *pfh; /**< struct pidfh for pidfile */
+ GQuark type; /**< process type */
+ guint ev_initialized; /**< is event system is initialized */
+ struct rspamd_stat *stat; /**< pointer to statistics */
- rspamd_mempool_t *server_pool; /**< server's memory pool */
- statfile_pool_t *statfile_pool; /**< shared statfiles pool */
+ rspamd_mempool_t *server_pool; /**< server's memory pool */
+ statfile_pool_t *statfile_pool; /**< shared statfiles pool */
GHashTable *workers; /**< workers pool indexed by pid */
- rspamd_hash_t *counters; /**< symbol cache counters */
+ rspamd_hash_t *counters; /**< symbol cache counters */
rspamd_logger_t *logger;
- uid_t workers_uid; /**< worker's uid running to */
- gid_t workers_gid; /**< worker's gid running to */
- gboolean is_privilleged; /**< true if run in privilleged mode */
- struct roll_history *history; /**< rolling history */
+ uid_t workers_uid; /**< worker's uid running to */
+ gid_t workers_gid; /**< worker's gid running to */
+ gboolean is_privilleged; /**< true if run in privilleged mode */
+ struct roll_history *history; /**< rolling history */
};
struct counter_data {
@@ -127,10 +127,11 @@ struct process_exception {
*/
struct controller_command;
struct controller_session;
-typedef gboolean (*controller_func_t)(gchar **args, struct controller_session *session);
+typedef gboolean (*controller_func_t)(gchar **args,
+ struct controller_session *session);
struct controller_session {
- struct rspamd_worker *worker; /**< pointer to worker structure (controller in fact) */
+ struct rspamd_worker *worker; /**< pointer to worker structure (controller in fact) */
enum {
STATE_COMMAND,
STATE_HEADER,
@@ -142,45 +143,48 @@ struct controller_session {
STATE_OTHER,
STATE_WAIT,
STATE_WEIGHTS
- } state; /**< current session state */
- gint sock; /**< socket descriptor */
+ } state; /**< current session state */
+ gint sock; /**< socket descriptor */
/* Access to authorized commands */
- gboolean authorized; /**< whether this session is authorized */
- gboolean restful; /**< whether this session is a restful session */
- GHashTable *kwargs; /**< keyword arguments for restful command */
- struct controller_command *cmd; /**< real command */
- rspamd_mempool_t *session_pool; /**< memory pool for session */
- struct rspamd_config *cfg; /**< pointer to config file */
- gchar *learn_rcpt; /**< recipient for learning */
- gchar *learn_from; /**< from address for learning */
+ gboolean authorized; /**< whether this session is authorized */
+ gboolean restful; /**< whether this session is a restful session */
+ GHashTable *kwargs; /**< keyword arguments for restful command */
+ struct controller_command *cmd; /**< real command */
+ rspamd_mempool_t *session_pool; /**< memory pool for session */
+ struct rspamd_config *cfg; /**< pointer to config file */
+ gchar *learn_rcpt; /**< recipient for learning */
+ gchar *learn_from; /**< from address for learning */
struct rspamd_classifier_config *learn_classifier;
- gchar *learn_symbol; /**< symbol to train */
- double learn_multiplier; /**< multiplier for learning */
- rspamd_io_dispatcher_t *dispatcher; /**< IO dispatcher object */
- f_str_t *learn_buf; /**< learn input */
- GList *parts; /**< extracted mime parts */
- gint in_class; /**< positive or negative learn */
+ gchar *learn_symbol; /**< symbol to train */
+ double learn_multiplier; /**< multiplier for learning */
+ rspamd_io_dispatcher_t *dispatcher; /**< IO dispatcher object */
+ f_str_t *learn_buf; /**< learn input */
+ GList *parts; /**< extracted mime parts */
+ gint in_class; /**< positive or negative learn */
gboolean (*other_handler)(struct controller_session *session,
- f_str_t *in); /**< other command handler to execute at the end of processing */
- void *other_data; /**< and its data */
- controller_func_t custom_handler; /**< custom command handler */
- struct rspamd_async_session* s; /**< async session object */
+ f_str_t *in); /**< other command handler to execute at the end of processing */
+ void *other_data; /**< and its data */
+ controller_func_t custom_handler; /**< custom command handler */
+ struct rspamd_async_session * s; /**< async session object */
struct rspamd_task *learn_task;
- struct rspamd_dns_resolver *resolver; /**< DNS resolver */
- struct event_base *ev_base; /**< Event base */
+ struct rspamd_dns_resolver *resolver; /**< DNS resolver */
+ struct event_base *ev_base; /**< Event base */
};
/**
* Common structure representing C module context
*/
struct module_ctx {
- gint (*filter)(struct rspamd_task *task); /**< pointer to headers process function */
+ gint (*filter)(struct rspamd_task *task); /**< pointer to headers process function */
};
/**
* Register custom controller function
*/
-void register_custom_controller_command (const gchar *name, controller_func_t handler, gboolean privilleged, gboolean require_message);
+void register_custom_controller_command (const gchar *name,
+ controller_func_t handler,
+ gboolean privilleged,
+ gboolean require_message);
/**
* If set, reopen log file on next write
@@ -189,6 +193,6 @@ extern struct rspamd_main *rspamd_main;
#endif
-/*
- * vi:ts=4
+/*
+ * vi:ts=4
*/