1c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner/* $NetBSD: nsswitch.h,v 1.18 2005/11/29 03:12:58 christos Exp $ */ 2c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner 3c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner/*- 4c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * Copyright (c) 1997, 1998, 1999, 2004 The NetBSD Foundation, Inc. 5c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * All rights reserved. 6c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * 7c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * This code is derived from software contributed to The NetBSD Foundation 8c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * by Luke Mewburn. 9c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * 10c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * Redistribution and use in source and binary forms, with or without 11c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * modification, are permitted provided that the following conditions 12c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * are met: 13c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * 1. Redistributions of source code must retain the above copyright 14c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * notice, this list of conditions and the following disclaimer. 15c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * 2. Redistributions in binary form must reproduce the above copyright 16c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * notice, this list of conditions and the following disclaimer in the 17c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * documentation and/or other materials provided with the distribution. 18c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * 3. All advertising materials mentioning features or use of this software 19c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * must display the following acknowledgement: 20c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * This product includes software developed by the NetBSD 21c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * Foundation, Inc. and its contributors. 22c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * 4. Neither the name of The NetBSD Foundation nor the names of its 23c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * contributors may be used to endorse or promote products derived 24c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * from this software without specific prior written permission. 25c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * 26c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS 27c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED 28c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 29c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS 30c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR 31c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF 32c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 33c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN 34c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) 35c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 36c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * POSSIBILITY OF SUCH DAMAGE. 37c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner */ 38c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner 39c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#ifndef _NSSWITCH_H 40c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define _NSSWITCH_H 1 41c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner 42c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#include <sys/types.h> 43c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#include <stdarg.h> 44c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner 45c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define NSS_MODULE_INTERFACE_VERSION 0 46c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner 47c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#ifndef _PATH_NS_CONF 48c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define _PATH_NS_CONF "/etc/nsswitch.conf" 49c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#endif 50c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner 51c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define NS_CONTINUE 0 52c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define NS_RETURN 1 53c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner 54c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner/* 55c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * Layout of: 56c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * uint32_t ns_src.flags 577c2ba504e9c10e67f27e7b0aff90981c469d2701David 'Digit' Turner */ 58c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner /* nsswitch.conf status codes and nsdispatch(3) return values */ 59c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define NS_SUCCESS (1<<0) /* entry was found */ 60c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define NS_UNAVAIL (1<<1) /* source not responding, or corrupt */ 61c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define NS_NOTFOUND (1<<2) /* source responded 'no such entry' */ 62c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define NS_TRYAGAIN (1<<3) /* source busy, may respond to retrys */ 63c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define NS_STATUSMASK 0x000000ff /* bitmask to get the status flags */ 64c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner 65c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner /* internal nsdispatch(3) flags; not settable in nsswitch.conf(5) */ 66c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define NS_FORCEALL (1<<8) /* force all methods to be invoked; */ 67c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner 68c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner/* 69c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * Currently implemented sources. 70c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner */ 71c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define NSSRC_FILES "files" /* local files */ 72c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define NSSRC_DNS "dns" /* DNS; IN for hosts, HS for others */ 73c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define NSSRC_NIS "nis" /* YP/NIS */ 74c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define NSSRC_COMPAT "compat" /* passwd,group in YP compat mode */ 75c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner 76c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner/* 77c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * Currently implemented databases. 78c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner */ 79c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define NSDB_HOSTS "hosts" 80c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define NSDB_GROUP "group" 81c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define NSDB_GROUP_COMPAT "group_compat" 82c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define NSDB_NETGROUP "netgroup" 83c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define NSDB_NETWORKS "networks" 84c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define NSDB_PASSWD "passwd" 85c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define NSDB_PASSWD_COMPAT "passwd_compat" 86c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define NSDB_SHELLS "shells" 87c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner 88c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner/* 89c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * Suggested databases to implement. 90c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner */ 91c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define NSDB_ALIASES "aliases" 92c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define NSDB_AUTH "auth" 93c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define NSDB_AUTOMOUNT "automount" 94c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define NSDB_BOOTPARAMS "bootparams" 95c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define NSDB_ETHERS "ethers" 96c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define NSDB_EXPORTS "exports" 97c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define NSDB_NETMASKS "netmasks" 98c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define NSDB_PHONES "phones" 99c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define NSDB_PRINTCAP "printcap" 100c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define NSDB_PROTOCOLS "protocols" 101c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define NSDB_REMOTE "remote" 102c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define NSDB_RPC "rpc" 103c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define NSDB_SENDMAILVARS "sendmailvars" 104c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define NSDB_SERVICES "services" 105c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define NSDB_TERMCAP "termcap" 106c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define NSDB_TTYS "ttys" 107c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner 108c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner/* 109c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * ns_dtab `callback' function signature. 110c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner */ 111c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turnertypedef int (*nss_method)(void *, void *, va_list); 112c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner 113c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner/* 114c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * ns_dtab - `nsswitch dispatch table' 115c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * Contains an entry for each source and the appropriate function to call. 116c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner */ 117c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turnertypedef struct { 118c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner const char *src; 119c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner nss_method callback; 120c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner void *cb_data; 121c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner} ns_dtab; 122c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner 123c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner/* 124c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * Macros to help build an ns_dtab[] 125c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner */ 126c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define NS_FILES_CB(F,C) { NSSRC_FILES, F, __UNCONST(C) }, 127c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#define NS_COMPAT_CB(F,C) { NSSRC_COMPAT, F, __UNCONST(C) }, 1287c2ba504e9c10e67f27e7b0aff90981c469d2701David 'Digit' Turner 129c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#ifdef HESIOD 130c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner# define NS_DNS_CB(F,C) { NSSRC_DNS, F, __UNCONST(C) }, 131c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#else 132c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner# define NS_DNS_CB(F,C) 133c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#endif 134c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner 135c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#ifdef YP 136c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner# define NS_NIS_CB(F,C) { NSSRC_NIS, F, __UNCONST(C) }, 137c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#else 138c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner# define NS_NIS_CB(F,C) 139c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#endif 140c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner 141c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner/* 142c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * ns_src - `nsswitch source' 143c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * Used by the nsparser routines to store a mapping between a source 144c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * and its dispatch control flags for a given database. 145c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner */ 146c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turnertypedef struct { 147c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner const char *name; 148c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner uint32_t flags; 149c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner} ns_src; 150c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner 151c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner 152c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner/* 153c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * Default sourcelists (if nsswitch.conf is missing, corrupt, 154c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * or the requested database doesn't have an entry) 155c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner */ 1567c2ba504e9c10e67f27e7b0aff90981c469d2701David 'Digit' Turner#if 0 /* MISSING FROM BIONIC */ 157c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turnerextern const ns_src __nsdefaultsrc[]; 158c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turnerextern const ns_src __nsdefaultcompat[]; 159c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turnerextern const ns_src __nsdefaultcompat_forceall[]; 160c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turnerextern const ns_src __nsdefaultfiles[]; 161c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turnerextern const ns_src __nsdefaultfiles_forceall[]; 162c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turnerextern const ns_src __nsdefaultnis[]; 163c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turnerextern const ns_src __nsdefaultnis_forceall[]; 1647c2ba504e9c10e67f27e7b0aff90981c469d2701David 'Digit' Turner#endif /* MISSING */ 165c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner 166c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner/* 167c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * ns_mtab - `nsswitch method table' 168c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * An nsswitch module provides a mapping from (database name, method name) 169c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * tuples to the nss_method and associated callback data. Effectively, 170c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * ns_dtab, but used for dynamically loaded modules. 171c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner */ 172c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turnertypedef struct { 173c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner const char *database; 174c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner const char *name; 175c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner nss_method method; 176c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner void *mdata; 177c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner} ns_mtab; 178c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner 179c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner/* 180c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * nss_module_register_fn - module registration function 181c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * called at module load 182c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * nss_module_unregister_fn - module un-registration function 183c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * called at module unload 184c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner */ 185c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turnertypedef void (*nss_module_unregister_fn)(ns_mtab *, u_int); 186c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turnertypedef ns_mtab *(*nss_module_register_fn)(const char *, u_int *, 187c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner nss_module_unregister_fn *); 188c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner 189c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#ifdef _NS_PRIVATE 190c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner 191c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner/* 192c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * Private data structures for back-end nsswitch implementation. 193c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner */ 194c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner 195c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner/* 196c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * ns_dbt - `nsswitch database thang' 197c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * For each database in /etc/nsswitch.conf there is a ns_dbt, with its 198c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * name and a list of ns_src's containing the source information. 199c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner */ 200c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turnertypedef struct { 201c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner const char *name; /* name of database */ 202c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner ns_src *srclist; /* list of sources */ 203c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner u_int srclistsize; /* size of srclist */ 204c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner} ns_dbt; 205c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner 206c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner/* 207c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner * ns_mod - `nsswitch module' 208c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner */ 209c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turnertypedef struct { 210c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner const char *name; /* module name */ 211c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner void *handle; /* handle from dlopen() */ 212c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner ns_mtab *mtab; /* method table */ 213c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner u_int mtabsize; /* size of mtab */ 214c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner /* called to unload module */ 215c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner nss_module_unregister_fn unregister; 216c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner} ns_mod; 217c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner 218c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#endif /* _NS_PRIVATE */ 219c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner 220c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner 221c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#include <sys/cdefs.h> 222c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner 223c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner__BEGIN_DECLS 224c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turnerint nsdispatch(void *, const ns_dtab [], const char *, 225c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner const char *, const ns_src [], ...); 226c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner 227c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#ifdef _NS_PRIVATE 228c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turnerint _nsdbtaddsrc(ns_dbt *, const ns_src *); 229c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turnervoid _nsdbtdump(const ns_dbt *); 230c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turnerint _nsdbtput(const ns_dbt *); 231c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turnervoid _nsyyerror(const char *); 232c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turnerint _nsyylex(void); 233c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#endif /* _NS_PRIVATE */ 234c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner 235c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner__END_DECLS 236c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner 237c817c5210e4207908b83faaf08a2c5b95251f871David 'Digit' Turner#endif /* !_NSSWITCH_H */ 238