sdap.h revision 6c8223ed11b46e44187b7f2ff201d68393b8c32e
/*
SSSD
LDAP Helper routines
Copyright (C) Simo Sorce <ssorce@redhat.com>
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 _SDAP_H_
#define _SDAP_H_
#include "providers/dp_backend.h"
#include <ldap.h>
#include "util/sss_ldap.h"
struct sdap_msg {
};
struct sdap_op;
struct sdap_msg *, int, void *);
struct sdap_handle;
struct sdap_op {
struct sdap_handle *sh;
int msgid;
bool done;
void *data;
struct tevent_context *ev;
};
struct fd_event_item {
struct fd_event_item *prev;
struct fd_event_item *next;
int fd;
};
struct ldap_cb_data {
struct sdap_handle *sh;
struct tevent_context *ev;
struct fd_event_item *fd_list;
};
struct sdap_handle {
bool connected;
struct sdap_fd_events *sdap_fd_events;
/* during release we need to lock access to the handler
* from the destructor to avoid recursion */
bool destructor_lock;
/* mark when it is safe to finally release the handler memory */
bool release_memory;
};
struct sdap_service {
char *name;
char *uri;
};
struct sdap_ppolicy_data {
int grace;
int expire;
};
#define SYSDB_SHADOWPW_LASTCHANGE "shadowLastChange"
#define SYSDB_SHADOWPW_MIN "shadowMin"
#define SYSDB_SHADOWPW_MAX "shadowMax"
#define SYSDB_SHADOWPW_WARNING "shadowWarning"
#define SYSDB_SHADOWPW_INACTIVE "shadowInactive"
#define SYSDB_SHADOWPW_EXPIRE "shadowExpire"
#define SYSDB_SHADOWPW_FLAG "shadowFlag"
#define SYSDB_KRBPW_LASTCHANGE "krbLastPwdChange"
#define SYSDB_KRBPW_EXPIRATION "krbPasswordExpiration"
#define SYSDB_PWD_ATTRIBUTE "pwdAttribute"
enum sdap_result {
};
enum sdap_basic_opt {
SDAP_URI = 0,
SDAP_OPTS_BASIC /* opts counter */
};
enum sdap_gen_attrs {
SDAP_AT_ENTRY_USN = 0,
SDAP_AT_GENERAL /* attrs counter */
};
/* the objectclass must be the first attribute.
* Functions depend on this */
enum sdap_user_attrs {
SDAP_OC_USER = 0,
SDAP_OPTS_USER /* attrs counter */
};
/* the objectclass must be the first attribute.
* Functions depend on this */
enum sdap_group_attrs {
SDAP_OC_GROUP = 0,
SDAP_OPTS_GROUP /* attrs counter */
};
struct sdap_attr_map {
const char *opt_name;
const char *def_name;
const char *sys_name;
char *name;
};
struct sdap_options {
struct sdap_attr_map *gen_map;
struct sdap_attr_map *user_map;
struct sdap_attr_map *group_map;
/* supported schema types */
enum schema_type {
} schema_type;
struct ldb_dn *users_base;
struct ldb_dn *groups_base;
};
struct confdb_ctx *cdb,
const char *conf_path,
struct sdap_attr_map *def_map,
int num_entries,
struct sdap_attr_map **_map);
const char *sasl_mech);
struct sdap_attr_map *map,
#endif /* _SDAP_H_ */