b44033e45e9f48f8a6e1ac5905234fec5de6d6ccAki Tuomi/* mail_tags aren't removed/freed before mail_hosts_deinit(), so it's safe
b44033e45e9f48f8a6e1ac5905234fec5de6d6ccAki Tuomi to add pointers to them. */
b44033e45e9f48f8a6e1ac5905234fec5de6d6ccAki Tuomi /* "" = no tag */
b44033e45e9f48f8a6e1ac5905234fec5de6d6ccAki Tuomi /* temporary user -> host associations */
a5ddfd7a8b473f73135b93d5e081e470a87f0f7eTimo Sirainen /* server up/down. down=TRUE has effectively the same result as if
a5ddfd7a8b473f73135b93d5e081e470a87f0f7eTimo Sirainen vhost_count=0. */
8752573c44bcd139ae3ecc6d8e917c2c60bcb89fTimo Sirainen /* host was recently changed and ring hasn't synced yet since */
2670cd577aa57eb9f915a4f4220ae48c9b4fc5fbTimo SirainenARRAY_DEFINE_TYPE(mail_host, struct mail_host *);
09060303d565e15d54e42b4ef722f9d3c26f5336Timo Sirainenmail_host_add_ip(struct mail_host_list *list, const struct ip_addr *ip,
9de5eb9e1ac3a07c4197a60fdefd412d6cc78eb2Timo Sirainenmail_host_add_hostname(struct mail_host_list *list, const char *hostname,
e3751d40053ce9ad5001284f1bc8a0e5ba42ce10Timo Sirainen const struct ip_addr *ip, const char *tag_name);
cf9d67e4a9bfee31cf3be05244555d51a3d1b9feTimo Sirainenmail_host_lookup(struct mail_host_list *list, const struct ip_addr *ip);
09060303d565e15d54e42b4ef722f9d3c26f5336Timo Sirainenmail_host_get_by_hash(struct mail_host_list *list, unsigned int hash,
cf9d67e4a9bfee31cf3be05244555d51a3d1b9feTimo Sirainenint mail_hosts_parse_and_add(struct mail_host_list *list,
4af552f09aad93a2ae09efa6024f4ec6bb11f499Aki Tuomiconst char *mail_host_get_tag(const struct mail_host *host);
e3751d40053ce9ad5001284f1bc8a0e5ba42ce10Timo Sirainenvoid mail_host_set_tag(struct mail_host *host, const char *tag_name);
b3abfd0ac256ffa0cbfd74c3793eac4e83d41f78Martti Rannanjärvivoid mail_host_set_down(struct mail_host *host, bool down, time_t timestamp,
b3abfd0ac256ffa0cbfd74c3793eac4e83d41f78Martti Rannanjärvivoid mail_host_set_vhost_count(struct mail_host *host, unsigned int vhost_count,
8752573c44bcd139ae3ecc6d8e917c2c60bcb89fTimo Sirainenvoid mail_hosts_set_synced(struct mail_host_list *list);
131cb5910775213d5bc0dcf75e4fddda6f8c5a11Timo Sirainenunsigned int mail_hosts_hash(struct mail_host_list *list);
09060303d565e15d54e42b4ef722f9d3c26f5336Timo Sirainenbool mail_hosts_have_usable(struct mail_host_list *list);
cf9d67e4a9bfee31cf3be05244555d51a3d1b9feTimo Sirainenconst ARRAY_TYPE(mail_host) *mail_hosts_get(struct mail_host_list *list);
ae32667c54480d329eed994b3defab89cd76c077Timo Sirainenbool mail_hosts_have_tags(struct mail_host_list *list);
b44033e45e9f48f8a6e1ac5905234fec5de6d6ccAki Tuomiconst ARRAY_TYPE(mail_tag) *mail_hosts_get_tags(struct mail_host_list *list);
b44033e45e9f48f8a6e1ac5905234fec5de6d6ccAki Tuomimail_tag_find(struct mail_host_list *list, const char *tag_name);
b44033e45e9f48f8a6e1ac5905234fec5de6d6ccAki Tuomimail_hosts_find_user(struct mail_host_list *list, const char *tag_name,
b44033e45e9f48f8a6e1ac5905234fec5de6d6ccAki Tuomi unsigned int username_hash);
00cc7eb569710722af0e0af652034b9fc22c57dfMartti Rannanjärvimail_hosts_init(unsigned int user_expire_secs,
cf9d67e4a9bfee31cf3be05244555d51a3d1b9feTimo Sirainenvoid mail_hosts_deinit(struct mail_host_list **list);
edd318d5866ac3fbc6e8df28fb24a4dfef93c884Timo Sirainenstruct mail_host_list *mail_hosts_dup(const struct mail_host_list *src);