director-host.h revision bdd36cfdba3ff66d25570a9ff568d69e1eb543cf
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen unsigned int port;
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen /* name contains "ip:port" */
0a53eb0283d7ec28c6105f61e118b96fce8ecb95Timo Sirainen /* change commands each have originating host and originating sequence.
0a53eb0283d7ec28c6105f61e118b96fce8ecb95Timo Sirainen we'll keep track of the highest sequence we've seen from the host.
0a53eb0283d7ec28c6105f61e118b96fce8ecb95Timo Sirainen if we find a lower sequence, we've already handled the command and
0a53eb0283d7ec28c6105f61e118b96fce8ecb95Timo Sirainen it can be ignored (or: it must be ignored to avoid potential command
8c2b4a45f17a5cb13bb01058ca37798cf48d91baTimo Sirainen /* Last time host was detected to be down */
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen /* we are this director */
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainendirector_host_add(struct director *dir, const struct ip_addr *ip,
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen unsigned int port);
e4194f4703eeec32b432371ae30fc8f25ab720d8Timo Sirainenvoid director_host_free(struct director_host **host);
e4194f4703eeec32b432371ae30fc8f25ab720d8Timo Sirainenvoid director_host_ref(struct director_host *host);
e4194f4703eeec32b432371ae30fc8f25ab720d8Timo Sirainenvoid director_host_unref(struct director_host *host);
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainendirector_host_get(struct director *dir, const struct ip_addr *ip,
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen unsigned int port);
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainendirector_host_lookup(struct director *dir, const struct ip_addr *ip,
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen unsigned int port);
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainendirector_host_lookup_ip(struct director *dir, const struct ip_addr *ip);
1055d8038122c4f4190d37d98fdff6791d1306f8Timo Sirainen/* Returns 0 if b1 equals b2.
1055d8038122c4f4190d37d98fdff6791d1306f8Timo Sirainen -1 if b1 is closer to our left side than b2 or
1055d8038122c4f4190d37d98fdff6791d1306f8Timo Sirainen -1 if b2 is closer to our right side than b1
1055d8038122c4f4190d37d98fdff6791d1306f8Timo Sirainen 1 vice versa */
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenint director_host_cmp_to_self(const struct director_host *b1,
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainen/* Parse hosts list (e.g. "host1:port host2 host3:port") and them as
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo Sirainenvoid director_host_add_from_string(struct director *dir, const char *hosts);