4 // Various routines that deal with parsing the configuration file.
7 #include <netinet/in.h>
13 std::string url; // As seen by the client.
14 std::string src; // Can be empty.
16 uint32_t pacing_rate; // In bytes per second. Default is ~0U (no limit).
17 enum { STREAM_ENCODING_RAW = 0, STREAM_ENCODING_METACUBE } encoding;
20 struct UDPStreamConfig {
22 std::string src; // Can be empty.
23 uint32_t pacing_rate; // In bytes per second. Default is ~0U (no limit).
24 int ttl; // Default is -1 (use operating system default).
27 struct AcceptorConfig {
32 enum { LOG_TYPE_FILE, LOG_TYPE_CONSOLE, LOG_TYPE_SYSLOG } type;
39 std::vector<StreamConfig> streams;
40 std::vector<UDPStreamConfig> udpstreams;
41 std::vector<AcceptorConfig> acceptors;
42 std::vector<LogConfig> log_destinations;
44 std::string stats_file; // Empty means no stats file.
47 std::string input_stats_file; // Empty means no input stats file.
48 int input_stats_interval;
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)