xref: /freebsd/include/rpcsvc/nislib.h (revision ce834215a70ff69e7e222827437116eee2f9ac6f)
1 /*
2  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
3  * unrestricted use provided that this legend is included on all tape
4  * media and as a part of the software program in whole or part.  Users
5  * may copy or modify Sun RPC without charge, but are not authorized
6  * to license or distribute it to anyone else except as part of a product or
7  * program developed by the user.
8  *
9  * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
10  * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
11  * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
12  *
13  * Sun RPC is provided with no support and without any obligation on the
14  * part of Sun Microsystems, Inc. to assist in its use, correction,
15  * modification or enhancement.
16  *
17  * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
18  * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
19  * OR ANY PART THEREOF.
20  *
21  * In no event will Sun Microsystems, Inc. be liable for any lost revenue
22  * or profits or other special, indirect and consequential damages, even if
23  * Sun has been advised of the possibility of such damages.
24  *
25  * Sun Microsystems, Inc.
26  * 2550 Garcia Avenue
27  * Mountain View, California  94043
28  */
29 
30 /*
31  * Copyright (c) 1991, Sun Microsystems Inc.
32  */
33 
34 /*
35  * This file contains the interfaces that are visible in the SunOS 5.x
36  * implementation of NIS Plus. When using C++ the defined __cplusplus and
37  * __STDC__ should both be true.
38  */
39 
40 #ifndef	_RPCSVC_NISLIB_H
41 #define	_RPCSVC_NISLIB_H
42 
43 /* From: #pragma ident	"@(#)nislib.h	1.16	94/05/03 SMI" */
44 #pragma ident "$Id: nislib.h,v 1.3 1996/09/19 19:37:07 wpaul Exp wpaul $"
45 
46 #ifdef __cplusplus
47 extern "C" {
48 #endif
49 
50 struct signature {
51 	int signature_len;
52 	char *signature_val;
53 };
54 
55 #ifdef __STDC__
56 extern void nis_freeresult(nis_result *);
57 extern nis_result * nis_lookup(nis_name, u_long);
58 extern nis_result * nis_list(nis_name, u_long,
59 	int (*)(nis_name, nis_object *, void *), void *);
60 extern nis_result * nis_add(nis_name, nis_object *);
61 extern nis_result * nis_remove(nis_name, nis_object *);
62 extern nis_result * nis_modify(nis_name, nis_object *);
63 
64 extern nis_result * nis_add_entry(nis_name, nis_object *, u_long);
65 extern nis_result * nis_remove_entry(nis_name, nis_object *, u_long);
66 extern nis_result * nis_modify_entry(nis_name, nis_object *, u_long);
67 extern nis_result * nis_first_entry(nis_name);
68 extern nis_result * nis_next_entry(nis_name, netobj *);
69 
70 extern nis_error nis_mkdir(nis_name, nis_server *);
71 extern nis_error nis_rmdir(nis_name, nis_server *);
72 extern name_pos nis_dir_cmp(nis_name, nis_name);
73 
74 extern nis_name * nis_getnames(nis_name);
75 extern void nis_freenames(nis_name *);
76 extern nis_name nis_domain_of(nis_name);
77 extern nis_name nis_leaf_of(nis_name);
78 extern nis_name nis_leaf_of_r(const nis_name, char *, size_t);
79 extern nis_name nis_name_of(nis_name);
80 extern nis_name nis_local_group(void);
81 extern nis_name nis_local_directory(void);
82 extern nis_name nis_local_principal(void);
83 extern nis_name nis_local_host(void);
84 
85 extern void nis_destroy_object(nis_object *);
86 extern nis_object * nis_clone_object(nis_object *, nis_object *);
87 extern void nis_print_object(nis_object *);
88 
89 extern char * nis_sperrno(nis_error);
90 extern void nis_perror(nis_error, char *);
91 extern char * nis_sperror(nis_error, char *);
92 extern void nis_lerror(nis_error, char *);
93 
94 extern void nis_print_group_entry(nis_name);
95 extern bool_t nis_ismember(nis_name, nis_name);
96 extern nis_error nis_creategroup(nis_name, u_long);
97 extern nis_error nis_destroygroup(nis_name);
98 extern nis_error nis_addmember(nis_name, nis_name);
99 extern nis_error nis_removemember(nis_name, nis_name);
100 extern nis_error nis_verifygroup(nis_name);
101 
102 extern void nis_freeservlist(nis_server **);
103 extern nis_server ** nis_getservlist(nis_name);
104 extern nis_error nis_stats(nis_server *, nis_tag *, int, nis_tag **);
105 extern nis_error nis_servstate(nis_server *, nis_tag *, int, nis_tag **);
106 extern void nis_freetags(nis_tag *, int);
107 
108 extern nis_result * nis_checkpoint(nis_name);
109 extern void nis_ping(nis_name, u_long, nis_object *);
110 
111 /*
112  * XXX: PLEASE NOTE THAT THE FOLLOWING FUNCTIONS ARE INTERNAL
113  * TO NIS+ AND SHOULD NOT BE USED BY ANY APPLICATION PROGRAM.
114  * THEIR SEMANTICS AND/OR SIGNATURE CAN CHANGE WITHOUT NOTICE.
115  * SO, PLEASE DO NOT USE THEM.  YOU ARE WARNED!!!!
116  */
117 
118 extern char ** __break_name(nis_name, int *);
119 extern int __name_distance(char **, char **);
120 extern nis_result * nis_make_error(nis_error, u_long, u_long, u_long, u_long);
121 extern nis_attr * __cvt2attr(int *, char **);
122 extern void nis_free_request(ib_request *);
123 extern nis_error nis_get_request(nis_name, nis_object *, netobj*, ib_request*);
124 extern nis_object * nis_read_obj(char *);
125 extern int nis_write_obj(char *, nis_object *);
126 extern int nis_in_table(nis_name, NIS_HASH_TABLE *, int *);
127 extern int nis_insert_item(NIS_HASH_ITEM *, NIS_HASH_TABLE *);
128 extern NIS_HASH_ITEM * nis_find_item(nis_name, NIS_HASH_TABLE *);
129 extern NIS_HASH_ITEM * nis_remove_item(nis_name, NIS_HASH_TABLE *);
130 extern void nis_insert_name(nis_name, NIS_HASH_TABLE *);
131 extern void nis_remove_name(nis_name, NIS_HASH_TABLE *);
132 extern CLIENT * nis_make_rpchandle(nis_server *, int, u_long, u_long, u_long,
133 								int, int);
134 extern void * nis_get_static_storage(struct nis_sdata *, u_long, u_long);
135 extern char * nis_data(char *);
136 extern void nis_print_rights(u_long);
137 extern void nis_print_directory(directory_obj *);
138 extern void nis_print_group(group_obj *);
139 extern void nis_print_table(table_obj *);
140 extern void nis_print_link(link_obj *);
141 extern void nis_print_entry(entry_obj *);
142 extern nis_object * nis_get_object(char *, char *, char *, u_long, u_long,
143 								    zotypes);
144 extern nis_server * __nis_init_callback(CLIENT *,
145     int (*)(nis_name, nis_object *, void *), void *);
146 extern int nis_getdtblsize(void);
147 extern int __nis_run_callback(netobj *, u_long, struct timeval *, CLIENT *);
148 
149 extern log_result *nis_dumplog(nis_server *, nis_name, u_long);
150 extern log_result *nis_dump(nis_server *, nis_name,
151     int (*)(nis_name, nis_object *, void *));
152 
153 extern bool_t __do_ismember(nis_name, nis_name,
154     nis_result *(*)(nis_name, u_long));
155 extern nis_name __nis_map_group(nis_name);
156 extern nis_name __nis_map_group_r(nis_name, char*, size_t);
157 
158 extern nis_error __nis_CacheBind(char *, directory_obj *);
159 extern nis_error __nis_CacheSearch(char *, directory_obj *);
160 extern bool_t __nis_CacheRemoveEntry(directory_obj *);
161 extern void __nis_CacheRestart(void);
162 extern void __nis_CachePrint(void);
163 extern void __nis_CacheDumpStatistics(void);
164 extern bool_t writeColdStartFile(directory_obj *);
165 
166 extern CLIENT * __get_ti_clnt(char *, CLIENT *, char **, pid_t *);
167 extern int __strcmp_case_insens(char *, char *);
168 extern int __strncmp_case_insens(char *, char *);
169 
170 extern fd_result * nis_finddirectory(directory_obj *, nis_name);
171 extern int __start_clock(int);
172 extern u_long __stop_clock(int);
173 
174 /*
175  * This particular function is part of the FreeBSD NIS+ implementation
176  * only. Ideally it should be somewhere else, but it is used by both
177  * rpc.nisd and nis_cachemgr, and there aren't that many headers common
178  * to both programs.
179  */
180 
181 extern struct signature *__nis_calculate_encrypted_cksum(unsigned char *, unsigned int, char *, int);
182 
183 #else
184 
185 /* Non-prototype definitions (old fashioned C) */
186 
187 extern void nis_freeresult();
188 extern nis_result * nis_lookup();
189 extern nis_result * nis_list();
190 extern nis_result * nis_add();
191 extern nis_result * nis_remove();
192 extern nis_result * nis_modify();
193 
194 extern nis_result * nis_add_entry();
195 extern nis_result * nis_remove_entry();
196 extern nis_result * nis_modify_entry();
197 extern nis_result * nis_first_entry();
198 extern nis_result * nis_next_entry();
199 
200 extern nis_error nis_mkdir();
201 extern nis_error nis_rmdir();
202 extern name_pos nis_dir_cmp();
203 
204 extern nis_name *nis_getnames();
205 extern void nis_freenames();
206 extern nis_name nis_domain_of();
207 extern nis_name nis_leaf_of();
208 extern nis_name nis_leaf_of_r();
209 extern nis_name nis_name_of();
210 extern nis_name nis_local_group();
211 extern nis_name nis_local_directory();
212 extern nis_name nis_local_principal();
213 extern nis_name nis_local_host();
214 
215 extern void nis_destroy_object();
216 extern nis_object * nis_clone_object();
217 extern void nis_print_object();
218 
219 extern char * nis_sperrno();
220 extern void nis_perror();
221 extern char * nis_sperror();
222 extern void nis_lerror();
223 
224 extern void nis_print_group_entry();
225 extern bool_t nis_ismember();
226 extern nis_error nis_creategroup();
227 extern nis_error nis_destroygroup();
228 extern nis_error nis_addmember();
229 extern nis_error nis_removemember();
230 extern nis_error nis_verifygroup();
231 
232 extern void nis_freeservlist();
233 extern nis_server ** nis_getservlist();
234 extern nis_error nis_stats();
235 extern nis_error nis_servstate();
236 extern void nis_freetags();
237 
238 extern nis_result * nis_checkpoint();
239 extern void nis_ping();
240 
241 /*
242  * XXX: PLEASE NOTE THAT THE FOLLOWING FUNCTIONS ARE INTERNAL
243  * TO NIS+ AND SHOULD NOT BE USED BY ANY APPLICATION PROGRAM.
244  * THEIR SEMANTICS AND/OR SIGNATURE CAN CHANGE WITHOUT NOTICE.
245  * SO, PLEASE DO NOT USE THEM.  YOU ARE WARNED!!!!
246  */
247 extern char ** __break_name();
248 extern int __name_distance();
249 extern nis_result * nis_make_error();
250 extern nis_attr * __cvt2attr();
251 extern void nis_free_request();
252 extern nis_error nis_get_request();
253 extern nis_object * nis_read_obj();
254 extern int nis_write_obj();
255 extern int nis_in_table();
256 extern int nis_insert_item();
257 extern NIS_HASH_ITEM * nis_find_item();
258 extern NIS_HASH_ITEM * nis_remove_item();
259 extern void nis_insert_name();
260 extern void nis_remove_name();
261 extern CLIENT * nis_make_rpchandle();
262 extern void * nis_get_static_storage();
263 extern char * nis_data();
264 
265 extern void nis_print_rights();
266 extern void nis_print_directory();
267 extern void nis_print_group();
268 extern void nis_print_table();
269 extern void nis_print_link();
270 extern void nis_print_entry();
271 extern nis_object * nis_get_object();
272 
273 extern nis_server * __nis_init_callback();
274 extern int nis_getdtblsize();
275 extern int __nis_run_callback();
276 
277 extern log_result * nis_dump();
278 extern log_result * nis_dumplog();
279 
280 extern bool_t __do_ismember();
281 extern nis_name __nis_map_group();
282 extern nis_name __nis_map_group_r();
283 
284 
285 extern nis_error __nis_CacheBind();
286 extern directory_obj * __nis_CacheSearch();
287 extern bool_t __nis_CacheRemoveEntry();
288 extern void __nis_CacheRestart();
289 extern void __nis_CachePrint();
290 extern void __nis_CacheDumpStatistics();
291 extern bool_t writeColdStartFile();
292 
293 extern CLIENT * __get_ti_clnt();
294 extern int __strcmp_case_insens();
295 extern int __strncmp_case_insens();
296 
297 extern fd_result * nis_finddirectory();
298 extern int __start_clock();
299 extern u_long __stop_clock();
300 
301 /*
302  * This particular function is part of the FreeBSD NIS+ implementation
303  * only. Ideally it should be somewhere else, but it is used by both
304  * rpc.nisd and nis_cachemgr, and there aren't that many headers common
305  * to both programs.
306  */
307 
308 extern struct signature *__nis_calculate_encrypted_cksum();
309 
310 #endif
311 
312 #define	NUL '\0'
313 
314 #ifdef	__cplusplus
315 }
316 #endif
317 
318 #endif	/* _RPCSVC_NISLIB_H */
319