4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License (the "License").
6 * You may not use this file except in compliance with the License.
8 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
9 * or http://www.opensolaris.org/os/licensing.
10 * See the License for the specific language governing permissions
11 * and limitations under the License.
13 * When distributing Covered Code, include this CDDL HEADER in each
14 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
15 * If applicable, add the following below this CDDL HEADER, with the
16 * fields enclosed by brackets "[]" replaced with your own identifying
17 * information: Portions Copyright [yyyy] [name of copyright owner]
22 * Copyright (c) 2008, 2010, Oracle and/or its affiliates. All rights reserved.
23 * Copyright 2014 Nexenta Systems, Inc. All rights reserved.
26 #ifndef _ADDISC_IMPL_H
27 #define _ADDISC_IMPL_H
31 #include <sys/types.h>
36 #include "libadutils.h"
43 AD_STATE_INVALID
= 0, /* The value is not valid */
44 AD_STATE_FIXED
, /* The value was fixed by caller */
45 AD_STATE_AUTO
/* The value is auto discovered */
57 typedef struct ad_subnet
{
62 typedef struct ad_item
{
63 enum ad_item_state state
;
64 enum ad_data_type type
;
67 unsigned int version
; /* Version is only changed */
68 /* if the value changes */
72 /* These holds the version of */
73 /* dependents so that a dependent */
74 /* change can be detected */
77 typedef struct ad_disc
{
78 struct __res_state res_state
;
81 boolean_t subnets_changed
;
82 time_t subnets_last_check
;
83 time_t expires_not_before
;
84 time_t expires_not_after
;
85 ad_item_t domain_name
; /* DNS hostname string */
86 ad_item_t domain_guid
; /* Domain UUID (binary) */
87 ad_item_t domain_controller
; /* Directory hostname and */
89 ad_item_t preferred_dc
;
90 ad_item_t site_name
; /* String */
91 ad_item_t forest_name
; /* DNS forestname string */
92 ad_item_t global_catalog
; /* Directory hostname and */
94 ad_item_t domains_in_forest
; /* DNS domainname and SID */
96 ad_item_t trusted_domains
; /* DNS domainname and trust */
98 /* Site specfic versions */
99 ad_item_t site_domain_controller
; /* Directory hostname and */
101 ad_item_t site_global_catalog
; /* Directory hostname and */
103 /* Optional FILE * for DC Location status. */
104 struct __FILE_TAG
*status_fp
;
106 int debug
[AD_DEBUG_MAX
+1]; /* Debug levels */
109 /* Candidate Directory Servers (CDS) */
110 typedef struct ad_disc_cds
{
111 struct ad_disc_ds cds_ds
;
112 struct addrinfo
*cds_ai
;
115 ad_disc_ds_t
*ldap_ping(ad_disc_t
, ad_disc_cds_t
*, char *, int);
117 int srv_getdom(res_state
, const char *, char **);
118 ad_disc_cds_t
*srv_query(res_state
, const char *, const char *,
120 void srv_free(ad_disc_cds_t
*);
122 void auto_set_DomainGUID(ad_disc_t
, uchar_t
*);
123 void auto_set_ForestName(ad_disc_t
, char *);
124 void auto_set_SiteName(ad_disc_t
, char *);
130 #endif /* _ADDISC_IMPL_H */