/*
Authors:
Pavel Březina <pbrezina@redhat.com>
Copyright (C) 2016 Red Hat
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _CACHE_REQ_H_
#define _CACHE_REQ_H_
#include "responder/common/negcache.h"
enum cache_req_type {
};
/* Whether to limit the request type to a certain domain type
*/
enum cache_req_dom_type {
/* Only look up data in POSIX domains */
/* Only look up data in application domains */
/* Look up data in any domain type */
};
/* Input data. */
struct cache_req_data;
struct cache_req_data *
enum cache_req_type type,
const char *name);
struct cache_req_data *
enum cache_req_type type,
const char *name,
const char **attrs);
struct cache_req_data *
enum cache_req_type type,
struct cache_req_data *
enum cache_req_type type,
const char **attrs);
struct cache_req_data *
enum cache_req_type type,
const char *cert);
struct cache_req_data *
enum cache_req_type type,
const char *sid,
const char **attrs);
struct cache_req_data *
enum cache_req_type type);
struct cache_req_data *
enum cache_req_type type,
const char *name,
const char *protocol,
struct cache_req_data *
enum cache_req_type type,
const char *name,
const char *alias,
const char **attrs);
void
bool bypass_cache);
void
bool bypass_dp);
/* Output data. */
struct cache_req_result {
/**
* SSSD domain where the result was obtained.
*/
/**
* Result from ldb lookup.
*/
/**
* Shortcuts into ldb_result. This shortens the code a little since
* callers usually don't don't need to work with ldb_result directly.
*/
unsigned int count;
/**
* If name was used as a lookup parameter, @lookup_name contains name
* normalized to @domain rules.
*/
const char *lookup_name;
/**
* If true the result contain attributes of a well known object.
* Since this result is manually created it may not contain all
* requested attributes, depending on the plug-in.
*/
bool well_known_object;
/* If this is a well known object, it may not be part of any particular
* SSSD domain, but still may be associated with a well known domain
* name such as "BUILTIN", or "LOCAL AUTHORITY".
*/
const char *well_known_domain;
};
/**
* Shallow copy of cache request result, limiting the result to a maximum
* numbers of records.
*/
struct cache_req_result *
struct cache_req_result *result,
/* Generic request. */
struct tevent_context *ev,
struct sss_nc_ctx *ncache,
int midpoint,
const char *domain,
struct cache_req_data *data);
struct tevent_req *req,
struct cache_req_result ***_results);
struct tevent_req *req,
struct cache_req_result **_result);
/* Plug-ins. */
struct tevent_req *
struct tevent_context *ev,
struct sss_nc_ctx *ncache,
const char *domain,
const char *name);
struct tevent_req *
struct tevent_context *ev,
struct sss_nc_ctx *ncache,
const char *domain,
const char *name,
const char **attrs);
struct tevent_req *
struct tevent_context *ev,
struct sss_nc_ctx *ncache,
const char *domain,
struct tevent_req *
struct tevent_context *ev,
struct sss_nc_ctx *ncache,
const char *domain,
const char *pem_cert);
struct tevent_req *
struct tevent_context *ev,
struct sss_nc_ctx *ncache,
const char *domain,
const char *name);
struct tevent_req *
struct tevent_context *ev,
struct sss_nc_ctx *ncache,
const char *domain,
struct tevent_req *
struct tevent_context *ev,
struct sss_nc_ctx *ncache,
const char *domain,
const char *name);
struct tevent_req *
struct tevent_context *ev,
const char *domain,
const char *filter);
struct tevent_req *
struct tevent_context *ev,
const char *domain,
const char *filter);
struct tevent_req *
struct tevent_context *ev,
struct sss_nc_ctx *ncache,
const char *domain,
const char *sid,
const char **attrs);
struct tevent_req *
struct tevent_context *ev,
struct sss_nc_ctx *ncache,
const char *domain,
const char *name,
const char **attrs);
struct tevent_req *
struct tevent_context *ev,
struct sss_nc_ctx *ncache,
const char *domain,
const char **attrs);
struct tevent_req *
struct tevent_context *ev,
struct sss_nc_ctx *ncache,
const char *domain);
struct tevent_req *
struct tevent_context *ev,
struct sss_nc_ctx *ncache,
const char *domain);
struct tevent_req *
struct tevent_context *ev,
struct sss_nc_ctx *ncache,
const char *domain,
const char *name,
const char *protocol);
struct tevent_req *
struct tevent_context *ev,
struct sss_nc_ctx *ncache,
const char *domain,
const char *protocol);
struct tevent_req *
struct tevent_context *ev,
struct sss_nc_ctx *ncache,
const char *domain,
const char *name);
struct tevent_req *
struct tevent_context *ev,
struct sss_nc_ctx *ncache,
const char *domain,
const char *name,
const char *alias,
const char **attrs);
#endif /* _CACHE_REQ_H_ */