Lines Matching defs:dir
26 director_host_add(struct director *dir,
31 i_assert(director_host_lookup(dir, ip, port) == NULL);
34 host->dir = dir;
41 array_append(&dir->dir_hosts, &host, 1);
45 array_sort(&dir->dir_hosts, director_host_cmp_p);
75 hosts = array_get(&host->dir->dir_hosts, &count);
78 array_delete(&host->dir->dir_hosts, i, 1);
96 director_host_get(struct director *dir, const struct ip_addr *ip,
101 host = director_host_lookup(dir, ip, port);
103 host = director_host_add(dir, ip, port);
108 director_host_lookup(struct director *dir, const struct ip_addr *ip,
113 array_foreach(&dir->dir_hosts, hostp) {
122 director_host_lookup_ip(struct director *dir, const struct ip_addr *ip)
126 array_foreach(&dir->dir_hosts, hostp) {
154 static void director_host_add_string(struct director *dir, const char *host)
160 if (net_str2hostport(host, dir->self_port, &host, &port) < 0)
167 if (director_host_lookup(dir, &ips[i], port) == NULL)
168 (void)director_host_add(dir, &ips[i], port);
172 void director_host_add_from_string(struct director *dir, const char *hosts)
179 director_host_add_string(dir, *tmp);
182 if (array_count(&dir->dir_hosts) == 0) {
188 dir->self_host = director_host_add(dir, &ip, 0);
189 dir->self_host->self = TRUE;