17c478bd9Sstevel@tonic-gate /* 27c478bd9Sstevel@tonic-gate * CDDL HEADER START 37c478bd9Sstevel@tonic-gate * 47c478bd9Sstevel@tonic-gate * The contents of this file are subject to the terms of the 5*39d3e169Sevanl * Common Development and Distribution License (the "License"). 6*39d3e169Sevanl * You may not use this file except in compliance with the License. 77c478bd9Sstevel@tonic-gate * 87c478bd9Sstevel@tonic-gate * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE 97c478bd9Sstevel@tonic-gate * or http://www.opensolaris.org/os/licensing. 107c478bd9Sstevel@tonic-gate * See the License for the specific language governing permissions 117c478bd9Sstevel@tonic-gate * and limitations under the License. 127c478bd9Sstevel@tonic-gate * 137c478bd9Sstevel@tonic-gate * When distributing Covered Code, include this CDDL HEADER in each 147c478bd9Sstevel@tonic-gate * file and include the License file at usr/src/OPENSOLARIS.LICENSE. 157c478bd9Sstevel@tonic-gate * If applicable, add the following below this CDDL HEADER, with the 167c478bd9Sstevel@tonic-gate * fields enclosed by brackets "[]" replaced with your own identifying 177c478bd9Sstevel@tonic-gate * information: Portions Copyright [yyyy] [name of copyright owner] 187c478bd9Sstevel@tonic-gate * 197c478bd9Sstevel@tonic-gate * CDDL HEADER END 207c478bd9Sstevel@tonic-gate */ 217c478bd9Sstevel@tonic-gate /* 22*39d3e169Sevanl * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 237c478bd9Sstevel@tonic-gate * Use is subject to license terms. 247c478bd9Sstevel@tonic-gate */ 257c478bd9Sstevel@tonic-gate 267c478bd9Sstevel@tonic-gate #ifndef _AUTOMOUNT_H 277c478bd9Sstevel@tonic-gate #define _AUTOMOUNT_H 287c478bd9Sstevel@tonic-gate 297c478bd9Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 307c478bd9Sstevel@tonic-gate 317c478bd9Sstevel@tonic-gate #include <fslib.h> /* needed for mntlist_t declaration */ 327c478bd9Sstevel@tonic-gate #include <thread.h> 337c478bd9Sstevel@tonic-gate #include <sys/mntent.h> /* " " MNTTYPE_* declarations */ 347c478bd9Sstevel@tonic-gate #include <synch.h> /* needed for mutex_t declaration */ 357c478bd9Sstevel@tonic-gate #include <sys/types.h> 367c478bd9Sstevel@tonic-gate #include <rpc/rpc.h> 37*39d3e169Sevanl #include <sys/fs/autofs.h> 387c478bd9Sstevel@tonic-gate #include <netinet/in.h> /* needed for sockaddr_in declaration */ 39*39d3e169Sevanl #include <ucred.h> 407c478bd9Sstevel@tonic-gate 417c478bd9Sstevel@tonic-gate #ifdef MALLOC_DEBUG 427c478bd9Sstevel@tonic-gate #include <debug_alloc.h> 437c478bd9Sstevel@tonic-gate #endif 447c478bd9Sstevel@tonic-gate 457c478bd9Sstevel@tonic-gate #ifdef __cplusplus 467c478bd9Sstevel@tonic-gate extern "C" { 477c478bd9Sstevel@tonic-gate #endif 487c478bd9Sstevel@tonic-gate 497c478bd9Sstevel@tonic-gate #ifndef _REENTRANT 507c478bd9Sstevel@tonic-gate #define fork1 vfork 517c478bd9Sstevel@tonic-gate #define rpc_control(a, b) 1 527c478bd9Sstevel@tonic-gate #endif 537c478bd9Sstevel@tonic-gate 54*39d3e169Sevanl #define DOMOUNT_USER 1 55*39d3e169Sevanl #define DOMOUNT_KERNEL 2 567c478bd9Sstevel@tonic-gate 577c478bd9Sstevel@tonic-gate /* 587c478bd9Sstevel@tonic-gate * Solaris autofs configuration file location 597c478bd9Sstevel@tonic-gate */ 607c478bd9Sstevel@tonic-gate #define AUTOFSADMIN "/etc/default/autofs" 617c478bd9Sstevel@tonic-gate 627c478bd9Sstevel@tonic-gate #define MXHOSTNAMELEN 64 637c478bd9Sstevel@tonic-gate #define MAXNETNAMELEN 255 647c478bd9Sstevel@tonic-gate #define MAXFILENAMELEN 255 657c478bd9Sstevel@tonic-gate #define LINESZ 4096 667c478bd9Sstevel@tonic-gate #define MAXADDRLEN 128 /* max autofs address length */ 677c478bd9Sstevel@tonic-gate #define MAXOPTSLEN 1024 687c478bd9Sstevel@tonic-gate 697c478bd9Sstevel@tonic-gate #define AUTOFS_MOUNT_TIMEOUT 600 /* default min time mount will */ 707c478bd9Sstevel@tonic-gate /* remain mounted (in seconds) */ 717c478bd9Sstevel@tonic-gate #define AUTOFS_RPC_TIMEOUT 60 /* secs autofs will wait for */ 727c478bd9Sstevel@tonic-gate /* automountd's reply before */ 737c478bd9Sstevel@tonic-gate /* retransmitting */ 747c478bd9Sstevel@tonic-gate /* stack ops */ 757c478bd9Sstevel@tonic-gate #define ERASE 0 767c478bd9Sstevel@tonic-gate #define PUSH 1 777c478bd9Sstevel@tonic-gate #define POP 2 787c478bd9Sstevel@tonic-gate #define INIT 3 797c478bd9Sstevel@tonic-gate #define STACKSIZ 30 807c478bd9Sstevel@tonic-gate 817c478bd9Sstevel@tonic-gate #define DIST_SELF 1 827c478bd9Sstevel@tonic-gate #define DIST_MYSUB 2 837c478bd9Sstevel@tonic-gate #define DIST_MYNET 3 847c478bd9Sstevel@tonic-gate #define DIST_OTHER 4 857c478bd9Sstevel@tonic-gate 867c478bd9Sstevel@tonic-gate #define MAXIFS 32 877c478bd9Sstevel@tonic-gate 887c478bd9Sstevel@tonic-gate /* 897c478bd9Sstevel@tonic-gate * Retry operation related definitions. 907c478bd9Sstevel@tonic-gate */ 917c478bd9Sstevel@tonic-gate #define RET_OK 0 927c478bd9Sstevel@tonic-gate #define RET_RETRY 32 937c478bd9Sstevel@tonic-gate #define RET_ERR 33 947c478bd9Sstevel@tonic-gate #define INITDELAY 5 957c478bd9Sstevel@tonic-gate #define DELAY_BACKOFF 2 967c478bd9Sstevel@tonic-gate #define MAXDELAY 120 977c478bd9Sstevel@tonic-gate #define DELAY(delay) { \ 987c478bd9Sstevel@tonic-gate (void) sleep(delay); \ 997c478bd9Sstevel@tonic-gate delay *= DELAY_BACKOFF; \ 1007c478bd9Sstevel@tonic-gate if (delay > MAXDELAY) \ 1017c478bd9Sstevel@tonic-gate delay = MAXDELAY; \ 1027c478bd9Sstevel@tonic-gate } 1037c478bd9Sstevel@tonic-gate 1047c478bd9Sstevel@tonic-gate struct mapline { 1057c478bd9Sstevel@tonic-gate char linebuf[LINESZ]; 1067c478bd9Sstevel@tonic-gate char lineqbuf[LINESZ]; 1077c478bd9Sstevel@tonic-gate }; 1087c478bd9Sstevel@tonic-gate 1097c478bd9Sstevel@tonic-gate /* 1107c478bd9Sstevel@tonic-gate * Structure describing a host/filesystem/dir tuple in a NIS map entry 1117c478bd9Sstevel@tonic-gate */ 1127c478bd9Sstevel@tonic-gate struct mapfs { 1137c478bd9Sstevel@tonic-gate struct mapfs *mfs_next; /* next in entry */ 1147c478bd9Sstevel@tonic-gate int mfs_ignore; /* ignore this entry */ 1157c478bd9Sstevel@tonic-gate char *mfs_host; /* host name */ 1167c478bd9Sstevel@tonic-gate char *mfs_dir; /* dir to mount */ 1177c478bd9Sstevel@tonic-gate int mfs_penalty; /* mount penalty for this host */ 1187c478bd9Sstevel@tonic-gate int mfs_distance; /* distance hint */ 1197c478bd9Sstevel@tonic-gate struct nfs_args *mfs_args; /* nfs_args */ 1207c478bd9Sstevel@tonic-gate struct netconfig *mfs_nconf; 1217c478bd9Sstevel@tonic-gate rpcvers_t mfs_version; /* NFS version */ 1227c478bd9Sstevel@tonic-gate 1237c478bd9Sstevel@tonic-gate #define MFS_ALLOC_DIR 0x1 /* mfs_dir now points to different */ 1247c478bd9Sstevel@tonic-gate /* buffer */ 1257c478bd9Sstevel@tonic-gate 1267c478bd9Sstevel@tonic-gate #define MFS_URL 0x2 /* is NFS url listed in this tuple. */ 1277c478bd9Sstevel@tonic-gate #define MFS_FH_VIA_WEBNFS 0x4 /* got file handle during ping phase */ 1287c478bd9Sstevel@tonic-gate 1297c478bd9Sstevel@tonic-gate uint_t mfs_flags; 1307c478bd9Sstevel@tonic-gate uint_t mfs_port; /* port# in NFS url */ 1317c478bd9Sstevel@tonic-gate }; 1327c478bd9Sstevel@tonic-gate 1337c478bd9Sstevel@tonic-gate /* 1347c478bd9Sstevel@tonic-gate * NIS entry - lookup of name in DIR gets us this 1357c478bd9Sstevel@tonic-gate */ 1367c478bd9Sstevel@tonic-gate struct mapent { 1377c478bd9Sstevel@tonic-gate char *map_fstype; /* file system type e.g. "nfs" */ 1387c478bd9Sstevel@tonic-gate char *map_mounter; /* base fs e.g. "cachefs" */ 1397c478bd9Sstevel@tonic-gate char *map_root; /* path to mount root */ 1407c478bd9Sstevel@tonic-gate char *map_mntpnt; /* path from mount root */ 1417c478bd9Sstevel@tonic-gate char *map_mntopts; /* mount options */ 1427c478bd9Sstevel@tonic-gate char *map_fsw; /* mount fs information */ 1437c478bd9Sstevel@tonic-gate char *map_fswq; /* quoted mountfs information */ 1447c478bd9Sstevel@tonic-gate int map_mntlevel; /* mapentry hierarchy level */ 1457c478bd9Sstevel@tonic-gate bool_t map_modified; /* flags modified mapentries */ 1467c478bd9Sstevel@tonic-gate bool_t map_faked; /* flags faked mapentries */ 1477c478bd9Sstevel@tonic-gate int map_err; /* flags any bad entries in the map */ 1487c478bd9Sstevel@tonic-gate struct mapfs *map_fs; /* list of replicas for nfs */ 1497c478bd9Sstevel@tonic-gate struct mapent *map_next; 1507c478bd9Sstevel@tonic-gate }; 1517c478bd9Sstevel@tonic-gate 1527c478bd9Sstevel@tonic-gate 1537c478bd9Sstevel@tonic-gate /* 1547c478bd9Sstevel@tonic-gate * Descriptor for each directory served by the automounter 1557c478bd9Sstevel@tonic-gate */ 1567c478bd9Sstevel@tonic-gate struct autodir { 1577c478bd9Sstevel@tonic-gate char *dir_name; /* mount point */ 1587c478bd9Sstevel@tonic-gate char *dir_map; /* name of map for dir */ 1597c478bd9Sstevel@tonic-gate char *dir_opts; /* default mount options */ 1607c478bd9Sstevel@tonic-gate int dir_direct; /* direct mountpoint ? */ 1617c478bd9Sstevel@tonic-gate int dir_remount; /* a remount */ 1627c478bd9Sstevel@tonic-gate struct autodir *dir_next; /* next entry */ 1637c478bd9Sstevel@tonic-gate struct autodir *dir_prev; /* prev entry */ 1647c478bd9Sstevel@tonic-gate }; 1657c478bd9Sstevel@tonic-gate 1667c478bd9Sstevel@tonic-gate /* 1677c478bd9Sstevel@tonic-gate * This structure is used to build an array of 1687c478bd9Sstevel@tonic-gate * hostnames with associated penalties to be 1697c478bd9Sstevel@tonic-gate * passed to the nfs_cast procedure 1707c478bd9Sstevel@tonic-gate */ 1717c478bd9Sstevel@tonic-gate struct host_names { 1727c478bd9Sstevel@tonic-gate char *host; 1737c478bd9Sstevel@tonic-gate int penalty; 1747c478bd9Sstevel@tonic-gate }; 1757c478bd9Sstevel@tonic-gate 1767c478bd9Sstevel@tonic-gate /* 1777c478bd9Sstevel@tonic-gate * structure used to build list of contents for a map on 1787c478bd9Sstevel@tonic-gate * a readdir request 1797c478bd9Sstevel@tonic-gate */ 1807c478bd9Sstevel@tonic-gate struct dir_entry { 1817c478bd9Sstevel@tonic-gate char *name; /* name of entry */ 1827c478bd9Sstevel@tonic-gate ino_t nodeid; 1837c478bd9Sstevel@tonic-gate off_t offset; 1847c478bd9Sstevel@tonic-gate struct dir_entry *next; 1857c478bd9Sstevel@tonic-gate struct dir_entry *left; /* left element in binary tree */ 1867c478bd9Sstevel@tonic-gate struct dir_entry *right; /* right element in binary tree */ 1877c478bd9Sstevel@tonic-gate }; 1887c478bd9Sstevel@tonic-gate 1897c478bd9Sstevel@tonic-gate /* 1907c478bd9Sstevel@tonic-gate * offset index table 1917c478bd9Sstevel@tonic-gate */ 1927c478bd9Sstevel@tonic-gate struct off_tbl { 1937c478bd9Sstevel@tonic-gate off_t offset; 1947c478bd9Sstevel@tonic-gate struct dir_entry *first; 1957c478bd9Sstevel@tonic-gate struct off_tbl *next; 1967c478bd9Sstevel@tonic-gate }; 1977c478bd9Sstevel@tonic-gate 1987c478bd9Sstevel@tonic-gate #ifndef NO_RDDIR_CACHE 1997c478bd9Sstevel@tonic-gate /* 2007c478bd9Sstevel@tonic-gate * directory cache for 'map' 2017c478bd9Sstevel@tonic-gate */ 202*39d3e169Sevanl struct autofs_rddir_cache { 2037c478bd9Sstevel@tonic-gate char *map; 2047c478bd9Sstevel@tonic-gate struct off_tbl *offtp; 2057c478bd9Sstevel@tonic-gate ulong_t bucket_size; 2067c478bd9Sstevel@tonic-gate time_t ttl; 2077c478bd9Sstevel@tonic-gate struct dir_entry *entp; 2087c478bd9Sstevel@tonic-gate mutex_t lock; /* protects 'in_use' field */ 2097c478bd9Sstevel@tonic-gate int in_use; /* # threads referencing it */ 2107c478bd9Sstevel@tonic-gate rwlock_t rwlock; /* protects 'full' and 'next' */ 2117c478bd9Sstevel@tonic-gate int full; /* full == 1 when cache full */ 212*39d3e169Sevanl struct autofs_rddir_cache *next; 2137c478bd9Sstevel@tonic-gate }; 2147c478bd9Sstevel@tonic-gate 2157c478bd9Sstevel@tonic-gate #define RDDIR_CACHE_TIME 300 /* in seconds */ 2167c478bd9Sstevel@tonic-gate 2177c478bd9Sstevel@tonic-gate #endif /* NO_RDDIR_CACHE */ 2187c478bd9Sstevel@tonic-gate 2197c478bd9Sstevel@tonic-gate /* 2207c478bd9Sstevel@tonic-gate * structure used to maintain address list for localhost 2217c478bd9Sstevel@tonic-gate */ 2227c478bd9Sstevel@tonic-gate 2237c478bd9Sstevel@tonic-gate struct myaddrs { 2247c478bd9Sstevel@tonic-gate struct sockaddr_in sin; 2257c478bd9Sstevel@tonic-gate struct myaddrs *myaddrs_next; 2267c478bd9Sstevel@tonic-gate }; 2277c478bd9Sstevel@tonic-gate 2287c478bd9Sstevel@tonic-gate extern time_t timenow; /* set at start of processing of each RPC call */ 2297c478bd9Sstevel@tonic-gate extern char self[]; 2307c478bd9Sstevel@tonic-gate extern int verbose; 2317c478bd9Sstevel@tonic-gate extern int trace; 2327c478bd9Sstevel@tonic-gate extern int automountd_nobrowse; 2337c478bd9Sstevel@tonic-gate extern struct autodir *dir_head; 2347c478bd9Sstevel@tonic-gate extern struct autodir *dir_tail; 2357c478bd9Sstevel@tonic-gate extern struct mntlist *current_mounts; 23611606941Sjwahlig struct mounta; /* defined in sys/vfs.h */ 2377c478bd9Sstevel@tonic-gate extern struct myaddrs *myaddrs_head; 2387c478bd9Sstevel@tonic-gate 2397c478bd9Sstevel@tonic-gate extern rwlock_t cache_lock; 2407c478bd9Sstevel@tonic-gate extern rwlock_t portmap_cache_lock; 241*39d3e169Sevanl extern rwlock_t autofs_rddir_cache_lock; 2427c478bd9Sstevel@tonic-gate 2437c478bd9Sstevel@tonic-gate extern mutex_t cleanup_lock; 2447c478bd9Sstevel@tonic-gate extern cond_t cleanup_start_cv; 2457c478bd9Sstevel@tonic-gate extern cond_t cleanup_done_cv; 2467c478bd9Sstevel@tonic-gate 2477c478bd9Sstevel@tonic-gate /* 2487c478bd9Sstevel@tonic-gate * mnttab handling routines 2497c478bd9Sstevel@tonic-gate */ 2507c478bd9Sstevel@tonic-gate extern void free_mapent(struct mapent *); 2517c478bd9Sstevel@tonic-gate extern struct mntlist *getmntlist(void); 2527c478bd9Sstevel@tonic-gate extern dev_t get_devid(struct extmnttab *); 2537c478bd9Sstevel@tonic-gate 2547c478bd9Sstevel@tonic-gate /* 2557c478bd9Sstevel@tonic-gate * utilities 2567c478bd9Sstevel@tonic-gate */ 2577c478bd9Sstevel@tonic-gate extern struct mapent *parse_entry(char *, char *, char *, struct mapline *, 2587c478bd9Sstevel@tonic-gate char *, uint_t, bool_t); 2597c478bd9Sstevel@tonic-gate extern int macro_expand(char *, char *, char *, int); 2607c478bd9Sstevel@tonic-gate extern void unquote(char *, char *); 2617c478bd9Sstevel@tonic-gate extern void trim(char *); 2627c478bd9Sstevel@tonic-gate extern char *get_line(FILE *, char *, char *, int); 2637c478bd9Sstevel@tonic-gate extern int getword(char *, char *, char **, char **, char, int); 2647c478bd9Sstevel@tonic-gate extern int get_retry(char *); 2657c478bd9Sstevel@tonic-gate extern int str_opt(struct mnttab *, char *, char **); 2667c478bd9Sstevel@tonic-gate extern void dirinit(char *, char *, char *, int, char **, char ***); 2677c478bd9Sstevel@tonic-gate extern void pr_msg(const char *, ...); 2687c478bd9Sstevel@tonic-gate extern void trace_prt(int, char *, ...); 269*39d3e169Sevanl extern void free_autofs_args(autofs_args *); 270*39d3e169Sevanl extern void free_nfs_args(struct nfs_args *); 2717c478bd9Sstevel@tonic-gate extern void free_mounta(struct mounta *); 2727c478bd9Sstevel@tonic-gate 2737c478bd9Sstevel@tonic-gate extern int nopt(struct mnttab *, char *, int *); 2747c478bd9Sstevel@tonic-gate extern int set_versrange(rpcvers_t, rpcvers_t *, rpcvers_t *); 2757c478bd9Sstevel@tonic-gate extern enum clnt_stat pingnfs(char *, int, rpcvers_t *, rpcvers_t, 2767c478bd9Sstevel@tonic-gate ushort_t, bool_t, char *, char *); 2777c478bd9Sstevel@tonic-gate 278*39d3e169Sevanl extern void *autofs_get_buffer(size_t); 2797c478bd9Sstevel@tonic-gate extern int self_check(char *); 2807c478bd9Sstevel@tonic-gate extern int do_mount1(char *, char *, char *, char *, char *, uint_t, 281*39d3e169Sevanl action_list **, ucred_t *, int); 2827c478bd9Sstevel@tonic-gate extern int do_lookup1(char *, char *, char *, char *, char *, uint_t, 283*39d3e169Sevanl autofs_action_t *, struct linka *, ucred_t *); 2847c478bd9Sstevel@tonic-gate extern int do_unmount1(umntrequest *); 285*39d3e169Sevanl extern int do_readdir(autofs_rddirargs *, autofs_rddirres *, ucred_t *); 2867c478bd9Sstevel@tonic-gate extern int nfsunmount(struct mnttab *); 2877c478bd9Sstevel@tonic-gate extern int loopbackmount(char *, char *, char *, int); 2887c478bd9Sstevel@tonic-gate extern int mount_nfs(struct mapent *, char *, char *, int, 289*39d3e169Sevanl ucred_t *, action_list **); 2907c478bd9Sstevel@tonic-gate extern int mount_autofs(struct mapent *, char *, action_list *, 291*39d3e169Sevanl char *rootp, char *subdir, char *key); 2927c478bd9Sstevel@tonic-gate extern int mount_generic(char *, char *, char *, char *, int); 2937c478bd9Sstevel@tonic-gate extern enum clnt_stat nfs_cast(struct mapfs *, struct mapfs **, int); 2947c478bd9Sstevel@tonic-gate 2957c478bd9Sstevel@tonic-gate extern bool_t hasrestrictopt(char *); 2967c478bd9Sstevel@tonic-gate 2977c478bd9Sstevel@tonic-gate #ifndef NO_RDDIR_CACHE 2987c478bd9Sstevel@tonic-gate /* 2997c478bd9Sstevel@tonic-gate * readdir handling routines 3007c478bd9Sstevel@tonic-gate */ 3017c478bd9Sstevel@tonic-gate extern char *auto_rddir_malloc(unsigned); 3027c478bd9Sstevel@tonic-gate extern char *auto_rddir_strdup(const char *); 3037c478bd9Sstevel@tonic-gate extern struct dir_entry *btree_lookup(struct dir_entry *, char *); 3047c478bd9Sstevel@tonic-gate extern void btree_enter(struct dir_entry **, struct dir_entry *); 3057c478bd9Sstevel@tonic-gate extern int add_dir_entry(char *, struct dir_entry **, struct dir_entry **); 3067c478bd9Sstevel@tonic-gate extern void cache_cleanup(void); 307*39d3e169Sevanl extern int autofs_rddir_cache_lookup(char *, struct autofs_rddir_cache **); 3087c478bd9Sstevel@tonic-gate extern struct dir_entry *rddir_entry_lookup(char *, struct dir_entry *); 3097c478bd9Sstevel@tonic-gate #endif /* NO_RDDIR_CACHE */ 3107c478bd9Sstevel@tonic-gate 3117c478bd9Sstevel@tonic-gate /* 3127c478bd9Sstevel@tonic-gate * generic interface to specific name service functions 3137c478bd9Sstevel@tonic-gate */ 3147c478bd9Sstevel@tonic-gate extern void ns_setup(char **, char ***); 3157c478bd9Sstevel@tonic-gate extern int getmapent(char *, char *, struct mapline *, char **, char ***, 3167c478bd9Sstevel@tonic-gate bool_t *, bool_t); 3177c478bd9Sstevel@tonic-gate extern int getmapkeys(char *, struct dir_entry **, int *, int *, char **, 3187c478bd9Sstevel@tonic-gate char ***, uid_t); 3197c478bd9Sstevel@tonic-gate extern int loadmaster_map(char *, char *, char **, char ***); 3207c478bd9Sstevel@tonic-gate extern int loaddirect_map(char *, char *, char *, char **, char ***); 3217c478bd9Sstevel@tonic-gate 3227c478bd9Sstevel@tonic-gate /* 3237c478bd9Sstevel@tonic-gate * these name service specific functions should not be 3247c478bd9Sstevel@tonic-gate * accessed directly, use the generic functions. 3257c478bd9Sstevel@tonic-gate */ 3267c478bd9Sstevel@tonic-gate extern void init_files(char **, char ***); 3277c478bd9Sstevel@tonic-gate extern int getmapent_files(char *, char *, struct mapline *, char **, char ***, 3287c478bd9Sstevel@tonic-gate bool_t *, bool_t); 3297c478bd9Sstevel@tonic-gate extern int loadmaster_files(char *, char *, char **, char ***); 3307c478bd9Sstevel@tonic-gate extern int loaddirect_files(char *, char *, char *, char **, char ***); 3317c478bd9Sstevel@tonic-gate extern int getmapkeys_files(char *, struct dir_entry **, int *, int *, 3327c478bd9Sstevel@tonic-gate char **, char ***); 3337c478bd9Sstevel@tonic-gate extern int stack_op(int, char *, char **, char ***); 3347c478bd9Sstevel@tonic-gate 3357c478bd9Sstevel@tonic-gate extern void init_nisplus(char **, char ***); 3367c478bd9Sstevel@tonic-gate extern int getmapent_nisplus(char *, char *, struct mapline *, char **, 3377c478bd9Sstevel@tonic-gate char ***, bool_t *, bool_t); 3387c478bd9Sstevel@tonic-gate extern int loadmaster_nisplus(char *, char *, char **, char ***); 3397c478bd9Sstevel@tonic-gate extern int loaddirect_nisplus(char *, char *, char *, char **, char ***); 3407c478bd9Sstevel@tonic-gate extern int getmapkeys_nisplus(char *, struct dir_entry **, int *, int *, 3417c478bd9Sstevel@tonic-gate char **, char ***); 3427c478bd9Sstevel@tonic-gate 3437c478bd9Sstevel@tonic-gate extern void init_nis(char **, char ***); 3447c478bd9Sstevel@tonic-gate extern int getmapent_nis(char *, char *, struct mapline *, char **, char ***, 3457c478bd9Sstevel@tonic-gate bool_t *, bool_t); 3467c478bd9Sstevel@tonic-gate extern int loadmaster_nis(char *, char *, char **, char ***); 3477c478bd9Sstevel@tonic-gate extern int loaddirect_nis(char *, char *, char *, char **, char ***); 3487c478bd9Sstevel@tonic-gate extern int getmapkeys_nis(char *, struct dir_entry **, int *, int *, 3497c478bd9Sstevel@tonic-gate char **, char ***); 3507c478bd9Sstevel@tonic-gate 3517c478bd9Sstevel@tonic-gate extern void init_ldap(char **, char ***); 3527c478bd9Sstevel@tonic-gate extern int getmapent_ldap(char *, char *, struct mapline *, char **, char ***, 3537c478bd9Sstevel@tonic-gate bool_t *, bool_t); 3547c478bd9Sstevel@tonic-gate extern int loadmaster_ldap(char *, char *, char **, char ***); 3557c478bd9Sstevel@tonic-gate extern int loaddirect_ldap(char *, char *, char *, char **, char ***); 3567c478bd9Sstevel@tonic-gate extern int getmapkeys_ldap(char *, struct dir_entry **, int *, int *, 3577c478bd9Sstevel@tonic-gate char **, char ***); 3587c478bd9Sstevel@tonic-gate 3597c478bd9Sstevel@tonic-gate 3607c478bd9Sstevel@tonic-gate /* 3617c478bd9Sstevel@tonic-gate * end of name service specific functions 3627c478bd9Sstevel@tonic-gate */ 3637c478bd9Sstevel@tonic-gate 3647c478bd9Sstevel@tonic-gate /* 3657c478bd9Sstevel@tonic-gate * not defined in any header file 3667c478bd9Sstevel@tonic-gate */ 3677c478bd9Sstevel@tonic-gate extern bool_t xdr_uid_t(XDR *, uid_t *); 3687c478bd9Sstevel@tonic-gate extern int __clnt_bindresvport(CLIENT *); 3697c478bd9Sstevel@tonic-gate extern int getnetmaskbynet(const struct in_addr, struct in_addr *); 3707c478bd9Sstevel@tonic-gate 3717c478bd9Sstevel@tonic-gate /* 3727c478bd9Sstevel@tonic-gate * Hidden rpc functions 3737c478bd9Sstevel@tonic-gate */ 3747c478bd9Sstevel@tonic-gate extern int __nis_reset_state(); 3757c478bd9Sstevel@tonic-gate extern int __rpc_negotiate_uid(int); 3767c478bd9Sstevel@tonic-gate 3777c478bd9Sstevel@tonic-gate #ifdef __cplusplus 3787c478bd9Sstevel@tonic-gate } 3797c478bd9Sstevel@tonic-gate #endif 3807c478bd9Sstevel@tonic-gate 3817c478bd9Sstevel@tonic-gate #endif /* _AUTOMOUNT_H */ 382