director-connection.h revision 377dd19a90436b8f96902af741a3ea130bc3fe75
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen#ifndef DIRECTOR_CONNECTION_H
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen#define DIRECTOR_CONNECTION_H
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenstruct director_host;
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenstruct director;
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenstruct director_connection *
0a53eb0283d7ec28c6105f61e118b96fce8ecb95Timo Sirainendirector_connection_init_in(struct director *dir, int fd,
0a53eb0283d7ec28c6105f61e118b96fce8ecb95Timo Sirainen const struct ip_addr *ip);
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenstruct director_connection *
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainendirector_connection_init_out(struct director *dir, int fd,
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen struct director_host *host);
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenvoid director_connection_deinit(struct director_connection **conn);
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenvoid director_connection_send(struct director_connection *conn,
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen const char *data);
f64b5bc9e73bedc63ba3c072c286542c29c69e43Timo Sirainenvoid director_connection_set_synced(struct director_connection *conn,
f64b5bc9e73bedc63ba3c072c286542c29c69e43Timo Sirainen bool synced);
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenvoid director_connection_send_except(struct director_connection *conn,
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen struct director_host *skip_host,
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen const char *data);
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen
242abe3ad2423776e9cf05e1304eb8fda4831b23Timo Sirainenconst char *director_connection_get_name(struct director_connection *conn);
0a53eb0283d7ec28c6105f61e118b96fce8ecb95Timo Sirainenstruct director_host *
0a53eb0283d7ec28c6105f61e118b96fce8ecb95Timo Sirainendirector_connection_get_host(struct director_connection *conn);
377dd19a90436b8f96902af741a3ea130bc3fe75Timo Sirainenbool director_connection_is_handshaked(struct director_connection *conn);
caae18c876f81e261350e4957471efa453c0ea9fTimo Sirainenbool director_connection_is_incoming(struct director_connection *conn);
0a53eb0283d7ec28c6105f61e118b96fce8ecb95Timo Sirainen
0a53eb0283d7ec28c6105f61e118b96fce8ecb95Timo Sirainenvoid director_connection_cork(struct director_connection *conn);
0a53eb0283d7ec28c6105f61e118b96fce8ecb95Timo Sirainenvoid director_connection_uncork(struct director_connection *conn);
242abe3ad2423776e9cf05e1304eb8fda4831b23Timo Sirainen
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen#endif