adutils_impl.h revision bd42852645f5ef79a1729096abd7405b72e159f7
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#ifndef _ADUTILS_IMPL_H
#define _ADUTILS_IMPL_H
#include <stdlib.h>
#include <stdio.h>
#include <ldap.h>
#include <pthread.h>
#include "addisc.h"
#include <rpcsvc/idmap_prot.h>
#include "libadutils.h"
#ifdef __cplusplus
extern "C" {
#endif
#define ADUTILS_SEARCH_TIMEOUT 3
#define ADUTILS_LDAP_OPEN_TIMEOUT 1
typedef struct adutils_sid {
struct adutils_host;
struct known_domain {
char name[MAXDOMAINNAME];
};
/* A set of DSs for a given AD partition */
struct adutils_ad {
int num_known_domains;
struct known_domain *known_domains;
struct adutils_host *last_adh;
/* If this is a reference to DC, this is the base DN for that DC */
char *basedn;
};
typedef struct adutils_attr {
char *attr_name;
char **attr_values;
/* typedef in libadutils.h */
struct adutils_entry {
struct adutils_entry *next;
};
/* typedef in libadutils.h */
struct adutils_result {
};
/* A single DS */
typedef struct adutils_host {
struct adutils_host *next;
int dead; /* error on LDAP connection */
/*
* Used to distinguish between different instances of LDAP
* connections to this same DS. We need this so we never mix up
* results for a given msgID from one connection with those of
* another earlier connection where two batch state structures
* share this adutils_host object but used different LDAP connections
* to send their LDAP searches.
*/
/* LDAP DS info */
char *host;
int port;
/* hardwired to SASL GSSAPI only for now */
char *saslmech;
unsigned saslflags;
/* Number of outstanding search requests */
/* A place to put the results of a batched (async) query */
typedef struct adutils_q {
const char *edomain; /* expected domain name */
adutils_rc *rc;
int msgid; /* LDAP message ID */
} adutils_q_t;
/* Batch context structure */
struct adutils_query_state {
struct adutils_query_state *next;
int qsize; /* Size of queries */
int ref_cnt; /* reference count */
void *ldap_res_search_argp;
};
/* Private routines */
/* Global logger function */
extern adutils_logger logger;
#ifdef __cplusplus
}
#endif
#endif /* _ADUTILS_IMPL_H */