2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina/*
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina Authors:
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina Pavel Březina <pbrezina@redhat.com>
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina Copyright (C) 2016 Red Hat
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina This program is free software; you can redistribute it and/or modify
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina it under the terms of the GNU General Public License as published by
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina the Free Software Foundation; either version 3 of the License, or
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina (at your option) any later version.
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina This program is distributed in the hope that it will be useful,
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina but WITHOUT ANY WARRANTY; without even the implied warranty of
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina GNU General Public License for more details.
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina You should have received a copy of the GNU General Public License
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina along with this program. If not, see <http://www.gnu.org/licenses/>.
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina*/
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina#ifndef _CACHE_REQ_PLUGIN_H_
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina#define _CACHE_REQ_PLUGIN_H_
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina#include "responder/common/cache_req/cache_req_private.h"
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březinaenum cache_object_status {
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina CACHE_OBJECT_VALID,
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina CACHE_OBJECT_EXPIRED,
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina CACHE_OBJECT_MISSING,
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina CACHE_OBJECT_MIDPOINT
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina};
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina
7be55c7de03da57f43fae3db7e6114eebb117a2ePavel Březina/**
7be55c7de03da57f43fae3db7e6114eebb117a2ePavel Březina * Create cache request result manually, if the searched object is well known
7be55c7de03da57f43fae3db7e6114eebb117a2ePavel Březina * and thus can not be found in the cache.
7be55c7de03da57f43fae3db7e6114eebb117a2ePavel Březina *
7be55c7de03da57f43fae3db7e6114eebb117a2ePavel Březina *
7be55c7de03da57f43fae3db7e6114eebb117a2ePavel Březina * @return EOK If it is a well known object and a result was created.
7be55c7de03da57f43fae3db7e6114eebb117a2ePavel Březina * @return ENOENT If it is not a well known object.
7be55c7de03da57f43fae3db7e6114eebb117a2ePavel Březina * @return Other errno code in case of an error.
7be55c7de03da57f43fae3db7e6114eebb117a2ePavel Březina */
7be55c7de03da57f43fae3db7e6114eebb117a2ePavel Březinatypedef errno_t
7be55c7de03da57f43fae3db7e6114eebb117a2ePavel Březina(*cache_req_is_well_known_result_fn)(TALLOC_CTX *mem_ctx,
7be55c7de03da57f43fae3db7e6114eebb117a2ePavel Březina struct cache_req *cr,
7be55c7de03da57f43fae3db7e6114eebb117a2ePavel Březina struct cache_req_data *data,
7be55c7de03da57f43fae3db7e6114eebb117a2ePavel Březina struct cache_req_result **_result);
7be55c7de03da57f43fae3db7e6114eebb117a2ePavel Březina
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina/**
bad19f954d1946fb601df253059afbe011bcc914Pavel Březina * Prepare domain data. Some plug-ins may require to alter lookup data
bad19f954d1946fb601df253059afbe011bcc914Pavel Březina * per specific domain rules, such as case sensitivity, fully qualified
bad19f954d1946fb601df253059afbe011bcc914Pavel Březina * format etc.
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina *
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina * @return EOK If everything went fine.
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina * @return Other errno code in case of an error.
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina */
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březinatypedef errno_t
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina(*cache_req_prepare_domain_data_fn)(struct cache_req *cr,
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina struct cache_req_data *data,
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina struct sss_domain_info *domain);
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina/**
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina * Create an object debug name that is used in debug messages to identify
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina * this object.
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina *
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina * @return Debug name or NULL in case of an error.
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina **/
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březinatypedef const char *
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina(*cache_req_create_debug_name_fn)(TALLOC_CTX *mem_ctx,
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina struct cache_req_data *data,
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina struct sss_domain_info *domain);
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina/**
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina * Check if an object is stored in negative cache.
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina *
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina * @return EOK If the object is not found.
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina * @return EEXIST If the object is found in negative cache.
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina * @return Other errno code in case of an error.
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina */
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březinatypedef errno_t
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina(*cache_req_ncache_check_fn)(struct sss_nc_ctx *ncache,
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina struct sss_domain_info *domain,
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina struct cache_req_data *data);
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina/**
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina * Add an object into negative cache.
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina *
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina * @return EOK If everything went fine.
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina * @return Other errno code in case of an error.
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina */
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březinatypedef errno_t
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina(*cache_req_ncache_add_fn)(struct sss_nc_ctx *ncache,
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina struct sss_domain_info *domain,
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina struct cache_req_data *data);
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina
f24ee5cca4cd43e7edf26fec453fbd99392bbe4bFabiano Fidêncio/**
f24ee5cca4cd43e7edf26fec453fbd99392bbe4bFabiano Fidêncio * Filter the result through the negative cache.
f24ee5cca4cd43e7edf26fec453fbd99392bbe4bFabiano Fidêncio *
f24ee5cca4cd43e7edf26fec453fbd99392bbe4bFabiano Fidêncio * This is useful for plugins which don't use name as an input
f24ee5cca4cd43e7edf26fec453fbd99392bbe4bFabiano Fidêncio * token but can be affected by filter_users and filter_groups
f24ee5cca4cd43e7edf26fec453fbd99392bbe4bFabiano Fidêncio * options.
f24ee5cca4cd43e7edf26fec453fbd99392bbe4bFabiano Fidêncio */
f24ee5cca4cd43e7edf26fec453fbd99392bbe4bFabiano Fidênciotypedef errno_t
f24ee5cca4cd43e7edf26fec453fbd99392bbe4bFabiano Fidêncio(*cache_req_ncache_filter_fn)(struct sss_nc_ctx *ncache,
f24ee5cca4cd43e7edf26fec453fbd99392bbe4bFabiano Fidêncio struct sss_domain_info *domain,
f24ee5cca4cd43e7edf26fec453fbd99392bbe4bFabiano Fidêncio const char *name);
f24ee5cca4cd43e7edf26fec453fbd99392bbe4bFabiano Fidêncio
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina/**
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina * Add an object into global negative cache.
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina *
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina * @return EOK If everything went fine.
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina * @return Other errno code in case of an error.
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina */
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březinatypedef errno_t
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina(*cache_req_global_ncache_add_fn)(struct sss_nc_ctx *ncache,
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina struct cache_req_data *data);
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina/**
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina * Lookup object in sysdb.
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina *
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina * @return EOK If the object is found.
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina * @return ENOENT If the object is not found.
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina * @return Other errno code in case of an error.
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina */
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březinatypedef errno_t
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina(*cache_req_lookup_fn)(TALLOC_CTX *mem_ctx,
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina struct cache_req *cr,
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina struct cache_req_data *data,
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina struct sss_domain_info *domain,
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina struct ldb_result **_result);
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina/**
4df7aec645f87342f3a5146062abcb15f71f4fd9Pavel Březina * Send Data Provider request.
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina *
4df7aec645f87342f3a5146062abcb15f71f4fd9Pavel Březina * @return Tevent request on success.
4df7aec645f87342f3a5146062abcb15f71f4fd9Pavel Březina * @return NULL on error.
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina */
4df7aec645f87342f3a5146062abcb15f71f4fd9Pavel Březinatypedef struct tevent_req *
4df7aec645f87342f3a5146062abcb15f71f4fd9Pavel Březina(*cache_req_dp_send_fn)(TALLOC_CTX *mem_ctx,
4df7aec645f87342f3a5146062abcb15f71f4fd9Pavel Březina struct cache_req *cr,
4df7aec645f87342f3a5146062abcb15f71f4fd9Pavel Březina struct cache_req_data *data,
4df7aec645f87342f3a5146062abcb15f71f4fd9Pavel Březina struct sss_domain_info *domain,
4df7aec645f87342f3a5146062abcb15f71f4fd9Pavel Březina struct ldb_result *result);
4df7aec645f87342f3a5146062abcb15f71f4fd9Pavel Březina
4df7aec645f87342f3a5146062abcb15f71f4fd9Pavel Březina/**
4df7aec645f87342f3a5146062abcb15f71f4fd9Pavel Březina * Process result of Data Provider request.
4df7aec645f87342f3a5146062abcb15f71f4fd9Pavel Březina *
4df7aec645f87342f3a5146062abcb15f71f4fd9Pavel Březina * Do not free subreq! It will be freed in the caller.
4df7aec645f87342f3a5146062abcb15f71f4fd9Pavel Březina *
4df7aec645f87342f3a5146062abcb15f71f4fd9Pavel Březina * @return True if data provider request succeeded.
4df7aec645f87342f3a5146062abcb15f71f4fd9Pavel Březina * @return False if there was an error.
4df7aec645f87342f3a5146062abcb15f71f4fd9Pavel Březina */
4df7aec645f87342f3a5146062abcb15f71f4fd9Pavel Březinatypedef bool
4df7aec645f87342f3a5146062abcb15f71f4fd9Pavel Březina(*cache_req_dp_recv_fn)(struct tevent_req *subreq,
4df7aec645f87342f3a5146062abcb15f71f4fd9Pavel Březina struct cache_req *cr);
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek/**
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek * Check whether the results of the domain locator can still
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek * be considered valid or whether it is time to call the request
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek * again.
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek *
677a31351c80453d9ce006481364399a96312052René Genz * @param resp_ctx The responder context.
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek * @param domain The domain to check. This should be the domain-head,
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek * because the locator works across a domain and its
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek * subdomains.
677a31351c80453d9ce006481364399a96312052René Genz * @param data The cache request data that contains primarily the key
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek * to look for.
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek *
677a31351c80453d9ce006481364399a96312052René Genz * @return True if the locator plugin should be ran again.
677a31351c80453d9ce006481364399a96312052René Genz * @return False if the lookup should just proceed with the
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek * data that is already in the negative cache.
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek */
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozektypedef bool
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek(*cache_req_dp_get_domain_check_fn)(struct resp_ctx *rctx,
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek struct sss_domain_info *domain,
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek struct cache_req_data *data);
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek/**
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek * Send Data Provider request to locate the domain
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek * of an entry
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek *
677a31351c80453d9ce006481364399a96312052René Genz * @param resp_ctx The responder context.
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek * @param domain The domain to check. This should be the domain-head,
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek * because the locator works across a domain and its
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek * subdomains.
677a31351c80453d9ce006481364399a96312052René Genz * @param data The cache request data that contains primarily the key
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek * to look for.
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek *
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek *
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek * @return Tevent request on success.
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek * @return NULL on error.
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek */
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozektypedef struct tevent_req *
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek(*cache_req_dp_get_domain_send_fn)(TALLOC_CTX *mem_ctx,
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek struct resp_ctx *rctx,
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek struct sss_domain_info *domain,
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek struct cache_req_data *data);
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek/**
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek * Process result of Data Provider find-domain request.
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek *
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek * Do not free subreq! It will be freed in the caller.
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek *
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek * @param mem_ctx The memory context that owns the _found_domain
677a31351c80453d9ce006481364399a96312052René Genz * result parameter.
677a31351c80453d9ce006481364399a96312052René Genz * @param subreq The request to finish.
677a31351c80453d9ce006481364399a96312052René Genz * @param cr The cache_req being processed.
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek * @param _found_domain The domain the request account belongs to. This
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek * parameter can be NULL even on success, in that
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek * case the account was not found and no lookups are
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek * needed, all domains can be skipped in this case.
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek *
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek * @return EOK if the request did not encounter any error. In this
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek * case, the _found_domain parameter can be considered authoritative,
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek * regarless of its value
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek * @return errno on error. _found_domain should be NULL in this case.
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek */
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozektypedef errno_t
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek(*cache_req_dp_get_domain_recv_fn)(TALLOC_CTX *mem_ctx,
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek struct tevent_req *subreq,
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek struct cache_req *cr,
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek char **_found_domain);
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březinastruct cache_req_plugin {
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina /**
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina * Plugin name.
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina */
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina const char *name;
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina /**
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina * Expiration timestamp attribute name.
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina */
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina const char *attr_expiration;
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina /**
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina * Flags that are passed to get_next_domain().
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina */
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina uint32_t get_next_domain_flags;
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina /**
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina * True if input name should be parsed for domain.
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina */
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina bool parse_name;
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina
ddfd1900b26c66a062457d4fcc1a48bafd3eadf6Pavel Březina /**
ddfd1900b26c66a062457d4fcc1a48bafd3eadf6Pavel Březina * True if default domain suffix should be ignored when parsing name.
ddfd1900b26c66a062457d4fcc1a48bafd3eadf6Pavel Březina */
ddfd1900b26c66a062457d4fcc1a48bafd3eadf6Pavel Březina bool ignore_default_domain;
ddfd1900b26c66a062457d4fcc1a48bafd3eadf6Pavel Březina
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina /**
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina * True if we always contact data provider.
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina */
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina bool bypass_cache;
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina /**
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina * True if only one result is expected.
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina */
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina bool only_one_result;
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina
3df5c41c19ef852021819954a2db1d067844d136Pavel Březina /**
3df5c41c19ef852021819954a2db1d067844d136Pavel Březina * If true, cache request will iterate over all domains on domain-less
3df5c41c19ef852021819954a2db1d067844d136Pavel Březina * search and merge acquired results.
3df5c41c19ef852021819954a2db1d067844d136Pavel Březina */
3df5c41c19ef852021819954a2db1d067844d136Pavel Březina bool search_all_domains;
3df5c41c19ef852021819954a2db1d067844d136Pavel Březina
9c98397b6431b6b02bdfdb0540bac6a3eb00b0e3Pavel Březina /**
9c98397b6431b6b02bdfdb0540bac6a3eb00b0e3Pavel Březina * True if only domains with enumeration enabled are searched.
9c98397b6431b6b02bdfdb0540bac6a3eb00b0e3Pavel Březina */
9c98397b6431b6b02bdfdb0540bac6a3eb00b0e3Pavel Březina bool require_enumeration;
9c98397b6431b6b02bdfdb0540bac6a3eb00b0e3Pavel Březina
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina /**
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina * Allow missing domain part even if domain requires fully qualified name
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina * on domain less searches.
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina */
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina bool allow_missing_fqn;
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina /**
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina * True if this plugin can be swapped for equivalent search with UPN.
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina */
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina bool allow_switch_to_upn;
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina enum cache_req_type upn_equivalent;
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina /* Operations */
7be55c7de03da57f43fae3db7e6114eebb117a2ePavel Březina cache_req_is_well_known_result_fn is_well_known_fn;
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina cache_req_prepare_domain_data_fn prepare_domain_data_fn;
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina cache_req_create_debug_name_fn create_debug_name_fn;
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina cache_req_global_ncache_add_fn global_ncache_add_fn;
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina cache_req_ncache_check_fn ncache_check_fn;
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina cache_req_ncache_add_fn ncache_add_fn;
f24ee5cca4cd43e7edf26fec453fbd99392bbe4bFabiano Fidêncio cache_req_ncache_filter_fn ncache_filter_fn;
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina cache_req_lookup_fn lookup_fn;
4df7aec645f87342f3a5146062abcb15f71f4fd9Pavel Březina cache_req_dp_send_fn dp_send_fn;
4df7aec645f87342f3a5146062abcb15f71f4fd9Pavel Březina cache_req_dp_recv_fn dp_recv_fn;
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek cache_req_dp_get_domain_check_fn dp_get_domain_check_fn;
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek cache_req_dp_get_domain_send_fn dp_get_domain_send_fn;
2856dac5818265a6b4e42d768b73c65e333d14ffJakub Hrozek cache_req_dp_get_domain_recv_fn dp_get_domain_recv_fn;
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina};
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina
8f895983e8d24b3edde4f695621f6b9a2fd20923Pavel Březinaextern const struct cache_req_plugin cache_req_user_by_name;
8f895983e8d24b3edde4f695621f6b9a2fd20923Pavel Březinaextern const struct cache_req_plugin cache_req_user_by_upn;
8f895983e8d24b3edde4f695621f6b9a2fd20923Pavel Březinaextern const struct cache_req_plugin cache_req_user_by_id;
8f895983e8d24b3edde4f695621f6b9a2fd20923Pavel Březinaextern const struct cache_req_plugin cache_req_group_by_name;
8f895983e8d24b3edde4f695621f6b9a2fd20923Pavel Březinaextern const struct cache_req_plugin cache_req_group_by_id;
8f895983e8d24b3edde4f695621f6b9a2fd20923Pavel Březinaextern const struct cache_req_plugin cache_req_initgroups_by_name;
8f895983e8d24b3edde4f695621f6b9a2fd20923Pavel Březinaextern const struct cache_req_plugin cache_req_initgroups_by_upn;
8f895983e8d24b3edde4f695621f6b9a2fd20923Pavel Březinaextern const struct cache_req_plugin cache_req_user_by_cert;
8f895983e8d24b3edde4f695621f6b9a2fd20923Pavel Březinaextern const struct cache_req_plugin cache_req_user_by_filter;
8f895983e8d24b3edde4f695621f6b9a2fd20923Pavel Březinaextern const struct cache_req_plugin cache_req_group_by_filter;
8f895983e8d24b3edde4f695621f6b9a2fd20923Pavel Březinaextern const struct cache_req_plugin cache_req_object_by_sid;
8f895983e8d24b3edde4f695621f6b9a2fd20923Pavel Březinaextern const struct cache_req_plugin cache_req_object_by_name;
8f895983e8d24b3edde4f695621f6b9a2fd20923Pavel Březinaextern const struct cache_req_plugin cache_req_object_by_id;
8f895983e8d24b3edde4f695621f6b9a2fd20923Pavel Březinaextern const struct cache_req_plugin cache_req_enum_users;
8f895983e8d24b3edde4f695621f6b9a2fd20923Pavel Březinaextern const struct cache_req_plugin cache_req_enum_groups;
8f895983e8d24b3edde4f695621f6b9a2fd20923Pavel Březinaextern const struct cache_req_plugin cache_req_enum_svc;
8f895983e8d24b3edde4f695621f6b9a2fd20923Pavel Březinaextern const struct cache_req_plugin cache_req_svc_by_name;
8f895983e8d24b3edde4f695621f6b9a2fd20923Pavel Březinaextern const struct cache_req_plugin cache_req_svc_by_port;
8f895983e8d24b3edde4f695621f6b9a2fd20923Pavel Březinaextern const struct cache_req_plugin cache_req_netgroup_by_name;
53c31b83e4d06ea4c2813eec2f1e647a613b4a2bPavel Březinaextern const struct cache_req_plugin cache_req_host_by_name;
0db2f3402b37df221fbf55486769989f82df479aPavel Březina
2749964664a69bbb99d09409c1110095cbfcc664Pavel Březina#endif /* _CACHE_REQ_PLUGIN_H_ */