4 // Various routines that deal with parsing the configuration file.
11 struct MarkPoolConfig {
16 std::string url; // As seen by the client.
17 std::string src; // Can be empty.
19 int mark_pool; // -1 for none.
20 enum { STREAM_ENCODING_RAW = 0, STREAM_ENCODING_METACUBE } encoding;
23 struct UDPStreamConfig {
25 std::string src; // Can be empty.
26 int mark_pool; // -1 for none.
29 struct AcceptorConfig {
34 enum { LOG_TYPE_FILE, LOG_TYPE_CONSOLE, LOG_TYPE_SYSLOG } type;
41 std::vector<MarkPoolConfig> mark_pools;
42 std::vector<StreamConfig> streams;
43 std::vector<UDPStreamConfig> udpstreams;
44 std::vector<AcceptorConfig> acceptors;
45 std::vector<LogConfig> log_destinations;
47 std::string stats_file; // Empty means no stats file.
50 std::string access_log_file; // Empty means no accses_log file.
53 // Parse and validate configuration. Returns false on error.
54 // <config> is taken to be empty (uninitialized) on entry.
55 bool parse_config(const std::string &filename, Config *config);
57 #endif // !defined(_CONFIG_H)