#ifndef PFIXTOOLS_CONFIG_H
#define PFIXTOOLS_CONFIG_H
+#include "filter.h"
+
typedef struct config_t config_t;
+struct config_t {
+ /* SOURCE */
+ /* Root configuration file.
+ */
+ const char *filename;
+
+ /* Parameters.
+ */
+ A(filter_param_t) params;
+
+
+ /* INTERPRETED */
+ /* Filters.
+ */
+ A(filter_t) filters;
+
+ /* Entry point of the filters.
+ * (one per smtp state)
+ */
+ int entry_points[SMTP_count];
+
+ /* Port on which the program have to bind to.
+ * The parameter from CLI override the parameter from configuration file.
+ */
+ uint16_t port;
+
+ /* Log message.
+ */
+ char *log_format;
+};
+
+#define DEFAULT_LOG_FORMAT \
+ "request client=${client_name}[${client_address}] from=<${sender}> " \
+ "to=<${recipient}> at ${protocol_state}"
+
__attribute__((nonnull(1)))
config_t *config_read(const char *file);
+__attribute__((nonnull(1)))
+bool config_check(const char *file);
+
+__attribute__((nonnull(1)))
+bool config_reload(config_t *config);
+
void config_delete(config_t **config);
#endif