+extern int dcp_audio_frame_rate (int);
+extern int stride_round_up (int, int const *, int);
+extern std::multimap<std::string, std::string> read_key_value (std::istream& s);
+extern int get_required_int (std::multimap<std::string, std::string> const & kv, std::string k);
+extern float get_required_float (std::multimap<std::string, std::string> const & kv, std::string k);
+extern std::string get_required_string (std::multimap<std::string, std::string> const & kv, std::string k);
+extern int get_optional_int (std::multimap<std::string, std::string> const & kv, std::string k);
+extern std::string get_optional_string (std::multimap<std::string, std::string> const & kv, std::string k);
+extern void* wrapped_av_malloc (size_t);
+extern int64_t divide_with_round (int64_t a, int64_t b);
+
+/** @class Socket
+ * @brief A class to wrap a boost::asio::ip::tcp::socket with some things
+ * that are useful for DCP-o-matic.
+ *
+ * This class wraps some things that I could not work out how to do with boost;
+ * most notably, sync read/write calls with timeouts.
+ */
+class Socket