66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidêncio/*
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidêncio Authors:
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidêncio Fabiano Fidêncio <fidencio@redhat.com>
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidêncio
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidêncio Copyright (C) 2017 Red Hat
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidêncio
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidêncio This program is free software; you can redistribute it and/or modify
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidêncio it under the terms of the GNU General Public License as published by
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidêncio the Free Software Foundation; either version 3 of the License, or
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidêncio (at your option) any later version.
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidêncio
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidêncio This program is distributed in the hope that it will be useful,
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidêncio but WITHOUT ANY WARRANTY; without even the implied warranty of
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidêncio MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidêncio GNU General Public License for more details.
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidêncio
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidêncio You should have received a copy of the GNU General Public License
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidêncio along with this program. If not, see <http://www.gnu.org/licenses/>.
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidêncio*/
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidêncio
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidêncio#ifndef _CACHE_REQ_DOMAIN_H_
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidêncio#define _CACHE_REQ_DOMAIN_H_
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidêncio
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidêncio#include "responder/common/responder.h"
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidêncio
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidênciostruct cache_req_domain {
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidêncio struct sss_domain_info *domain;
dae798231fc2c575f213785768bc24ed765ba243Fabiano Fidêncio bool fqnames;
f2a5e29f063f9d623c1336d76f4b2bc500c1a5e2Jakub Hrozek bool locate_domain;
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidêncio
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidêncio struct cache_req_domain *prev;
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidêncio struct cache_req_domain *next;
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidêncio};
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidêncio
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidênciostruct cache_req_domain *
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidênciocache_req_domain_get_domain_by_name(struct cache_req_domain *domains,
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidêncio const char *name);
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidêncio
86526891366c4bc3e1ee861143b736d2670a6ba8Fabiano Fidêncio/*
86526891366c4bc3e1ee861143b736d2670a6ba8Fabiano Fidêncio * This function may have a side effect of setting the output_fqnames' domain
86526891366c4bc3e1ee861143b736d2670a6ba8Fabiano Fidêncio * property when it's called.
86526891366c4bc3e1ee861143b736d2670a6ba8Fabiano Fidêncio *
86526891366c4bc3e1ee861143b736d2670a6ba8Fabiano Fidêncio * It happens as the output_fqnames' domain property must only be set depending
86526891366c4bc3e1ee861143b736d2670a6ba8Fabiano Fidêncio * on whether a domain resolution order is set or not, and the saner place to
86526891366c4bc3e1ee861143b736d2670a6ba8Fabiano Fidêncio * set it to all domains is when flattening those (thus, in this function).
86526891366c4bc3e1ee861143b736d2670a6ba8Fabiano Fidêncio */
a3faad0e4dc1ca4473746c3822ecfc5aed876e6dFabiano Fidêncioerrno_t
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidênciocache_req_domain_new_list_from_domain_resolution_order(
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidêncio TALLOC_CTX *mem_ctx,
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidêncio struct sss_domain_info *domains,
a3faad0e4dc1ca4473746c3822ecfc5aed876e6dFabiano Fidêncio const char *domain_resolution_order,
a3faad0e4dc1ca4473746c3822ecfc5aed876e6dFabiano Fidêncio struct cache_req_domain **_cr_domains);
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidêncio
0f44eefe2ce75a0814c8688495477f6c57f3d39aFabiano Fidêncioerrno_t
0f44eefe2ce75a0814c8688495477f6c57f3d39aFabiano Fidênciocache_req_domain_copy_cr_domains(TALLOC_CTX *mem_ctx,
0f44eefe2ce75a0814c8688495477f6c57f3d39aFabiano Fidêncio struct cache_req_domain *src,
0f44eefe2ce75a0814c8688495477f6c57f3d39aFabiano Fidêncio struct cache_req_domain **_dest);
0f44eefe2ce75a0814c8688495477f6c57f3d39aFabiano Fidêncio
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidênciovoid cache_req_domain_list_zfree(struct cache_req_domain **cr_domains);
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidêncio
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidêncio
66c8e92eb5a4985bb7f64c349a53b08030a000cfFabiano Fidêncio#endif /* _CACHE_REQ_DOMAIN_H_ */