/*
* 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
*/
/*
*/
#ifndef _MAPID_H
#define _MAPID_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <string.h>
#include <strings.h>
#include <resolv.h>
#include <netdb.h>
#include <errno.h>
#include <ctype.h>
#include <assert.h>
#include <synch.h>
#include <syslog.h>
#include <locale.h>
#include <thread.h>
#include <deflt.h>
typedef struct {
void *(*fcn)(void *);
int signal;
} cb_t;
#ifdef __LIBMAPID_IMPL
/*
* Error Messages
*/
"...\tRetrying"
"to queries for domain \"%s\""
"Defaulting to \"%s\""
"Defaulting to \"%s\""
/*
* DNS related info
*/
typedef union {
} ans_t;
/*
* NOTE: All s_ prefixed variables are only to be used by the DNS
* feature implementation (mapid.c). The exported globals
* (ie. seen by nfsmapid.c/nfsmapid_server.c) are the
* dns_ prefixed variables along with sysdns_domain.
*/
static int s_anslen;
int lib_init_done = 0;
static int resolv_init(void);
static void resolv_decode(void);
static int resolv_error(void);
static void resolv_get_txt_data(void);
static void resolv_txt_reset(void);
static void resolve_process_txt(uchar_t *, int);
static int resolv_search(void);
static void resolv_destroy(void);
static void domain_sync(cb_t *, char *);
static int get_mtime(const char *, timestruc_t *);
static void get_nfs_domain(void);
static void get_dns_domain(void);
static void get_dns_txt_domain(cb_t *);
void _lib_init(void);
#ifdef DEBUG
#endif /* DEBUG */
/*
* to the library's mapid_domain global var.
*
* mapid_domain: Library variable used to store the current
* outbound and inbound attr strings, accordingly.
*
* nfs_domain: If nfsmapid_domain var in SMF
* has been set, nfs_domain will hold this
* value for the duration of the instance;
* If the value ever changes, the change is
* detected via the use of nfs_mtime and
* nfs_domain is updated accordingly.
*
* dns_domain: If the system's resolver (/etc/resolv.conf)
* has been configured, dns_domain will hold
* the configured DNS domain as reported by the
* res_ninit() resolver interface. If the system's
* /etc/resolv.conf file is updated, the change
* is detected via the use of dns_mtime and
* dns_domain is updated accordingly.
*/
int dns_txt_cached = 0;
{ \
which##_domain_len = 0; \
}
#define TIMESTRUC_EQ(a, b) \
#endif /* __LIBMAPID_IMPL */
/*
* PSARC 2005/487 Consolidation Private Interfaces
* mapid_reeval_domain(), mapid_get_domain()
* Changes must be reviewed by Solaris File Sharing
*/
extern void mapid_reeval_domain(cb_t *);
extern char *mapid_get_domain(void);
/*
* PSARC 2005/487 Contracted Sun Private Interface
* mapid_derive_domain(), mapid_stdchk_domain()
* Changes must be reviewed by Solaris File Sharing
* Changes must be communicated to contract-2005-487-01@sun.com
*/
extern int mapid_stdchk_domain(const char *);
extern char *mapid_derive_domain(void);
#ifdef __cplusplus
}
#endif
#endif /* _MAPID_H */