126206Swpaul/* 226206Swpaul * Sun RPC is a product of Sun Microsystems, Inc. and is provided for 326206Swpaul * unrestricted use provided that this legend is included on all tape 426206Swpaul * media and as a part of the software program in whole or part. Users 526206Swpaul * may copy or modify Sun RPC without charge, but are not authorized 626206Swpaul * to license or distribute it to anyone else except as part of a product or 726206Swpaul * program developed by the user. 826206Swpaul * 926206Swpaul * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE 1026206Swpaul * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR 1126206Swpaul * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. 1226206Swpaul * 1326206Swpaul * Sun RPC is provided with no support and without any obligation on the 1426206Swpaul * part of Sun Microsystems, Inc. to assist in its use, correction, 1526206Swpaul * modification or enhancement. 1626206Swpaul * 1726206Swpaul * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE 1826206Swpaul * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC 1926206Swpaul * OR ANY PART THEREOF. 2026206Swpaul * 2126206Swpaul * In no event will Sun Microsystems, Inc. be liable for any lost revenue 2226206Swpaul * or profits or other special, indirect and consequential damages, even if 2326206Swpaul * Sun has been advised of the possibility of such damages. 2426206Swpaul * 2526206Swpaul * Sun Microsystems, Inc. 2626206Swpaul * 2550 Garcia Avenue 2726206Swpaul * Mountain View, California 94043 2893032Simp * 2993032Simp * $FreeBSD$ 3026206Swpaul */ 3126206Swpaul 3226206Swpaul/* 3326206Swpaul * Copyright (c) 1991, Sun Microsystems Inc. 3426206Swpaul */ 3526206Swpaul 3626206Swpaul/* 3726206Swpaul * This file contains the interfaces that are visible in the SunOS 5.x 3893032Simp * implementation of NIS Plus. 3926206Swpaul */ 4026206Swpaul 4126206Swpaul#ifndef _RPCSVC_NISLIB_H 4226206Swpaul#define _RPCSVC_NISLIB_H 4326206Swpaul 4426206Swpaul/* From: #pragma ident "@(#)nislib.h 1.16 94/05/03 SMI" */ 4526206Swpaul 4626206Swpaul#ifdef __cplusplus 4726206Swpaulextern "C" { 4826206Swpaul#endif 4926206Swpaul 5026206Swpaulstruct signature { 5126206Swpaul int signature_len; 5226206Swpaul char *signature_val; 5326206Swpaul}; 5426206Swpaul 5526206Swpaulextern void nis_freeresult(nis_result *); 5626206Swpaulextern nis_result * nis_lookup(nis_name, u_long); 5726206Swpaulextern nis_result * nis_list(nis_name, u_long, 5826206Swpaul int (*)(nis_name, nis_object *, void *), void *); 5926206Swpaulextern nis_result * nis_add(nis_name, nis_object *); 6026206Swpaulextern nis_result * nis_remove(nis_name, nis_object *); 6126206Swpaulextern nis_result * nis_modify(nis_name, nis_object *); 6226206Swpaul 6326206Swpaulextern nis_result * nis_add_entry(nis_name, nis_object *, u_long); 6426206Swpaulextern nis_result * nis_remove_entry(nis_name, nis_object *, u_long); 6526206Swpaulextern nis_result * nis_modify_entry(nis_name, nis_object *, u_long); 6626206Swpaulextern nis_result * nis_first_entry(nis_name); 6726206Swpaulextern nis_result * nis_next_entry(nis_name, netobj *); 6826206Swpaul 6926206Swpaulextern nis_error nis_mkdir(nis_name, nis_server *); 7026206Swpaulextern nis_error nis_rmdir(nis_name, nis_server *); 7126206Swpaulextern name_pos nis_dir_cmp(nis_name, nis_name); 7226206Swpaul 7326206Swpaulextern nis_name * nis_getnames(nis_name); 7426206Swpaulextern void nis_freenames(nis_name *); 7526206Swpaulextern nis_name nis_domain_of(nis_name); 7626206Swpaulextern nis_name nis_leaf_of(nis_name); 7726206Swpaulextern nis_name nis_leaf_of_r(const nis_name, char *, size_t); 7826206Swpaulextern nis_name nis_name_of(nis_name); 7926206Swpaulextern nis_name nis_local_group(void); 8026206Swpaulextern nis_name nis_local_directory(void); 8126206Swpaulextern nis_name nis_local_principal(void); 8226206Swpaulextern nis_name nis_local_host(void); 8326206Swpaul 8426206Swpaulextern void nis_destroy_object(nis_object *); 8526206Swpaulextern nis_object * nis_clone_object(nis_object *, nis_object *); 8626206Swpaulextern void nis_print_object(nis_object *); 8726206Swpaul 8826206Swpaulextern char * nis_sperrno(nis_error); 8926206Swpaulextern void nis_perror(nis_error, char *); 9026206Swpaulextern char * nis_sperror(nis_error, char *); 9126206Swpaulextern void nis_lerror(nis_error, char *); 9226206Swpaul 9326206Swpaulextern void nis_print_group_entry(nis_name); 9426206Swpaulextern bool_t nis_ismember(nis_name, nis_name); 9526206Swpaulextern nis_error nis_creategroup(nis_name, u_long); 9626206Swpaulextern nis_error nis_destroygroup(nis_name); 9726206Swpaulextern nis_error nis_addmember(nis_name, nis_name); 9826206Swpaulextern nis_error nis_removemember(nis_name, nis_name); 9926206Swpaulextern nis_error nis_verifygroup(nis_name); 10026206Swpaul 10126206Swpaulextern void nis_freeservlist(nis_server **); 10226206Swpaulextern nis_server ** nis_getservlist(nis_name); 10326206Swpaulextern nis_error nis_stats(nis_server *, nis_tag *, int, nis_tag **); 10426206Swpaulextern nis_error nis_servstate(nis_server *, nis_tag *, int, nis_tag **); 10526206Swpaulextern void nis_freetags(nis_tag *, int); 10626206Swpaul 10726206Swpaulextern nis_result * nis_checkpoint(nis_name); 10826206Swpaulextern void nis_ping(nis_name, u_long, nis_object *); 10926206Swpaul 11026206Swpaul/* 11126206Swpaul * XXX: PLEASE NOTE THAT THE FOLLOWING FUNCTIONS ARE INTERNAL 11226206Swpaul * TO NIS+ AND SHOULD NOT BE USED BY ANY APPLICATION PROGRAM. 11326206Swpaul * THEIR SEMANTICS AND/OR SIGNATURE CAN CHANGE WITHOUT NOTICE. 11426206Swpaul * SO, PLEASE DO NOT USE THEM. YOU ARE WARNED!!!! 11526206Swpaul */ 11626206Swpaul 11726206Swpaulextern char ** __break_name(nis_name, int *); 11826206Swpaulextern int __name_distance(char **, char **); 11926206Swpaulextern nis_result * nis_make_error(nis_error, u_long, u_long, u_long, u_long); 12026206Swpaulextern nis_attr * __cvt2attr(int *, char **); 12126206Swpaulextern void nis_free_request(ib_request *); 12226206Swpaulextern nis_error nis_get_request(nis_name, nis_object *, netobj*, ib_request*); 12326206Swpaulextern nis_object * nis_read_obj(char *); 12426206Swpaulextern int nis_write_obj(char *, nis_object *); 12526206Swpaulextern int nis_in_table(nis_name, NIS_HASH_TABLE *, int *); 12626206Swpaulextern int nis_insert_item(NIS_HASH_ITEM *, NIS_HASH_TABLE *); 12726206Swpaulextern NIS_HASH_ITEM * nis_find_item(nis_name, NIS_HASH_TABLE *); 12826206Swpaulextern NIS_HASH_ITEM * nis_remove_item(nis_name, NIS_HASH_TABLE *); 12926206Swpaulextern void nis_insert_name(nis_name, NIS_HASH_TABLE *); 13026206Swpaulextern void nis_remove_name(nis_name, NIS_HASH_TABLE *); 13126206Swpaulextern CLIENT * nis_make_rpchandle(nis_server *, int, u_long, u_long, u_long, 13226206Swpaul int, int); 13326206Swpaulextern void * nis_get_static_storage(struct nis_sdata *, u_long, u_long); 13426206Swpaulextern char * nis_data(char *); 13526206Swpaulextern void nis_print_rights(u_long); 13626206Swpaulextern void nis_print_directory(directory_obj *); 13726206Swpaulextern void nis_print_group(group_obj *); 13826206Swpaulextern void nis_print_table(table_obj *); 13926206Swpaulextern void nis_print_link(link_obj *); 14026206Swpaulextern void nis_print_entry(entry_obj *); 14126206Swpaulextern nis_object * nis_get_object(char *, char *, char *, u_long, u_long, 14226206Swpaul zotypes); 14326206Swpaulextern nis_server * __nis_init_callback(CLIENT *, 14426206Swpaul int (*)(nis_name, nis_object *, void *), void *); 14526206Swpaulextern int nis_getdtblsize(void); 14626206Swpaulextern int __nis_run_callback(netobj *, u_long, struct timeval *, CLIENT *); 14726206Swpaul 14826206Swpaulextern log_result *nis_dumplog(nis_server *, nis_name, u_long); 14926206Swpaulextern log_result *nis_dump(nis_server *, nis_name, 15026206Swpaul int (*)(nis_name, nis_object *, void *)); 15126206Swpaul 15226206Swpaulextern bool_t __do_ismember(nis_name, nis_name, 15326206Swpaul nis_result *(*)(nis_name, u_long)); 15426206Swpaulextern nis_name __nis_map_group(nis_name); 15526206Swpaulextern nis_name __nis_map_group_r(nis_name, char*, size_t); 15626206Swpaul 15726206Swpaulextern nis_error __nis_CacheBind(char *, directory_obj *); 15826206Swpaulextern nis_error __nis_CacheSearch(char *, directory_obj *); 15926206Swpaulextern bool_t __nis_CacheRemoveEntry(directory_obj *); 16026206Swpaulextern void __nis_CacheRestart(void); 16126206Swpaulextern void __nis_CachePrint(void); 16226206Swpaulextern void __nis_CacheDumpStatistics(void); 16326206Swpaulextern bool_t writeColdStartFile(directory_obj *); 16426206Swpaul 16526206Swpaulextern CLIENT * __get_ti_clnt(char *, CLIENT *, char **, pid_t *); 16626206Swpaulextern int __strcmp_case_insens(char *, char *); 16726206Swpaulextern int __strncmp_case_insens(char *, char *); 16826206Swpaul 16926206Swpaulextern fd_result * nis_finddirectory(directory_obj *, nis_name); 17026206Swpaulextern int __start_clock(int); 17126206Swpaulextern u_long __stop_clock(int); 17226206Swpaul 17326206Swpaul/* 17426206Swpaul * This particular function is part of the FreeBSD NIS+ implementation 17526206Swpaul * only. Ideally it should be somewhere else, but it is used by both 17626206Swpaul * rpc.nisd and nis_cachemgr, and there aren't that many headers common 17726206Swpaul * to both programs. 17826206Swpaul */ 17926206Swpaul 18026206Swpaulextern struct signature *__nis_calculate_encrypted_cksum(unsigned char *, unsigned int, char *, int); 18126206Swpaul 18226206Swpaul#define NUL '\0' 18326206Swpaul 18426206Swpaul#ifdef __cplusplus 18526206Swpaul} 18626206Swpaul#endif 18726206Swpaul 18826206Swpaul#endif /* _RPCSVC_NISLIB_H */ 189