4 // Various routines that deal with parsing the configuration file.
7 #include <netinet/in.h>
12 struct MarkPoolConfig {
17 std::string url; // As seen by the client.
18 std::string src; // Can be empty.
20 int mark_pool; // -1 for none.
21 enum { STREAM_ENCODING_RAW = 0, STREAM_ENCODING_METACUBE } encoding;
24 struct UDPStreamConfig {
26 std::string src; // Can be empty.
27 int mark_pool; // -1 for none.
30 struct AcceptorConfig {
35 enum { LOG_TYPE_FILE, LOG_TYPE_CONSOLE, LOG_TYPE_SYSLOG } type;
42 std::vector<MarkPoolConfig> mark_pools;
43 std::vector<StreamConfig> streams;
44 std::vector<UDPStreamConfig> udpstreams;
45 std::vector<AcceptorConfig> acceptors;
46 std::vector<LogConfig> log_destinations;
48 std::string stats_file; // Empty means no stats file.
51 std::string input_stats_file; // Empty means no input stats file.
52 int input_stats_interval;
54 std::string access_log_file; // Empty means no accses_log file.
57 // Parse and validate configuration. Returns false on error.
58 // <config> is taken to be empty (uninitialized) on entry.
59 bool parse_config(const std::string &filename, Config *config);
61 #endif // !defined(_CONFIG_H)