13b0f7467SBill Paul /* 23b0f7467SBill Paul * Sun RPC is a product of Sun Microsystems, Inc. and is provided for 33b0f7467SBill Paul * unrestricted use provided that this legend is included on all tape 43b0f7467SBill Paul * media and as a part of the software program in whole or part. Users 53b0f7467SBill Paul * may copy or modify Sun RPC without charge, but are not authorized 63b0f7467SBill Paul * to license or distribute it to anyone else except as part of a product or 73b0f7467SBill Paul * program developed by the user. 83b0f7467SBill Paul * 93b0f7467SBill Paul * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE 103b0f7467SBill Paul * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR 113b0f7467SBill Paul * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. 123b0f7467SBill Paul * 133b0f7467SBill Paul * Sun RPC is provided with no support and without any obligation on the 143b0f7467SBill Paul * part of Sun Microsystems, Inc. to assist in its use, correction, 153b0f7467SBill Paul * modification or enhancement. 163b0f7467SBill Paul * 173b0f7467SBill Paul * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE 183b0f7467SBill Paul * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC 193b0f7467SBill Paul * OR ANY PART THEREOF. 203b0f7467SBill Paul * 213b0f7467SBill Paul * In no event will Sun Microsystems, Inc. be liable for any lost revenue 223b0f7467SBill Paul * or profits or other special, indirect and consequential damages, even if 233b0f7467SBill Paul * Sun has been advised of the possibility of such damages. 243b0f7467SBill Paul * 253b0f7467SBill Paul * Sun Microsystems, Inc. 263b0f7467SBill Paul * 2550 Garcia Avenue 273b0f7467SBill Paul * Mountain View, California 94043 283b0f7467SBill Paul */ 293b0f7467SBill Paul 303b0f7467SBill Paul /* 313b0f7467SBill Paul * Copyright (c) 1991, Sun Microsystems Inc. 323b0f7467SBill Paul */ 333b0f7467SBill Paul 343b0f7467SBill Paul /* 353b0f7467SBill Paul * This file contains the interfaces that are visible in the SunOS 5.x 36bb28f3c2SWarner Losh * implementation of NIS Plus. 373b0f7467SBill Paul */ 383b0f7467SBill Paul 393b0f7467SBill Paul #ifndef _RPCSVC_NISLIB_H 403b0f7467SBill Paul #define _RPCSVC_NISLIB_H 413b0f7467SBill Paul 423b0f7467SBill Paul #ifdef __cplusplus 433b0f7467SBill Paul extern "C" { 443b0f7467SBill Paul #endif 453b0f7467SBill Paul 463b0f7467SBill Paul struct signature { 473b0f7467SBill Paul int signature_len; 483b0f7467SBill Paul char *signature_val; 493b0f7467SBill Paul }; 503b0f7467SBill Paul 513b0f7467SBill Paul extern void nis_freeresult(nis_result *); 523b0f7467SBill Paul extern nis_result * nis_lookup(nis_name, u_long); 533b0f7467SBill Paul extern nis_result * nis_list(nis_name, u_long, 543b0f7467SBill Paul int (*)(nis_name, nis_object *, void *), void *); 553b0f7467SBill Paul extern nis_result * nis_add(nis_name, nis_object *); 563b0f7467SBill Paul extern nis_result * nis_remove(nis_name, nis_object *); 573b0f7467SBill Paul extern nis_result * nis_modify(nis_name, nis_object *); 583b0f7467SBill Paul 593b0f7467SBill Paul extern nis_result * nis_add_entry(nis_name, nis_object *, u_long); 603b0f7467SBill Paul extern nis_result * nis_remove_entry(nis_name, nis_object *, u_long); 613b0f7467SBill Paul extern nis_result * nis_modify_entry(nis_name, nis_object *, u_long); 623b0f7467SBill Paul extern nis_result * nis_first_entry(nis_name); 633b0f7467SBill Paul extern nis_result * nis_next_entry(nis_name, netobj *); 643b0f7467SBill Paul 653b0f7467SBill Paul extern nis_error nis_mkdir(nis_name, nis_server *); 663b0f7467SBill Paul extern nis_error nis_rmdir(nis_name, nis_server *); 673b0f7467SBill Paul extern name_pos nis_dir_cmp(nis_name, nis_name); 683b0f7467SBill Paul 693b0f7467SBill Paul extern nis_name * nis_getnames(nis_name); 703b0f7467SBill Paul extern void nis_freenames(nis_name *); 713b0f7467SBill Paul extern nis_name nis_domain_of(nis_name); 723b0f7467SBill Paul extern nis_name nis_leaf_of(nis_name); 733b0f7467SBill Paul extern nis_name nis_leaf_of_r(const nis_name, char *, size_t); 743b0f7467SBill Paul extern nis_name nis_name_of(nis_name); 753b0f7467SBill Paul extern nis_name nis_local_group(void); 763b0f7467SBill Paul extern nis_name nis_local_directory(void); 773b0f7467SBill Paul extern nis_name nis_local_principal(void); 783b0f7467SBill Paul extern nis_name nis_local_host(void); 793b0f7467SBill Paul 803b0f7467SBill Paul extern void nis_destroy_object(nis_object *); 813b0f7467SBill Paul extern nis_object * nis_clone_object(nis_object *, nis_object *); 823b0f7467SBill Paul extern void nis_print_object(nis_object *); 833b0f7467SBill Paul 843b0f7467SBill Paul extern char * nis_sperrno(nis_error); 853b0f7467SBill Paul extern void nis_perror(nis_error, char *); 863b0f7467SBill Paul extern char * nis_sperror(nis_error, char *); 873b0f7467SBill Paul extern void nis_lerror(nis_error, char *); 883b0f7467SBill Paul 893b0f7467SBill Paul extern void nis_print_group_entry(nis_name); 903b0f7467SBill Paul extern bool_t nis_ismember(nis_name, nis_name); 913b0f7467SBill Paul extern nis_error nis_creategroup(nis_name, u_long); 923b0f7467SBill Paul extern nis_error nis_destroygroup(nis_name); 933b0f7467SBill Paul extern nis_error nis_addmember(nis_name, nis_name); 943b0f7467SBill Paul extern nis_error nis_removemember(nis_name, nis_name); 953b0f7467SBill Paul extern nis_error nis_verifygroup(nis_name); 963b0f7467SBill Paul 973b0f7467SBill Paul extern void nis_freeservlist(nis_server **); 983b0f7467SBill Paul extern nis_server ** nis_getservlist(nis_name); 993b0f7467SBill Paul extern nis_error nis_stats(nis_server *, nis_tag *, int, nis_tag **); 1003b0f7467SBill Paul extern nis_error nis_servstate(nis_server *, nis_tag *, int, nis_tag **); 1013b0f7467SBill Paul extern void nis_freetags(nis_tag *, int); 1023b0f7467SBill Paul 1033b0f7467SBill Paul extern nis_result * nis_checkpoint(nis_name); 1043b0f7467SBill Paul extern void nis_ping(nis_name, u_long, nis_object *); 1053b0f7467SBill Paul 1063b0f7467SBill Paul /* 1073b0f7467SBill Paul * XXX: PLEASE NOTE THAT THE FOLLOWING FUNCTIONS ARE INTERNAL 1083b0f7467SBill Paul * TO NIS+ AND SHOULD NOT BE USED BY ANY APPLICATION PROGRAM. 1093b0f7467SBill Paul * THEIR SEMANTICS AND/OR SIGNATURE CAN CHANGE WITHOUT NOTICE. 1103b0f7467SBill Paul * SO, PLEASE DO NOT USE THEM. YOU ARE WARNED!!!! 1113b0f7467SBill Paul */ 1123b0f7467SBill Paul 1133b0f7467SBill Paul extern char ** __break_name(nis_name, int *); 1143b0f7467SBill Paul extern int __name_distance(char **, char **); 1153b0f7467SBill Paul extern nis_result * nis_make_error(nis_error, u_long, u_long, u_long, u_long); 1163b0f7467SBill Paul extern nis_attr * __cvt2attr(int *, char **); 1173b0f7467SBill Paul extern void nis_free_request(ib_request *); 1183b0f7467SBill Paul extern nis_error nis_get_request(nis_name, nis_object *, netobj*, ib_request*); 1193b0f7467SBill Paul extern nis_object * nis_read_obj(char *); 1203b0f7467SBill Paul extern int nis_write_obj(char *, nis_object *); 1213b0f7467SBill Paul extern int nis_in_table(nis_name, NIS_HASH_TABLE *, int *); 1223b0f7467SBill Paul extern int nis_insert_item(NIS_HASH_ITEM *, NIS_HASH_TABLE *); 1233b0f7467SBill Paul extern NIS_HASH_ITEM * nis_find_item(nis_name, NIS_HASH_TABLE *); 1243b0f7467SBill Paul extern NIS_HASH_ITEM * nis_remove_item(nis_name, NIS_HASH_TABLE *); 1253b0f7467SBill Paul extern void nis_insert_name(nis_name, NIS_HASH_TABLE *); 1263b0f7467SBill Paul extern void nis_remove_name(nis_name, NIS_HASH_TABLE *); 1273b0f7467SBill Paul extern CLIENT * nis_make_rpchandle(nis_server *, int, u_long, u_long, u_long, 1283b0f7467SBill Paul int, int); 1293b0f7467SBill Paul extern void * nis_get_static_storage(struct nis_sdata *, u_long, u_long); 1303b0f7467SBill Paul extern char * nis_data(char *); 1313b0f7467SBill Paul extern void nis_print_rights(u_long); 1323b0f7467SBill Paul extern void nis_print_directory(directory_obj *); 1333b0f7467SBill Paul extern void nis_print_group(group_obj *); 1343b0f7467SBill Paul extern void nis_print_table(table_obj *); 1353b0f7467SBill Paul extern void nis_print_link(link_obj *); 1363b0f7467SBill Paul extern void nis_print_entry(entry_obj *); 1373b0f7467SBill Paul extern nis_object * nis_get_object(char *, char *, char *, u_long, u_long, 1383b0f7467SBill Paul zotypes); 1393b0f7467SBill Paul extern nis_server * __nis_init_callback(CLIENT *, 1403b0f7467SBill Paul int (*)(nis_name, nis_object *, void *), void *); 1413b0f7467SBill Paul extern int nis_getdtblsize(void); 1423b0f7467SBill Paul extern int __nis_run_callback(netobj *, u_long, struct timeval *, CLIENT *); 1433b0f7467SBill Paul 1443b0f7467SBill Paul extern log_result *nis_dumplog(nis_server *, nis_name, u_long); 1453b0f7467SBill Paul extern log_result *nis_dump(nis_server *, nis_name, 1463b0f7467SBill Paul int (*)(nis_name, nis_object *, void *)); 1473b0f7467SBill Paul 1483b0f7467SBill Paul extern bool_t __do_ismember(nis_name, nis_name, 1493b0f7467SBill Paul nis_result *(*)(nis_name, u_long)); 1503b0f7467SBill Paul extern nis_name __nis_map_group(nis_name); 1513b0f7467SBill Paul extern nis_name __nis_map_group_r(nis_name, char*, size_t); 1523b0f7467SBill Paul 1533b0f7467SBill Paul extern nis_error __nis_CacheBind(char *, directory_obj *); 1543b0f7467SBill Paul extern nis_error __nis_CacheSearch(char *, directory_obj *); 1553b0f7467SBill Paul extern bool_t __nis_CacheRemoveEntry(directory_obj *); 1563b0f7467SBill Paul extern void __nis_CacheRestart(void); 1573b0f7467SBill Paul extern void __nis_CachePrint(void); 1583b0f7467SBill Paul extern void __nis_CacheDumpStatistics(void); 1593b0f7467SBill Paul extern bool_t writeColdStartFile(directory_obj *); 1603b0f7467SBill Paul 1613b0f7467SBill Paul extern CLIENT * __get_ti_clnt(char *, CLIENT *, char **, pid_t *); 1623b0f7467SBill Paul extern int __strcmp_case_insens(char *, char *); 1633b0f7467SBill Paul extern int __strncmp_case_insens(char *, char *); 1643b0f7467SBill Paul 1653b0f7467SBill Paul extern fd_result * nis_finddirectory(directory_obj *, nis_name); 1663b0f7467SBill Paul extern int __start_clock(int); 1673b0f7467SBill Paul extern u_long __stop_clock(int); 1683b0f7467SBill Paul 1693b0f7467SBill Paul /* 1703b0f7467SBill Paul * This particular function is part of the FreeBSD NIS+ implementation 1713b0f7467SBill Paul * only. Ideally it should be somewhere else, but it is used by both 1723b0f7467SBill Paul * rpc.nisd and nis_cachemgr, and there aren't that many headers common 1733b0f7467SBill Paul * to both programs. 1743b0f7467SBill Paul */ 1753b0f7467SBill Paul 1763b0f7467SBill Paul extern struct signature *__nis_calculate_encrypted_cksum(unsigned char *, unsigned int, char *, int); 1773b0f7467SBill Paul 1783b0f7467SBill Paul #define NUL '\0' 1793b0f7467SBill Paul 1803b0f7467SBill Paul #ifdef __cplusplus 1813b0f7467SBill Paul } 1823b0f7467SBill Paul #endif 1833b0f7467SBill Paul 1843b0f7467SBill Paul #endif /* _RPCSVC_NISLIB_H */ 185