1/* 2 * Copyright (c) 2008-2010 Apple Inc. All rights reserved. 3 * 4 * @APPLE_LICENSE_HEADER_START@ 5 * 6 * This file contains Original Code and/or Modifications of Original Code 7 * as defined in and that are subject to the Apple Public Source License 8 * Version 2.0 (the 'License'). You may not use this file except in 9 * compliance with the License. Please obtain a copy of the License at 10 * http://www.opensource.apple.com/apsl/ and read it before using this 11 * file. 12 * 13 * The Original Code and all software distributed under the License are 14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER 15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, 16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, 17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. 18 * Please see the License for the specific language governing rights and 19 * limitations under the License. 20 * 21 * @APPLE_LICENSE_HEADER_END@ 22 */ 23 24#include <si_module.h> 25 26/* 27 * SPI to disable / enable modules during Libinfo search. 28 * Currently known module names are "cache", "ds", "file", and "mdns". 29 * Use flag = 0 to disable a module, flag = 1 to enable. 30 */ 31void si_search_module_set_flags(const char *name, uint32_t flag); 32 33/* 34 * Most of these async callbacks get data that's held in thread-specific 35 * memory (specific to the callback thread) that will be re-used by that 36 * thread automatically on the next call - synchronous or asynchronous - 37 * of the same routine. For example, an async getpwnam call will use a 38 * slot in the caller's thread-specifc data to save the returned struct passwd. 39 * A subsequent call to getpwnam will release the previous entry 40 * 41 * Callers of getaddrinfo must free the returned addrinfo list using freeaddrinfo. 42 * Callbacks for async getaddrinfo lookups must also free the returned addrinfo list. 43 * 44 * Callers of getnameinfo supply their own memory for the node and serv names. 45 * Callbacks for async getnameinfo lookups get node and serv names that reside in 46 * thread-specific memory that is reclaimed by the libraray. The results must not be freed. 47 */ 48typedef void (*si_user_async_callback)(struct passwd *, void *context); 49typedef void (*si_group_async_callback)(struct group *, void *context); 50typedef void (*si_grouplist_async_callback)(struct grouplist_s *, void *context); 51typedef void (*si_alias_async_callback)(struct aliasent *, void *context); 52typedef void (*si_host_async_callback)(struct hostent *, void *context); 53typedef void (*si_ipnode_async_callback)(struct hostent *, int32_t status, void *context); 54typedef void (*si_network_async_callback)(struct netent *, void *context); 55typedef void (*si_service_async_callback)(struct servent *, void *context); 56typedef void (*si_protocol_async_callback)(struct protoent *, void *context); 57typedef void (*si_rpc_async_callback)(struct rpcent *, void *context); 58typedef void (*si_fs_async_callback)(struct fstab *, void *context); 59typedef void (*si_addrinfo_async_callback)(int32_t status, struct addrinfo *res, void *context); 60typedef void (*si_nameinfo_async_callback)(int32_t status, char *node, char *serv, void *context); 61typedef void (*si_setent_async_callback)(void *context); 62