/*
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 _NSS_PRIVATE_H_
#define _NSS_PRIVATE_H_
#include <talloc.h>
#include <tevent.h>
#include <dhash.h>
#include <ldb.h>
#include "responder/common/responder.h"
#include "responder/common/cache_req/cache_req.h"
#include "responder/nss/nsssrv_mmap_cache.h"
#include "lib/idmap/sss_idmap.h"
struct nss_enum_index {
unsigned int domain;
unsigned int result;
};
struct nss_enum_ctx {
/* Ongoing cache request that is constructing enumeration result. */
/* If true, the object is already constructed. */
bool is_ready;
/* List of setent requests awaiting the result. We finish
* them when the ongoing cache request is completed. */
};
struct nss_state_ctx {
const char *netgroup;
};
struct nss_ctx {
/* Options. */
int enum_cache_timeout;
bool filter_users_in_groups;
char *pwfield;
char *override_homedir;
char *fallback_homedir;
char *homedir_substr;
const char **extra_attributes;
/* Enumeration. */
/* Memory cache. */
};
struct sss_cmd_table *get_nss_cmds(void);
struct sss_domain_info *domain,
const char *name,
enum sss_mc_type type);
struct tevent_req *
struct tevent_context *ev,
struct cache_req_data *data,
enum sss_mc_type memcache,
const char *input_name,
struct tevent_req *req,
struct cache_req_result **_result,
const char **_rawname);
struct tevent_req *
struct tevent_context *ev,
enum cache_req_type type,
struct nss_enum_ctx *enum_ctx);
struct tevent_req *
struct tevent_context *ev,
enum cache_req_type type,
const char *netgroup);
/* Utils. */
const char *
struct ldb_message *msg);
const char *
struct sss_domain_info *dom);
#endif /* _NSS_PRIVATE_H_ */