xref: /titanic_44/usr/src/lib/libnsl/common/llib-lnsl (revision 7c478bd95313f5f23a4c958a745db2134aa03244)
1/*
2 * CDDL HEADER START
3 *
4 * The contents of this file are subject to the terms of the
5 * Common Development and Distribution License, Version 1.0 only
6 * (the "License").  You may not use this file except in compliance
7 * with the License.
8 *
9 * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10 * or http://www.opensolaris.org/os/licensing.
11 * See the License for the specific language governing permissions
12 * and limitations under the License.
13 *
14 * When distributing Covered Code, include this CDDL HEADER in each
15 * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16 * If applicable, add the following below this CDDL HEADER, with the
17 * fields enclosed by brackets "[]" replaced with your own identifying
18 * information: Portions Copyright [yyyy] [name of copyright owner]
19 *
20 * CDDL HEADER END
21 */
22/* LINTLIBRARY */
23/* PROTOLIB1 */
24
25/*
26 * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
27 * Use is subject to license terms.
28 */
29
30#pragma ident	"%Z%%M%	%I%	%E% SMI"
31
32#include <sys/types.h>
33#include <thread.h>
34#include <synch.h>
35#include <fcntl.h>
36#include <sys/des.h>
37#include <des/softdes.h>
38#include <des/desdata.h>
39#include <rpc/rpc.h>
40#include <rpc/key_prot.h>
41#include <rpc/des_crypt.h>
42#include <rpc/trace.h>
43#include <rpc/pmap_prot.h>
44#include <sys/ioctl.h>
45#include <netdir.h>
46#include <nss_netdir.h>
47#include <nss_dbdefs.h>
48#include <sac.h>
49#include <netconfig.h>
50#include <ndbm.h>
51#include <rpcsvc/yp_prot.h>
52#include <rpcsvc/ypclnt.h>
53#include <rpcsvc/yppasswd.h>
54#include <rpcsvc/ypupd.h>
55#include <rpcsvc/nis.h>
56#include <rpcsvc/nis_callback.h>
57#include <rpcsvc/nislib.h>
58#include <rpcsvc/nispasswd.h>
59#include <sys/stream.h>
60#include <sys/stropts.h>
61#include <sys/tihdr.h>
62#include <sys/timod.h>
63#include <tiuser.h>
64
65
66/*
67 * Declare t_errno, even though this file is compiled '_REENTRANT'.  This
68 * way t_errno is defined in the lint library, which is used for programs
69 * compiled with _REENTRANT and those compiled without it.
70 */
71#ifdef t_errno
72#undef t_errno
73#endif
74extern int t_errno;
75
76/*
77 * usr/src/lib/libnsl/common routines
78 */
79
80/* common.c */
81
82/*
83 * usr/src/lib/libnsl/des routines
84 */
85
86/* des_crypt.c */
87int cbc_crypt(char *key, char *buf, size_t len, uint_t mode, char *ivec);
88int ecb_crypt(char *key, char *buf, size_t len, uint_t mode);
89
90/* des_soft.c */
91void des_setparity(char *p);
92int __des_crypt(char *buf, unsigned len, struct desparams *desp);
93
94/* intl_crypt.c */
95
96/* intl_soft.c */
97int _des_crypt(char *buf, unsigned len, struct desparams *desp);
98
99/*
100 * usr/src/lib/libnsl/dial routines
101 */
102
103/* callers.c */
104
105/* conn.c */
106
107/* dial.c */
108void undial(int fd);
109
110/* dkbreak.c */
111
112/* dkdial.c */
113
114/* dkerr.c */
115
116/* dkminor.c */
117
118/* dtnamer.c */
119
120/* getargs.c */
121
122/* interface.c */
123
124/* line.c */
125
126/* stoa.c */
127
128/* strecpy.c */
129
130/* strsave.c */
131
132/* sysfiles.c */
133
134/* ulockf.c */
135
136/* uucpdefs.c */
137
138/*
139 * usr/src/lib/libnsl/key routines
140 */
141
142/* gen_dhkeys.c */
143void __gen_dhkeys(char *public, char *secret, char *pass);
144
145/* publickey.c */
146int getpublickey(const char *netname, char *pkey);
147int __getpublickey_cached(char *netname, char *pkey, int *from_cache);
148void __getpublickey_flush(const char *netname);
149int getsecretkey(const char *netname, char *skey, const char *passwd);
150
151/* xcrypt.c */
152int xencrypt(char *secret, char *passwd);
153int xdecrypt(char *secret, char *passwd);
154int passwd2des(char *pw, char *key);
155
156/*
157 * usr/src/lib/libnsl/netdir routines
158 */
159
160/* netdir.c */
161int *__nderror(void);
162int netdir_getbyname(struct netconfig *tp, struct nd_hostserv *serv,
163				struct nd_addrlist **addrs);
164int netdir_getbyaddr(struct netconfig *tp, struct nd_hostservlist **serv,
165				struct netbuf *addr);
166int __netdir_getbyaddr_nosrv(struct netconfig *tp,
167				struct nd_hostservlist **serv,
168				struct netbuf *addr);
169int netdir_options(struct netconfig *tp, int option, int fd, char *par);
170struct netbuf *uaddr2taddr(struct netconfig *tp, char *addr);
171char *taddr2uaddr(struct netconfig *tp, struct netbuf *addr);
172void netdir_free(void *ptr, int type);
173char *netdir_sperror(void);
174void netdir_perror(char *s);
175
176/*
177 * usr/src/lib/libnsl/netselect routines
178 */
179
180/* netselect.c */
181void *setnetconfig(void);
182int endnetconfig(void *vdata);
183struct netconfig *getnetconfig(void *vdata);
184struct netconfig *getnetconfigent(const char *netid);
185void freenetconfigent(struct netconfig *netp);
186void *setnetpath(void);
187int endnetpath(void *vdata);
188struct netconfig *getnetpath(void *vdata);
189char *nc_sperror(void);
190void nc_perror(const char *string);
191
192/*
193 * usr/src/lib/libnsl/nis/cache routines
194 */
195
196/* cache.cc */
197
198/* cache_api.cc */
199#ifdef notdef
200/* XXX lacking appropriate public header files */
201nis_error __nis_CacheInit(NisCache **cache);
202#endif
203nis_error __nis_CacheBind(char *dname, directory_obj *dobj);
204bool_t __nis_CacheRemoveEntry(directory_obj *dobj);
205nis_error __nis_CacheSearch(char *dname, directory_obj *dobj);
206void __nis_CacheRestart(void);
207void __nis_CachePrint(void);
208bool_t __nis_CacheAddEntry(fd_result *, directory_obj *);
209uint32_t __nis_CacheLocalLoadPref(void);
210nis_error __nis_CacheLocalInit(uint32_t *exp_time);
211nis_error __nis_CacheMgrInit(void);
212void __nis_CacheMgrCleanup(void);
213nis_error __nis_CacheMgrBindReplica(char *dname);
214nis_error __nis_CacheMgrBindMaster(char *dname);
215nis_error __nis_CacheMgrBindServer(nis_server *srv, int nsrv);
216int __nis_CacheMgrRefreshBinding(nis_bound_directory *binding);
217int __nis_CacheMgrRefreshAddress(nis_bound_endpoint *bep);
218int __nis_CacheMgrRefreshCallback(nis_bound_endpoint *bep);
219int __nis_CacheMgrUpdateUaddr(char *uaddr);
220void __nis_CacheMgrMarkUp(void);
221uint32_t __nis_CacheMgrTimers(void);
222uint32_t __nis_CacheMgrRefreshCache(void);
223uint32_t __nis_serverRefreshCache(void);
224
225/* client_cache.cc */
226
227/* cold_start.cc */
228bool_t writeColdStartFile(directory_obj *dobj);
229
230/* local_cache.cc */
231
232/* mapped_cache.cc */
233
234/* mgr_cache.cc */
235
236/* nis_cache_clnt.cc */
237
238/* nis_cache_xdr.cc */
239
240/*
241 * usr/src/lib/libnsl/nis/gen routines
242 */
243
244/* nis_callback.c */
245int __nis_destroy_callback(void);
246nis_server *__nis_init_callback(CLIENT *svc_clnt, int (*cbfunc)(),
247								void *userdata);
248int __nis_run_callback(netobj *srvid, rpcproc_t srvproc,
249				struct timeval *timeout, CLIENT *myserv);
250
251/* nis_cast.c */
252enum clnt_stat __nis_cast_proc(nis_bound_directory *binding, int base,
253				int nbep, rpcproc_t procnum,
254				xdrproc_t xdr_inproc, void *in,
255				xdrproc_t xdr_outproc, void *out,
256				int *fastest, int mytimeout);
257
258/* nis_cback_xdr.c */
259bool_t xdr_obj_p(XDR *xdrs, obj_p *objp);
260bool_t xdr_cback_data(XDR *xdrs, cback_data *objp);
261
262/* nis_clnt.c */
263
264/* nis_groups.c */
265typedef nis_result *(*nis_lookup_func)(nis_name, u_int);
266int __nis_group_cache_stats(int *grpcachecall, int *grpcachehits,
267					int *grpcachemisses);
268bool_t nis_ismember(nis_name princp, nis_name group);
269bool_t __do_ismember(nis_name princp, nis_object *obj, nis_lookup_func lookup);
270void nis_print_group_entry(nis_name group);
271void nis_flushgroups(void);
272void __nis_flush_group_exp_name(nis_name groupname);
273nis_name __nis_map_group_r(const nis_name name, char *buf, size_t bufsize);
274nis_error nis_addmember(nis_name princp, nis_name group);
275nis_error nis_removemember(nis_name princp, nis_name group);
276nis_error nis_verifygroup(nis_name group);
277nis_error __nis_creategroup_obj(nis_name name, uint_t flags, nis_object *obj);
278nis_error nis_creategroup(nis_name name, uint_t flags);
279nis_error nis_destroygroup(nis_name name);
280
281/* nis_hash.c */
282int nis_in_table(nis_name name, NIS_HASH_TABLE *table, int *key);
283int nis_insert_item(NIS_HASH_ITEM *item, NIS_HASH_TABLE *table);
284NIS_HASH_ITEM *nis_find_item(nis_name name, NIS_HASH_TABLE *table);
285NIS_HASH_ITEM *nis_pop_item(NIS_HASH_TABLE *table);
286NIS_HASH_ITEM *nis_remove_item(nis_name name, NIS_HASH_TABLE *table);
287void nis_insert_name(nis_name name, NIS_HASH_TABLE *table);
288void nis_remove_name(nis_name name, NIS_HASH_TABLE *table);
289
290/* nis_lookup.c */
291nis_result *__nis_remote_lookup(ib_request *req, u_int flags, int list_op,
292				void *cbdata, int (*cback)());
293nis_result *__nis_core_lookup(ib_request *req, u_int flags, int list_op,
294				void *cbdata, int (*cback)());
295fd_result *__nis_finddirectory_remote(nis_bound_directory **binding,
296				char *dname);
297fd_result *__nis_finddirectory(nis_bound_directory **binding, char *dname);
298fd_result *nis_finddirectory(directory_obj *dobj, nis_name name);
299
300/* nis_misc.c */
301void __nis_pingproc(nis_server *srv, nis_name name, uint32_t mtime);
302void nis_ping(nis_name name, uint32_t mtime, nis_object *obj);
303log_result *nis_dumplog(nis_server *host, nis_name name, uint32_t dtime);
304log_result *nis_dump(nis_server *host, nis_name name, int (*cback)());
305void nis_free_binding(nis_bound_directory *binding);
306void __nis_path_free(char **names, int len);
307nis_error __nis_path(char *from, char *to, int *path_length, char ***namesp);
308int __nis_host_is_server(nis_server *, int);
309void __nis_print_result(nis_result *);
310struct netconfig *__nis_get_netconfig(endpoint *);
311
312/* nis_misc_proc.c */
313void __nis_auth2princ(char *name, int flavor, caddr_t auth, bool_t refresh,
314			int verbose);
315bool_t __nis_ck_perms(u_int right, u_int mask, nis_object *obj,
316				nis_name pr, int level);
317bool_t __nis_ismaster(char *host, char *domain);
318bool_t __nis_isadmin(char *princ, char *table, char *domain);
319nis_server * __nis_host2nis_server(char *host, bool_t addpubkey, int *errcode);
320
321/* nis_names.c */
322int __nis_parse_path(char *path, nis_name *list, int max);
323nis_name *nis_getnames(nis_name name);
324void nis_freenames(nis_name *namelist);
325
326/* nis_perror.c */
327char *nis_sperrno(nis_error stat);
328void nis_perror(nis_error stat, char *str);
329char *nis_sperror_r(nis_error stat, char *str, char buf[], int len);
330char *nis_sperror(nis_error stat, char *str);
331void nis_lerror(nis_error stat, char *str);
332
333/* nis_rpc.c */
334typedef struct {
335	nis_server *srv;
336	int nsrv;
337	char *name;
338	int parent_first;
339	u_int flags;
340	struct timeval timeout;
341	nis_error niserror;
342	uint32_t aticks;
343	int state;
344	nis_bound_directory *binding;
345	int base;
346	int end;
347	int count;
348	int start;
349	int cur;
350	int bound_to;
351	int refresh_count;
352} nis_call_state;
353
354void __nis_reset_state(void);
355void __nis_bad_auth_server(CLIENT *c);
356void __nis_release_server(nis_call_state *state, CLIENT *c,
357					enum clnt_stat status);
358CLIENT *__nis_get_server(nis_call_state *state);
359
360/* nis_subr.c */
361int __start_clock(int clk);
362unsigned int __stop_clock(int clk);
363name_pos nis_dir_cmp(nis_name n1, nis_name n2);
364nis_name nis_local_group(void);
365nis_name nis_domain_of(char *s);
366nis_name nis_leaf_of_r(const nis_name  s, char *buf, size_t bufsize);
367nis_name nis_leaf_of(char *s);
368nis_name nis_name_of(char *s);
369nis_name nis_local_directory(void);
370int __nis_principal(char *principal_name, uid_t uid, char *directory);
371nis_name nis_local_principal(void);
372nis_name nis_local_host(void);
373void nis_destroy_object(nis_object *obj);
374nis_object *nis_clone_object(nis_object *obj, nis_object *dest);
375char **__break_name(nis_name name, int *levels);
376int __name_distance(char **targ, char **test);
377nis_result *nis_make_error(nis_error err, uint32_t aticks, uint32_t cticks,
378				uint32_t dticks, uint32_t zticks);
379nis_attr *__cvt2attr(int *na, char **attrs);
380void nis_free_request(ib_request *req);
381nis_error nis_get_request(nis_name name, nis_object *obj, netobj *cookie,
382				ib_request *reqreq);
383nis_object *nis_read_obj(char *f);
384int nis_write_obj(char *f, nis_object *o);
385CLIENT *nis_make_rpchandle(nis_server *srv, int cback, rpcprog_t prog,
386			rpcvers_t ver, u_int flags, int inbuf, int outbuf);
387void *nis_get_static_storage(struct nis_sdata *bs, u_int el, u_int nel);
388char *nis_old_data(char *s);
389char *nis_data(char *s);
390nis_name __nis_local_root(void);
391
392/* nis_tags.c */
393void nis_freeservlist(nis_server **servers);
394nis_server **nis_getservlist(nis_name name);
395nis_error nis_stats(nis_server *srv, nis_tag *tags, int ntags,
396							nis_tag **result);
397nis_error nis_servstate(nis_server *srv, nis_tag *tags, int ntags,
398							nis_tag **result);
399void nis_freetags(nis_tag *tags, int ntags);
400
401/* nis_xdr.c */
402bool_t xdr_nis_attr(XDR *xdrs, nis_attr *objp);
403bool_t xdr_nis_name(XDR *xdrs, nis_name *objp);
404bool_t xdr_endpoint(XDR *xdrs, endpoint *objp);
405bool_t xdr_nis_server(XDR *xdrs, nis_server *objp);
406bool_t xdr_directory_obj(XDR *xdrs, directory_obj *objp);
407bool_t xdr_entry_obj(XDR *xdrs, entry_obj *objp);
408bool_t xdr_table_obj(XDR *xdrs, table_obj *objp);
409bool_t xdr_objdata(XDR *xdrs, objdata *objp);
410bool_t xdr_nis_oid(XDR *xdrs, nis_oid *objp);
411bool_t xdr_nis_object(XDR *xdrs, nis_object *objp);
412bool_t xdr_nis_object(XDR *xdrs, nis_object *objp);
413bool_t xdr_nis_error(XDR *xdrs, nis_error *objp);
414bool_t xdr_nis_result(XDR *xdrs, nis_result *objp);
415bool_t xdr_ns_request(XDR *xdrs, ns_request *objp);
416bool_t xdr_ib_request(XDR *xdrs, ib_request *objp);
417bool_t xdr_ping_args(XDR *xdrs, ping_args *objp);
418bool_t xdr_log_entry_t(XDR *xdrs, log_entry_t *objp);
419bool_t xdr_log_entry(XDR *xdrs, log_entry *objp);
420bool_t xdr_log_result(XDR *xdrs, log_result *objp);
421bool_t xdr_cp_result(XDR *xdrs, cp_result *objp);
422bool_t xdr_nis_tag(XDR *xdrs, nis_tag *objp);
423bool_t xdr_nis_taglist(XDR *xdrs, nis_taglist *objp);
424bool_t xdr_dump_args(XDR *xdrs, dump_args *objp);
425bool_t xdr_fd_args(XDR *xdrs, fd_args *objp);
426bool_t xdr_fd_result(XDR *xdrs, fd_result *objp);
427bool_t xdr_nis_bound_endpoint(XDR *xdrs, nis_bound_endpoint *objp);
428bool_t xdr_nis_bound_directory(XDR *xdrs, nis_bound_directory *objp);
429bool_t xdr_nis_active_endpoint(XDR *xdrs, nis_active_endpoint *objp);
430
431/* nislib.c */
432void nis_freeresult(nis_result *res);
433void __nis_freelogresult(log_result *lres);
434nis_error nis_bind_dir(char *dname, int parent_first,
435				nis_bound_directory **binding, u_int flags);
436nis_result *nis_lookup(nis_name name, uint_t flags);
437nis_result *nis_list(nis_name name, uint_t flags, int (*cback)(),
438				void *cbdata);
439nis_result *nis_add(nis_name name, nis_object *obj);
440nis_result *nis_remove(nis_name name, nis_object *obj);
441nis_result *nis_modify(nis_name name, nis_object *obj);
442nis_result *nis_add_entry(nis_name name, nis_object *obj, uint_t flags);
443nis_result *nis_remove_entry(nis_name name, nis_object *obj, uint_t flags);
444nis_result *nis_modify_entry(nis_name name, nis_object *obj, uint_t flags);
445nis_result *nis_first_entry(nis_name table);
446nis_result *nis_next_entry(nis_name table, netobj *cookie);
447nis_result *nis_checkpoint(nis_name name);
448nis_error nis_mkdir(nis_name name, nis_server *srv);
449nis_error nis_rmdir(nis_name name, nis_server *srv);
450nis_error __nis_send_msg(nis_server *srv, int proc, xdrproc_t out, char *msg);
451nis_result *__nis_list_localcb(nis_name name, u_int flags,
452				int (*cback)(), void *cbdata);
453
454/* npd_lib.c */
455bool_t __npd_ecb_crypt(uint32_t *val1, uint32_t *val2, des_block *buf,
456			uint_t bufsize, uint_t mode, des_block *deskey);
457bool_t __npd_cbc_crypt(uint32_t *val, char *str, uint_t strsize,
458			npd_newpass *buf, uint_t bufsize, uint_t mode,
459			des_block *deskey);
460
461/* print_obj.c */
462void nis_print_rights(u_int r);
463void nis_print_directory(directory_obj *r);
464void nis_print_group(group_obj *g);
465void nis_print_table(table_obj *t);
466void nis_print_link(link_obj *l);
467void nis_print_entry(entry_obj *edata);
468void nis_print_object(nis_object *o);
469
470/* thr_misc.c */
471
472/*
473 * usr/src/lib/libnsl/nsl routines
474 */
475
476/* _conn_util.c */
477
478/* _data2.c */
479
480/* _errlst.c */
481int *__t_errno(void);
482
483/* _utility.c */
484
485/* t_accept.c */
486int t_accept(int, int, struct t_call *);
487
488/* t_alloc.c */
489char *t_alloc(int, int, int);
490
491/* t_bind.c */
492int t_bind(int, struct t_bind *, struct t_bind *);
493
494/* t_close.c */
495int t_close(int);
496
497/* t_connect.c */
498int t_connect(int, struct t_call *, struct t_call *);
499
500/* t_error.c */
501void t_error(const char *);
502
503/* t_free.c */
504int t_free(char *, int);
505
506/* t_getinfo.c */
507int t_getinfo(int, struct t_info *);
508
509/* t_getname.c */
510int t_getname(int, struct netbuf *, int);
511
512/* t_getstate.c */
513int t_getstate(int);
514
515/* t_listen.c */
516int t_listen(int, struct t_call *);
517
518/* t_look.c */
519int t_look(int);
520
521/* t_open.c */
522int t_open(const char *, int, struct t_info *);
523
524/* t_optmgmt.c */
525int t_optmgmt(int, struct t_optmgmt *, struct t_optmgmt *);
526
527/* t_rcv.c */
528int t_rcv(int, char *, unsigned, int *);
529
530/* t_rcvconnect.c */
531int t_rcvconnect(int, struct t_call *);
532
533/* t_rcvdis.c */
534int t_rcvdis(int, struct t_discon *);
535
536/* t_rcvrel.c */
537int t_rcvrel(int);
538
539/* t_rcvudata.c */
540int t_rcvudata(int, struct t_unitdata *, int *);
541
542/* t_rcvuderr.c */
543int t_rcvuderr(int, struct t_uderr *);
544
545/* t_snd.c */
546int t_snd(int, char *, unsigned, int);
547
548/* t_snddis */
549int t_snddis(int, struct t_call *);
550
551/* t_sndrel.c */
552int t_sndrel(int);
553
554/* t_sndudata.c */
555int t_sndudata(int, struct t_unitdata *);
556
557/* t_strerror.c */
558char *_t_strerror(int);
559
560/* t_sync.c */
561int t_sync(int);
562
563/* t_unbind.c */
564int t_unbind(int);
565
566/*
567 * struct t_iovec is defined in <xti.h>. But <xti.h> cannot be included
568 * because inclusion of <xti.h> and <tiuser.h> are mututally exclusive
569 * and <tiuser.h> is exposed by the inclusion of <rpc/rpc.h>. Needs to
570 * be seen how to build llib-lnsl.ln from multiple source files to avoid
571 * this problem.
572 */
573struct t_iovec {
574	void	*iov_base;
575	size_t	iov_len;
576};
577
578/* t_sndv.c */
579int t_sndv(int, const struct t_iovec *,  unsigned int, int);
580
581/* t_sndvudata.c */
582int t_sndvudata(int, struct t_unitdata *, struct t_iovec *, unsigned int);
583
584/* t_sndreldata.c */
585int t_sndreldata(int, struct t_discon *);
586
587/* t_rcvv.c */
588int t_rcvv(int, struct t_iovec *, unsigned int, int *);
589
590/* t_rcvvudata.c */
591int t_rcvvudata(int, struct t_unitdata *, struct t_iovec *,
592        unsigned int, int *);
593
594/* t_rcvreldata.c */
595extern int t_rcvreldata(int, struct t_discon *);
596
597/* t_sysconf.c */
598int t_sysconf(int);
599
600/* xti_wrappers.c */
601int _xti_accept(int, int, struct t_call *);
602int _xti_xns5_accept(int, int, struct t_call *);
603char *_xti_alloc(int, int, int);
604int _xti_bind(int, struct t_bind *, struct t_bind *);
605int _xti_close(int);
606int _xti_connect(int, struct t_call *, struct t_call *);
607int _xti_error(char *);
608int _xti_free(char *, int);
609int _xti_getinfo(int, struct t_info *);
610int _xti_getprotaddr(int, struct t_bind *, struct t_bind *);
611int _xti_getstate(int);
612int _xti_listen(int, struct t_call *);
613int _xti_look(int);
614int _xti_open(char *, int, struct t_info *);
615int _xti_optmgmt(int, struct t_optmgmt *, struct t_optmgmt *);
616int _xti_rcv(int, char *, unsigned int, int *);
617int _xti_rcvconnect(int, struct t_call *);
618int _xti_rcvdis(int, struct t_discon *);
619int _xti_rcvrel(int);
620int _xti_rcvreldata(int, struct t_discon *);
621int _xti_rcvudata(int, struct t_unitdata *, int *);
622int _xti_rcvuderr(int, struct t_uderr *);
623int _xti_rcvv(int, struct t_iovec *, unsigned int, int *);
624int _xti_rcvvudata(int, struct t_unitdata *, struct t_iovec *,
625    unsigned int, int *);
626int _xti_snd(int, char *, unsigned int, int);
627int _xti_xns5_snd(int, char *, unsigned int, int);
628int _xti_snddis(int, struct t_call *);
629int _xti_sndrel(int);
630int _xti_sndreldata(int, struct t_discon *);
631int _xti_sndudata(int, struct t_unitdata *);
632int _xti_sndv(int, const struct t_iovec *, unsigned int, int);
633int _xti_sndvudata(int, struct t_unitdata *, struct t_iovec *, unsigned int);
634char *_xti_strerror(int);
635int _xti_sync(int);
636int _xti_sysconf(int);
637int _xti_unbind(int);
638
639/*
640 * usr/src/lib/libnsl/nss routines
641 */
642
643/* gethostby_door.c */
644
645/* gethostbyname_r.c */
646struct hostent *_uncached_gethostbyname_r(const char *nam,
647				struct hostent *result,
648				char *buffer, int buflen, int *h_errnop);
649struct hostent *_uncached_gethostbyaddr_r(const char *addr, int length,
650				int type, struct hostent *result,
651				char *buffer, int buflen, int *h_errnop);
652struct hostent *gethostbyname_r(const char *nam, struct hostent *result,
653				char *buffer, int buflen, int *h_errnop);
654struct hostent *gethostbyaddr_r(const char *addr, int length, int type,
655				struct hostent *result,
656				char *buffer, int buflen, int *h_errnop);
657
658/* gethostent.c */
659struct hostent *gethostbyname(const char *nam);
660struct hostent *gethostbyaddr(const void *addr, socklen_t len, int type);
661struct hostent *gethostent(void);
662
663/* gethostent_r.c */
664int sethostent(int stay);
665int endhostent(void);
666struct hostent *gethostent_r(struct hostent *result, char *buffer, int buflen,
667				int *h_errnop);
668
669/* getipnodeby.c */
670void freehostent(struct hostent *hent);
671struct hostent *getipnodebyaddr(const void *src, size_t len, int type,
672				int *error_num);
673struct hostent *getipnodebyname(const char *name, int af, int flags,
674				int *error_num);
675
676/* getrpcent.c */
677struct rpcent *getrpcbyname(const char *nam);
678struct rpcent *getrpcbynumber(const int num);
679struct rpcent *getrpcent(void);
680
681/* getrpcent_r.c */
682struct rpcent *getrpcbyname_r(const char *name, struct rpcent *result,
683				char *buffer, int buflen);
684struct rpcent *getrpcbynumber_r(const int number, struct rpcent *result,
685				char *buffer, int buflen);
686void setrpcent(const int stay);
687void endrpcent(void);
688struct rpcent *getrpcent_r(struct rpcent *result, char *buffer, int buflen);
689
690/* inet_ntop.c */
691const char *inet_ntop(int af, const void *src, char *dst, socklen_t size);
692
693/* inet_pton.c */
694int inet_pton(int af, const char *src, void *dst);
695
696/* netdir_inet.c */
697int _get_hostserv_inetnetdir_byname(struct netconfig *nconf,
698				struct nss_netdirbyname_in *args,
699				union nss_netdirbyname_out *res);
700int _get_hostserv_inetnetdir_byaddr(struct netconfig *nconf,
701				struct nss_netdirbyaddr_in *args,
702				union nss_netdirbyaddr_out *res);
703int __nss2herrno(nss_status_t nsstat);
704nss_status_t _herrno2nss(int h_errno);
705struct hostent *_switch_gethostbyname_r(const char *name,
706				struct hostent *result,
707				char *buffer, int buflen, int *h_errnop);
708struct hostent *_switch_gethostbyaddr_r(const char *addr, int len, int type,
709				struct hostent *result,
710				char *buffer, int buflen, int *h_errnop);
711int str2servent(const char *instr, int lenstr, void *ent,
712				char *buffer, int buflen);
713void *__inet_get_local_interfaces(void);
714void __inet_free_local_interfaces(void *p);
715int __inet_address_is_local(void *p, struct in_addr addr);
716int __inet_uaddr_is_local(void *p, struct netconfig *nc, char *uaddr);
717int __inet_address_count(void *p);
718ulong_t __inet_get_addr(void *p, int n);
719char *__inet_get_uaddr(void *p, struct netconfig *nc, int n);
720char *__inet_get_networka(void *p, int n);
721
722/* netdir_inet_sundry.c */
723
724/*
725 * usr/src/lib/libnsl/rpc routines
726 */
727
728/* auth_des.c */
729AUTH *authdes_seccreate(const char *servername, uint_t win,
730			const char *timehost, const des_block *ckey);
731
732/* auth_none.c */
733AUTH *authnone_create(void);
734
735/* auth_sys.c */
736AUTH *authsys_create(const char *machname, uid_t uid, gid_t gid, int len,
737			const gid_t *aup_gids);
738AUTH *authsys_create_default(void);
739
740/* auth_time.c */
741
742/* authdes_prot.c */
743bool_t xdr_authdes_cred(XDR *xdrs, struct authdes_cred *cred);
744bool_t xdr_authdes_verf(XDR *xdrs, struct authdes_verf *verf);
745
746/* authsys_prot.c */
747bool_t xdr_authsys_parms(XDR *xdrs, struct authsys_parms *p);
748bool_t xdr_uid_t(XDR *xdrs, uid_t *ip);
749bool_t xdr_gid_t(XDR *xdrs, gid_t *ip);
750
751/* clnt_bcast.c */
752enum clnt_stat rpc_broadcast_exp(rpcprog_t prog, rpcvers_t vers, rpcproc_t proc,
753		xdrproc_t xargs, caddr_t argsp, xdrproc_t xresults,
754		caddr_t resultsp, resultproc_t eachresult, int inittime,
755		int waittime, const char *netclass);
756enum clnt_stat rpc_broadcast(rpcprog_t prog, rpcvers_t vers, rpcproc_t proc,
757		xdrproc_t xargs, caddr_t argsp, xdrproc_t xresults,
758		caddr_t resultsp, resultproc_t eachresult,
759		const char *netclass);
760
761/* clnt_dg.c */
762CLIENT *clnt_dg_create(int fd, struct netbuf *svcaddr, rpcprog_t program,
763		rpcvers_t version, uint_t sendsz, uint_t recvsz);
764
765/* clnt_door.c */
766CLIENT *clnt_door_create(rpcprog_t program, rpcvers_t version, uint_t sendsz);
767
768/* clnt_generic.c */
769CLIENT *clnt_create_vers(const char *hostname, rpcprog_t prog,
770		rpcvers_t *vers_out, rpcvers_t vers_low,
771		rpcvers_t vers_high, const char *nettype);
772CLIENT *clnt_create_vers_timed(const char *hostname, rpcprog_t prog,
773		rpcvers_t *vers_out, rpcvers_t vers_low,
774		rpcvers_t vers_high, const char *nettype,
775		const struct timeval *tp);
776CLIENT *clnt_create(const char *hostname, rpcprog_t prog, rpcvers_t vers,
777		const char *nettype);
778CLIENT *clnt_create_timed(const char *hostname, rpcprog_t prog, rpcvers_t vers,
779		const char *netclass, const struct timeval *tp);
780CLIENT *clnt_tp_create(const char *hostname, rpcprog_t prog, rpcvers_t vers,
781		const struct netconfig *nconf);
782CLIENT *clnt_tp_create_timed(const char *hostname, rpcprog_t prog,
783		rpcvers_t vers, const struct netconfig *nconf,
784		const struct timeval *tp);
785CLIENT *clnt_tli_create(int fd, const struct netconfig *nconf,
786		struct netbuf *svcaddr, rpcprog_t prog, rpcvers_t vers,
787		uint_t sendsz, uint_t recvsz);
788
789/* clnt_perror.c */
790char *clnt_sperror(const CLIENT *cl, const char *s);
791void clnt_perror(const CLIENT *cl, const char *s);
792void clnt_perrno(enum clnt_stat num);
793char *clnt_spcreateerror(const char *s);
794void clnt_pcreateerror(const char *s);
795const char *clnt_sperrno(const enum clnt_stat stat);
796
797/* clnt_raw.c */
798CLIENT *clnt_raw_create(rpcprog_t prog, rpcvers_t vers);
799
800/* clnt_simple.c */
801enum clnt_stat rpc_call(const char *host, rpcprog_t prognum, rpcvers_t versnum,
802		rpcproc_t procnum, xdrproc_t inproc, const char *in,
803		xdrproc_t outproc, char *out, const char *netclass);
804
805/* clnt_vc.c */
806CLIENT *clnt_vc_create(int fd, struct netbuf *svcaddr, rpcprog_t prog,
807		rpcvers_t vers, uint_t sendsz, uint_t recvsz);
808
809/* getdname.c */
810int getdomainname(char *name, int namelen);
811int setdomainname(char *domain, int len);
812
813/* gethostname.c */
814int gethostname(char *hname, int hlen);
815
816/* inet_ntoa.c */
817char *inet_ntoa_r(struct in_addr in, char b[]);
818char *inet_ntoa(struct in_addr in);
819in_addr_t inet_addr(const char *cp);
820in_addr_t inet_netof(struct in_addr in);
821
822/* key_call.c */
823int key_setsecret(const char *secretkey);
824int key_secretkey_is_set(void);
825int key_encryptsession_pk(char *remotename, netobj *remotekey,
826				des_block *deskey);
827int key_decryptsession_pk(char *remotename, netobj *remotekey,
828				des_block *deskey);
829
830int key_encryptsession(const char *remotename, des_block *deskey);
831int key_decryptsession(const char *remotename, des_block *deskey);
832int key_gendes(des_block *key);
833int key_setnet(struct key_netstarg *arg);
834int key_get_conv(char *pkey, des_block *deskey);
835int key_call(ulong_t proc, xdrproc_t xdr_arg, char *arg, xdrproc_t xdr_rslt,
836				char *rslt);
837
838/* key_prot.c */
839bool_t xdr_keystatus(register XDR *xdrs, keystatus *objp);
840bool_t xdr_keybuf(register XDR *xdrs, keybuf objp);
841bool_t xdr_netnamestr(register XDR *xdrs, netnamestr *objp);
842bool_t xdr_cryptkeyarg(register XDR *xdrs, cryptkeyarg *objp);
843bool_t xdr_cryptkeyarg2(register XDR *xdrs, cryptkeyarg2 *objp);
844bool_t xdr_cryptkeyres(register XDR *xdrs, cryptkeyres *objp);
845bool_t xdr_unixcred(register XDR *xdrs, unixcred *objp);
846bool_t xdr_getcredres(register XDR *xdrs, getcredres *objp);
847bool_t xdr_key_netstarg(register XDR *xdrs, key_netstarg *objp);
848bool_t xdr_key_netstres(register XDR *xdrs, key_netstres *objp);
849
850/* mt_misc.c */
851#ifdef rpc_createerr
852#undef rpc_createerr
853#endif
854struct rpc_createerr *__rpc_createerr(void);
855
856/* netname.c */
857int getnetname(char *name);
858int __getnetnamebyuid(char *name, uid_t uid);
859int user2netname(char *netname, const uid_t uid, const char *domain);
860int host2netname(char *netname, const char *host, const char *domain);
861
862/* netnamer.c */
863int netname2user(const char *netname, uid_t *uidp, gid_t *gidp,
864					int *gidlenp, gid_t *gidlist);
865int netname2host(const char *netname, char *hostname, int hostlen);
866
867/* openchild.c */
868
869/* pmap_clnt.c */
870int pmap_set(rpcprog_t program, rpcvers_t version, rpcprot_t protocol, ushort_t port);
871bool_t pmap_unset(rpcprog_t program, rpcvers_t version);
872ushort_t pmap_getport(struct sockaddr_in *address, rpcprog_t program,
873			rpcvers_t version, rpcprot_t protocol);
874struct pmaplist *pmap_getmaps(struct sockaddr_in *address);
875enum clnt_stat pmap_rmtcall(struct sockaddr_in *addr, rpcprog_t prog,
876			rpcvers_t vers, rpcproc_t proc, xdrproc_t xdrargs,
877			caddr_t argsp, xdrproc_t xdrres, caddr_t resp,
878			struct timeval tout, rpcport_t *port_ptr);
879
880/* pmap_prot.c */
881bool_t xdr_pmap(XDR *xdrs, struct pmap *objp);
882bool_t xdr_pmaplist_ptr(XDR *xdrs, pmaplist_ptr *rp);
883bool_t xdr_pmaplist(XDR *xdrs, PMAPLIST **rp);
884bool_t xdr_rmtcallargs(XDR *xdrs, struct p_rmtcallargs *cap);
885bool_t xdr_rmtcallres(XDR *xdrs, struct p_rmtcallres *crp);
886
887/* rpc_callmsg.c */
888bool_t xdr_callmsg(XDR *xdrs, struct rpc_msg *cmsg);
889
890/* rpc_comdata.c */
891
892/* rpc_generic.c */
893int __rpc_dtbsize(void);
894uint_t __rpc_get_t_size(t_scalar_t size, t_scalar_t bufsize);
895uint_t __rpc_get_a_size(t_scalar_t size);
896struct netconfig *__rpc_getconfip(char *nettype);
897void *__rpc_setconf(char *nettype);
898struct netconfig *__rpc_getconf(void *vhandle);
899void __rpc_endconf(void *vhandle);
900struct netconfig *__rpcfd_to_nconf(int fd, int servtype);
901int __rpc_matchserv(int servtype, unsigned int nc_semantics);
902
903/* rpc_prot.c */
904bool_t xdr_opaque_auth(XDR *xdrs, struct opaque_auth *ap);
905bool_t xdr_des_block(XDR *xdrs, des_block *blkp);
906bool_t xdr_accepted_reply(XDR *xdrs, struct accepted_reply *ar);
907bool_t xdr_rejected_reply(XDR *xdrs, struct rejected_reply *rr);
908bool_t xdr_replymsg(XDR *xdrs, struct rpc_msg *rmsg);
909bool_t xdr_callhdr(XDR *xdrs, struct rpc_msg *cmsg);
910void __seterr_reply(struct rpc_msg *msg, struct rpc_err *error);
911
912/* rpc_sel2poll.c */
913int __rpc_select_to_poll(int fdmax, fd_set *fdset, struct pollfd *p0);
914int __rpc_timeval_to_msec(struct timeval *t);
915
916/* rpc_soc.c */
917CLIENT *clntudp_bufcreate(struct sockaddr_in *raddr, rpcprog_t prog,
918			rpcvers_t vers, struct timeval wait, int *sockp,
919			uint_t sendsz, uint_t recvsz);
920CLIENT *clntudp_create(struct sockaddr_in *raddr, rpcprog_t program,
921			rpcvers_t version, struct timeval wait, int *sockp);
922CLIENT *clnttcp_create(struct sockaddr_in *raddr, rpcprog_t prog,
923			rpcvers_t vers, int *sockp, uint_t sendsz,
924			uint_t recvsz);
925CLIENT *clntraw_create(rpcprog_t prog, rpcvers_t vers);
926SVCXPRT *svctcp_create(int fd, uint_t sendsize, uint_t recvsize);
927SVCXPRT *svcudp_bufcreate(int fd, uint_t sendsize, uint_t recvsize);
928SVCXPRT *svcfd_create(int fd, uint_t sendsize, uint_t recvsize);
929SVCXPRT *svcudp_create(int fd);
930SVCXPRT *svcraw_create(void);
931int __rpc_bindresvport(int fd, struct sockaddr_in *sin, int *portp, int qlen);
932void get_myaddress(struct sockaddr_in *addr);
933ushort_t getrpcport(char *host, rpcprog_t prognum, rpcvers_t versnum, rpcprot_t proto);
934int callrpc(char *host, rpcprog_t prognum, rpcvers_t versnum, rpcproc_t procnum,
935		xdrproc_t inproc, char *in, xdrproc_t outproc, char *out);
936int registerrpc(rpcprog_t prognum, rpcvers_t versnum, rpcproc_t procnum,
937		char *(*progname)(), xdrproc_t inproc, xdrproc_t outproc);
938enum clnt_stat clnt_broadcast(rpcprog_t prog, rpcvers_t vers, rpcproc_t proc,
939		xdrproc_t xargs, caddr_t argsp, xdrproc_t xresults,
940		caddr_t resultsp, resultproc_t eachresult);
941AUTH *authdes_create(char *servername, uint_t window,
942		struct sockaddr_in *syncaddr, des_block *ckey);
943
944/* rpc_td.c */
945
946/* rpc_trace.c */
947
948/* rpcb_clnt.c */
949bool_t __rpc_control(int request, void *info);
950bool_t rpcb_set(rpcprog_t program, rpcvers_t version,
951		const struct netconfig *nconf, const struct netbuf *address);
952bool_t rpcb_unset(rpcprog_t program, rpcvers_t version,
953		const struct netconfig *nconf);
954int rpcb_getaddr(rpcprog_t program, rpcvers_t version,
955		const struct netconfig *nconf, struct netbuf *address,
956		const char *host);
957rpcblist *rpcb_getmaps(const struct netconfig *nconf, const char *host);
958enum clnt_stat rpcb_rmtcall(const struct netconfig *nconf, const char *host,
959		rpcprog_t prog, rpcvers_t vers, rpcproc_t proc,
960		xdrproc_t xdrargs, caddr_t argsp, xdrproc_t xdrres,
961		caddr_t resp, struct timeval tout,
962		struct netbuf *addr_ptr);
963bool_t rpcb_gettime(const char *host, time_t *timep);
964char *rpcb_taddr2uaddr(struct netconfig *nconf, struct netbuf *taddr);
965struct netbuf *rpcb_uaddr2taddr(struct netconfig *nconf, char *uaddr);
966
967/* rpcb_prot.c */
968bool_t xdr_rpcb(XDR *xdrs, RPCB *objp);
969bool_t xdr_rpcblist_ptr(XDR *xdrs, rpcblist_ptr *rp);
970bool_t xdr_rpcblist(XDR *xdrs, RPCBLIST **rp);
971bool_t xdr_rpcb_entry(XDR *xdrs, rpcb_entry *objp);
972bool_t xdr_rpcb_entry_list_ptr(XDR *xdrs, rpcb_entry_list_ptr *rp);
973bool_t xdr_rpcb_rmtcallargs(XDR *xdrs, struct r_rpcb_rmtcallargs *objp);
974bool_t xdr_rpcb_rmtcallres(XDR *xdrs, struct r_rpcb_rmtcallres *objp);
975bool_t xdr_netbuf(XDR *xdrs, struct netbuf *objp);
976
977/* rpcb_st_xdr.c */
978bool_t xdr_rpcbs_addrlist(XDR *xdrs, rpcbs_addrlist *objp);
979bool_t xdr_rpcbs_addrlist(XDR *xdrs, rpcbs_addrlist *objp);
980
981bool_t xdr_rpcbs_rmtcalllist(XDR *xdrs, rpcbs_rmtcalllist *objp);
982bool_t xdr_rpcbs_proc(XDR *xdrs, rpcbs_proc objp);
983bool_t xdr_rpcbs_addrlist_ptr(XDR *xdrs, rpcbs_addrlist_ptr *objp);
984bool_t xdr_rpcbs_rmtcalllist_ptr(XDR *xdrs, rpcbs_rmtcalllist_ptr *objp);
985bool_t xdr_rpcb_stat(XDR *xdrs, rpcb_stat *objp);
986bool_t xdr_rpcb_stat_byvers(XDR *xdrs, rpcb_stat_byvers objp);
987
988/* rpcdname.c */
989int __rpc_get_default_domain(char **domain);
990
991/* rpcsec_gss_if.c */
992AUTH *rpc_gss_seccreate(CLIENT *clnt, char *principal, char *mechanism,
993		rpc_gss_service_t service_type, char *qop,
994		rpc_gss_options_req_t *options_req,
995		rpc_gss_options_ret_t *options_ret);
996bool_t rpc_gss_set_defaults(AUTH *auth, rpc_gss_service_t service, char *qop);
997bool_t rpc_gss_get_principal_name(rpc_gss_principal_t *principal, char
998		*mechanism, char *user_name, char *node, char *secdomain);
999char **rpc_gss_get_mechanisms(void);
1000char **rpc_gss_get_mech_info(char *mechanism, rpc_gss_service_t *service);
1001bool_t rpc_gss_get_versions(u_int *vers_hi, u_int *vers_lo);
1002bool_t rpc_gss_is_installed(char *mechanism);
1003bool_t rpc_gss_set_svc_name(char *principal, char *mechanism, uint_t req_time,
1004		uint_t program, uint_t version);
1005bool_t rpc_gss_set_callback(rpc_gss_callback_t *cb);
1006bool_t rpc_gss_getcred(struct svc_req *req, rpc_gss_rawcred_t **rcred,
1007		rpc_gss_ucred_t **ucred, void **cookie);
1008bool_t rpc_gss_mech_to_oid(char *mech, rpc_gss_OID *oid);
1009bool_t rpc_gss_qop_to_num(char *qop, char *mech, u_int *num);
1010int rpc_gss_max_data_length(AUTH *rpcgss_handle, int max_tp_unit_len);
1011int rpc_gss_svc_max_data_length(struct svc_req *req, int max_tp_unit_len);
1012void rpc_gss_get_error(rpc_gss_error_t *error);
1013
1014/* rtime_tli.c */
1015int rtime_tli(char *host, struct timeval *timep, struct timeval *timeout);
1016
1017/* svc.c */
1018void xprt_register(const SVCXPRT *xprt);
1019void xprt_unregister(const SVCXPRT *xprt);
1020bool_t svc_reg(const SVCXPRT *xprt, rpcprog_t prog, rpcvers_t vers,
1021		void (*dispatch)(), const struct netconfig *nconf);
1022void svc_unreg(rpcprog_t prog, rpcvers_t vers);
1023bool_t svc_register(SVCXPRT *xprt, rpcprog_t prog, rpcvers_t vers,
1024		void (*dispatch)(), int protocol);
1025void svc_unregister(rpcprog_t prog, rpcvers_t vers);
1026bool_t svc_sendreply(const SVCXPRT *xprt, xdrproc_t xdr_results,
1027		caddr_t xdr_location);
1028void svcerr_noproc(const SVCXPRT *xprt);
1029void svcerr_decode(const SVCXPRT *xprt);
1030void svcerr_systemerr(const SVCXPRT *xprt);
1031void svcerr_auth(const SVCXPRT *xprt, enum auth_stat why);
1032void svcerr_weakauth(const SVCXPRT *xprt);
1033void svcerr_noprog(const SVCXPRT *xprt);
1034void svcerr_progvers(const SVCXPRT *xprt, rpcvers_t low_vers,
1035		rpcvers_t high_vers);
1036void svc_getreq(int rdfds);
1037void svc_getreqset(fd_set *readfds);
1038void svc_getreq_poll(struct pollfd *pfdp, int pollretval);
1039void svc_getreq_common(int fd);
1040SVCXPRT *svc_xprt_alloc(void);
1041void svc_xprt_free(SVCXPRT *xprt);
1042bool_t svc_get_local_cred(SVCXPRT *xprt, svc_local_cred_t *lcred);
1043SVCAUTH *__svc_get_svcauth(SVCXPRT *);
1044void *__svc_set_proc_cleanup_cb(void *cb);
1045
1046/* svc_auth.c */
1047enum auth_stat __authenticate(struct svc_req *rqst, struct rpc_msg *msg);
1048int svc_auth_reg(int cred_flavor, enum auth_stat (*handler)());
1049
1050/* svc_auth_sys.c */
1051
1052/* svc_dg.c */
1053SVCXPRT *svc_dg_create(int fd, uint_t sendsize, uint_t recvsize);
1054int svc_dg_enablecache(SVCXPRT *xprt, uint_t size);
1055
1056/* svc_door.c */
1057SVCXPRT *svc_door_create(void (*dispatch)(), rpcprog_t prognum,
1058			rpcvers_t versnum, uint_t sendsize);
1059
1060/* svc_generic.c */
1061int svc_create(void (*dispatch)(), rpcprog_t prognum, rpcvers_t versnum,
1062			const char *nettype);
1063SVCXPRT *svc_tp_create(void (*dispatch)(), rpcprog_t prognum, rpcvers_t versnum,
1064			const struct netconfig *nconf);
1065SVCXPRT *svc_tli_create(int fd, const struct netconfig *nconf,
1066			const struct t_bind *bindaddr, uint_t sendsz,
1067			uint_t recvsz);
1068
1069/* svc_raw.c */
1070SVCXPRT *svc_raw_create(void);
1071
1072/* svc_run.c */
1073void svc_run(void);
1074void svc_exit(void);
1075void svc_done(SVCXPRT *xprt);
1076bool_t rpc_control(int op, void *info);
1077
1078/* svc_simple.c */
1079int rpc_reg(rpcprog_t prognum, rpcvers_t versnum, rpcproc_t procnum,
1080		char *(*progname)(), xdrproc_t inproc, xdrproc_t outproc,
1081		const char *nettype);
1082
1083/* svc_vc.c */
1084SVCXPRT *svc_vc_create(int fd, uint_t sendsize, uint_t recvsize);
1085SVCXPRT *svc_fd_create(int fd, uint_t sendsize, uint_t recvsize);
1086void __svc_nisplus_fdcleanup_hack(void);
1087void __svc_nisplus_enable_timestamps(void);
1088void __svc_nisplus_purge_since(long since);
1089bool_t __svc_vc_dupcache_init(SVCXPRT *xprt, void *condition, int basis);
1090int __svc_vc_dup(struct svc_req *req, caddr_t *resp_buf, uint_t *resp_bufsz);
1091int __svc_vc_dupdone(struct svc_req *req, caddr_t resp_buf, uint_t resp_bufsz,
1092				int status);
1093
1094/* svcauth_des.c */
1095int authdes_getucred(const struct authdes_cred *adc, uid_t *uid, gid_t *gid,
1096				short *grouplen, gid_t *groups);
1097enum auth_stat __svcauth_des(struct svc_req *rqst, struct rpc_msg *msg);
1098
1099/* ti_opts.c */
1100int __rpc_negotiate_uid(int fd);
1101int __rpc_get_local_uid(SVCXPRT *trans, uid_t *uid_out);
1102
1103/* xdr.c */
1104void xdr_free(xdrproc_t proc, char *objp);
1105bool_t xdr_void(void);
1106bool_t xdr_int(XDR *xdrs, int *ip);
1107bool_t xdr_u_int(XDR *xdrs, uint_t *up);
1108bool_t xdr_long(XDR *xdrs, long *lp);
1109bool_t xdr_u_long(XDR *xdrs, ulong_t *ulp);
1110bool_t xdr_short(XDR *xdrs, short *sp);
1111bool_t xdr_u_short(XDR *xdrs, ushort_t *sp);
1112bool_t xdr_char(XDR *xdrs, char *cp);
1113bool_t xdr_u_char(XDR *xdrs, uchar_t *cp);
1114bool_t xdr_bool(XDR *xdrs, bool_t *bp);
1115bool_t xdr_enum(XDR *xdrs, enum_t *ep);
1116bool_t xdr_opaque(XDR *xdrs, caddr_t cp, uint_t cnt);
1117bool_t xdr_bytes(XDR *xdrs, char **cpp, uint_t *sizep, uint_t maxsize);
1118bool_t xdr_netobj(XDR *xdrs, struct netobj *np);
1119bool_t xdr_union(XDR *xdrs, enum_t *dscmp, char *unp,
1120			const struct xdr_discrim *choices, xdrproc_t dfault);
1121bool_t xdr_string(XDR *xdrs, char **cpp, uint_t maxsize);
1122bool_t xdr_hyper(XDR *xdrs, longlong_t *hp);
1123bool_t xdr_u_hyper(XDR *xdrs, u_longlong_t *hp);
1124bool_t xdr_longlong_t(XDR *xdrs, longlong_t *hp);
1125bool_t xdr_u_longlong_t(XDR *xdrs, u_longlong_t *hp);
1126bool_t xdr_ulonglong_t(XDR *xdrs, u_longlong_t *hp);
1127bool_t xdr_wrapstring(XDR *xdrs, char **cpp);
1128
1129/* xdr_array.c */
1130bool_t xdr_array(XDR *xdrs, caddr_t *addrp, uint_t *sizep, uint_t maxsize,
1131				uint_t elsize, xdrproc_t elproc);
1132bool_t xdr_vector(XDR *xdrs, char *basep, uint_t nelem, uint_t elemsize,
1133				xdrproc_t xdr_elem);
1134
1135/* xdr_float.c */
1136bool_t xdr_float(XDR *xdrs, float *fp);
1137bool_t xdr_double(XDR *xdrs, double *dp);
1138bool_t xdr_quadruple(XDR *xdrs, long double *fp);
1139
1140/* xdr_mem.c */
1141void xdrmem_create(XDR *xdrs, caddr_t addr, uint_t size, enum xdr_op op);
1142
1143/* xdr_rec.c */
1144void xdrrec_create(XDR *xdrs, uint_t sendsize, uint_t recvsize,
1145			caddr_t tcp_handle, int (*readit)(), int (*writeit)());
1146
1147uint_t xdrrec_readbytes(XDR *xdrs, caddr_t addr, uint_t l);
1148bool_t xdrrec_skiprecord(XDR *xdrs);
1149bool_t xdrrec_eof(XDR *xdrs);
1150bool_t xdrrec_endofrecord(XDR *xdrs, bool_t sendnow);
1151
1152/* xdr_refer.c */
1153bool_t xdr_reference(XDR *xdrs, caddr_t *pp, uint_t size, xdrproc_t proc);
1154bool_t xdr_pointer(XDR *xdrs, char **objpp, uint_t obj_size, xdrproc_t xdr_obj);
1155
1156/* xdr_sizeof.c */
1157unsigned int xdr_sizeof(xdrproc_t func, void *data);
1158
1159/* xdr_stdio.c */
1160void xdrstdio_create(XDR *xdrs, FILE *file, enum xdr_op op);
1161
1162/* svid_funcs.c */
1163#undef	auth_destroy
1164#undef	clnt_call
1165#undef	clnt_control
1166#undef	clnt_destroy
1167#undef	clnt_freeres
1168#undef	clnt_geterr
1169#undef	svc_destroy
1170#undef	svc_freeargs
1171#undef	svc_getargs
1172#undef	svc_getrpccaller
1173#undef	xdr_destroy
1174#undef	xdr_getpos
1175#undef	xdr_inline
1176#undef	xdr_setpos
1177void auth_destroy(AUTH *auth);
1178enum clnt_stat clnt_call(CLIENT *cl, rpcproc_t proc, xdrproc_t xargs,
1179			caddr_t argsp, xdrproc_t xres, caddr_t resp,
1180			struct timeval timeout);
1181bool_t clnt_control(CLIENT *cl, uint_t rq, void *in);
1182void clnt_destroy(CLIENT *cl);
1183bool_t clnt_freeres(CLIENT *cl, xdrproc_t xres, caddr_t resp);
1184void clnt_geterr(CLIENT *cl, struct rpc_err *errp);
1185bool_t svc_control(SVCXPRT *xprt, const uint_t rq, void *in);
1186bool_t svc_freeargs(SVCXPRT *xprt, xdrproc_t xargs, char *argsp);
1187bool_t svc_getargs(SVCXPRT *xprt, xdrproc_t xargs, char *argsp);
1188struct netbuf *svc_getrpccaller(SVCXPRT *xprt);
1189long *xdr_inline(XDR *xdrs, int len);
1190void xdr_destroy(XDR *xdrs);
1191uint_t xdr_getpos(XDR *xdrs);
1192bool_t xdr_setpos(XDR *xdrs, uint_t pos);
1193
1194/*
1195 * usr/src/lib/libnsl/saf routines
1196 */
1197
1198/* checkver.c */
1199int check_version(int ver, char *fname);
1200
1201/* doconfig.c */
1202int doconfig(int fd, char *script, long rflag);
1203
1204/*
1205 * usr/src/lib/libnsl/yp routines
1206 */
1207
1208/* dbm.c */
1209int dbminit(char *file);
1210int dbmclose(void);
1211datum fetch(datum key);
1212int delete(datum key);
1213int store(datum key, datum dat);
1214datum firstkey(void);
1215datum nextkey(datum key);
1216datum firsthash(long hash);
1217datum makdatum(char *buf, int n);
1218long hashinc(long hash);
1219long calchash(datum item);
1220
1221/* yp_all.c */
1222int yp_all(char *domain, char *map, struct ypall_callback *callback);
1223int __yp_all_rsvdport(char *domain, char *map, struct ypall_callback *callback);
1224
1225/* yp_b_clnt.c */
1226enum ypbind_resptype {
1227	YPBIND_SUCC_VAL = 1,
1228	YPBIND_FAIL_VAL = 2
1229};
1230typedef enum ypbind_resptype ypbind_resptype;
1231struct ypbind_resp {
1232	ypbind_resptype ypbind_status;
1233	union {
1234		uint_t ypbind_error;
1235		struct ypbind_binding *ypbind_bindinfo;
1236	} ypbind_resp_u;
1237};
1238typedef struct ypbind_resp ypbind_resp;
1239struct ypbind_domain {
1240	char *ypbind_domainname;
1241	rpcvers_t ypbind_vers;
1242};
1243typedef struct ypbind_domain ypbind_domain;
1244struct ypbind_setdom {
1245	char *ypsetdom_domain;
1246	struct ypbind_binding *ypsetdom_bindinfo;
1247};
1248typedef struct ypbind_setdom ypbind_setdom;
1249ypbind_resp *ypbindproc_domain_3(ypbind_domain *argp, CLIENT *clnt);
1250
1251/* yp_b_xdr.c */
1252bool_t xdr_ypbind_domain(XDR *xdrs, ypbind_domain *objp);
1253bool_t xdr_ypbind_resp(XDR *xdrs, ypbind_resp *objp);
1254bool_t xdr_ypbind_setdom(XDR *xdrs, ypbind_setdom *objp);
1255bool_t xdr_ypbind_resptype(XDR *xdrs, ypbind_resptype *objp);
1256
1257/* yp_bind.c */
1258struct dom_binding {
1259	struct dom_binding *dom_pnext;
1260	char *dom_domain;
1261	struct ypbind_binding *dom_binding;
1262	CLIENT *dom_client;
1263	int cache_bad;
1264	int fd;
1265	dev_t rdev;
1266	int ref_count;
1267	int need_free;
1268	mutex_t server_name_lock;
1269};
1270int __yp_dobind(char *domain, struct dom_binding **binding);
1271int __yp_rel_binding(struct dom_binding *binding);
1272void yp_unbind(char *domain);
1273int __yp_add_binding(char *domain, char *addr);
1274int yp_bind(char *domain);
1275int yp_get_default_domain(char **domain);
1276int usingypmap(char **ddn, char *map);
1277CLIENT *__clnt_create_loopback(rpcprog_t prog, rpcvers_t vers, int err);
1278
1279/* yp_enum.c */
1280int yp_first(char *domain, char *map, char **key, int *keylen,
1281					char **val, int  *vallen);
1282int yp_next(char *domain, char *map, char *inkey, int inkeylen,
1283		char **outkey, int  *outkeylen, char **val, int *vallen);
1284
1285/* yp_master.c */
1286int yp_master(char *domain, char *map, char **master);
1287int __yp_master_rsvdport(char *domain, char *map, char **master);
1288
1289/* yp_match.c */
1290int yp_match(char *domain, char *map, char *key, int keylen,
1291						char **val, int  *vallen);
1292int yp_match_rsvdport(char *domain, char *map, char *key, int keylen,
1293						char **val, int  *vallen);
1294void __empty_yp_cache(void);
1295
1296/* yp_order.c */
1297int yp_order(char *domain, char *map, unsigned long *order);
1298
1299/* yp_rsvd.c */
1300CLIENT *__yp_clnt_create_rsvdport(const char *hostname,
1301			rpcprog_t prog, rpcvers_t vers,
1302			const char *nettype,
1303			const uint_t sendsz, const uint_t recvsz);
1304
1305/* yp_update.c */
1306int yp_update(char *domain, char *map, unsigned op,
1307			char *key, int keylen, char *data, int datalen);
1308
1309/* yp_xdr.c */
1310bool xdr_datum(XDR * xdrs, datum *pdatum);
1311bool xdr_ypdomain_wrap_string(XDR *xdrs, char **ppstring);
1312bool xdr_ypmap_wrap_string(XDR *xdrs, char **ppstring);
1313bool xdr_ypreq_key(XDR *xdrs, struct ypreq_key *ps);
1314bool xdr_ypreq_nokey(XDR *xdrs, struct ypreq_nokey *ps);
1315bool xdr_ypresp_val(XDR *xdrs, struct ypresp_val *ps);
1316bool xdr_ypresp_key_val(XDR *xdrs, struct ypresp_key_val *ps);
1317bool xdr_ypowner_wrap_string(XDR *xdrs, char **ppstring);
1318bool xdr_ypmap_parms(XDR *xdrs, struct ypmap_parms *ps);
1319bool xdr_ypresp_master(XDR *xdrs, struct ypresp_master *ps);
1320bool xdr_ypresp_order(XDR * xdrs, struct ypresp_order *ps);
1321bool xdr_ypresp_maplist(XDR *xdrs, struct ypresp_maplist *ps);
1322bool xdr_yppushresp_xfr(XDR *xdrs, struct yppushresp_xfr *ps);
1323bool xdr_ypreq_newxfr(XDR *xdrs, struct ypreq_newxfr *ps);
1324bool xdr_ypreq_xfr(XDR *xdrs, struct ypreq_xfr *ps);
1325bool xdr_ypall(XDR *xdrs, struct ypall_callback *callback);
1326
1327/* yperr_string.c */
1328char *yperr_string(int code);
1329
1330/* yppasswd_xdr.c */
1331bool_t xdr_yppasswd(XDR *xdrsp, struct yppasswd *pp);
1332
1333/* ypprot_err.c */
1334int ypprot_err(int yp_protocol_error);
1335
1336/* ypupd.c */
1337bool_t xdr_yp_buf(XDR *xdrs, yp_buf *objp);
1338bool_t xdr_ypupdate_args(XDR *xdrs, ypupdate_args *objp);
1339bool_t xdr_ypdelete_args(XDR *xdrs, ypdelete_args *objp);
1340
1341/* nis_sec_mechs.c */
1342char *__nis_keyalg2authtype(keylen_t keylen, algtype_t algtype,
1343	char *authtype, size_t authtype_len);
1344