2N/A/*
2N/A * CDDL HEADER START
2N/A *
2N/A * The contents of this file are subject to the terms of the
2N/A * Common Development and Distribution License (the "License").
2N/A * You may not use this file except in compliance with the License.
2N/A *
2N/A * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
2N/A * or http://www.opensolaris.org/os/licensing.
2N/A * See the License for the specific language governing permissions
2N/A * and limitations under the License.
2N/A *
2N/A * When distributing Covered Code, include this CDDL HEADER in each
2N/A * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
2N/A * If applicable, add the following below this CDDL HEADER, with the
2N/A * fields enclosed by brackets "[]" replaced with your own identifying
2N/A * information: Portions Copyright [yyyy] [name of copyright owner]
2N/A *
2N/A * CDDL HEADER END
2N/A */
2N/A
2N/A/*
2N/A * Copyright 2008 Sun Microsystems, Inc. All rights reserved.
2N/A * Use is subject to license terms.
2N/A */
2N/A
2N/A/*
2N/A * Common code and structures used by name-service-switch "dns" backends.
2N/A */
2N/A
2N/A#ifndef _DNS_COMMON_H
2N/A#define _DNS_COMMON_H
2N/A
2N/A#pragma ident "%Z%%M% %I% %E% SMI"
2N/A
2N/A#include <stdio.h>
2N/A#include <ctype.h>
2N/A#include <sys/types.h>
2N/A#include <sys/socket.h>
2N/A#include <netinet/in.h>
2N/A#include <netdb.h>
2N/A#include <strings.h>
2N/A#include <thread.h>
2N/A#include <arpa/inet.h>
2N/A#include <arpa/nameser.h>
2N/A#include <resolv.h>
2N/A#include <syslog.h>
2N/A#include <nsswitch.h>
2N/A#include <nss_common.h>
2N/A#include <nss_dbdefs.h>
2N/A#include <stdlib.h>
2N/A#include <signal.h>
2N/A
2N/A#ifdef __cplusplus
2N/Aextern "C" {
2N/A#endif
2N/A
2N/Atypedef struct dns_backend *dns_backend_ptr_t;
2N/Atypedef nss_status_t (*dns_backend_op_t)(dns_backend_ptr_t, void *);
2N/A
2N/Astruct dns_backend {
2N/A dns_backend_op_t *ops;
2N/A nss_dbop_t n_ops;
2N/A};
2N/A
2N/A/* multithreaded libresolv2 related functions and variables */
2N/Aextern void (*set_no_hosts_fallback)(void);
2N/Aextern void (*unset_no_hosts_fallback)(void);
2N/Aextern struct __res_state *(*set_res_retry)();
2N/Aextern int (*enable_mt)();
2N/Aextern int (*disable_mt)();
2N/Aextern int *(*get_h_errno)();
2N/Aextern int (*override_retry)(int);
2N/Aextern void switch_resolver_setup(int *, sigset_t *, int *);
2N/Aextern void switch_resolver_reset(int, sigset_t, int);
2N/Aextern mutex_t one_lane;
2N/A
2N/Aextern int ent2result(struct hostent *, nss_XbyY_args_t *, int);
2N/Aextern int ent2str(struct hostent *, nss_XbyY_args_t *, int);
2N/A
2N/Anss_backend_t *_nss_dns_constr(dns_backend_op_t *, int);
2N/Aextern nss_status_t _herrno2nss(int);
2N/A
2N/Anss_status_t _nss_dns_gethost_withttl(void *buf, size_t bufsize, int ipnode);
2N/Anss_status_t _nss_get_dns_hosts_name(dns_backend_ptr_t *, void **, size_t *);
2N/Anss_status_t _nss_get_dns_ipnodes_name(dns_backend_ptr_t *, void **, size_t *);
2N/A
2N/A#ifdef __cplusplus
2N/A}
2N/A#endif
2N/A
2N/A#endif /* _DNS_COMMON_H */