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 size_t prebuffering_bytes;
17 uint32_t pacing_rate; // In bytes per second. Default is ~0U (no limit).
18 enum Encoding { STREAM_ENCODING_RAW = 0, STREAM_ENCODING_METACUBE };
20 Encoding src_encoding;
23 struct UDPStreamConfig {
25 std::string src; // Can be empty.
26 uint32_t pacing_rate; // In bytes per second. Default is ~0U (no limit).
27 int ttl; // Default is -1 (use operating system default).
28 int multicast_iface_index; // Default is -1 (use operating system default).
32 std::string url; // As seen by the client.
33 std::string allow_origin; // Can be empty.
36 struct AcceptorConfig {
41 enum { LOG_TYPE_FILE, LOG_TYPE_CONSOLE, LOG_TYPE_SYSLOG } type;
48 std::vector<StreamConfig> streams;
49 std::vector<UDPStreamConfig> udpstreams;
50 std::vector<Gen204Config> pings;
51 std::vector<AcceptorConfig> acceptors;
52 std::vector<LogConfig> log_destinations;
54 std::string stats_file; // Empty means no stats file.
57 std::string input_stats_file; // Empty means no input stats file.
58 int input_stats_interval;
60 std::string access_log_file; // Empty means no accses_log file.
63 // Parse and validate configuration. Returns false on error.
64 // <config> is taken to be empty (uninitialized) on entry.
65 bool parse_config(const std::string &filename, Config *config);
67 #endif // !defined(_CONFIG_H)