| 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 | * $FreeBSD: src/include/rpcsvc/nislib.h,v 1.4 2002/03/23 17:24:55 imp Exp $ |
| 30 | * $DragonFly: src/include/rpcsvc/nislib.h,v 1.2 2004/02/25 15:12:54 joerg Exp $ |
| 31 | */ |
| 32 | |
| 33 | /* |
| 34 | * Copyright (c) 1991, Sun Microsystems Inc. |
| 35 | */ |
| 36 | |
| 37 | /* |
| 38 | * This file contains the interfaces that are visible in the SunOS 5.x |
| 39 | * implementation of NIS Plus. |
| 40 | */ |
| 41 | |
| 42 | #ifndef _RPCSVC_NISLIB_H |
| 43 | #define _RPCSVC_NISLIB_H |
| 44 | |
| 45 | /* From: #pragma ident "@(#)nislib.h 1.16 94/05/03 SMI" */ |
| 46 | |
| 47 | #include <sys/cdefs.h> |
| 48 | |
| 49 | #define NUL '\0' |
| 50 | |
| 51 | struct signature { |
| 52 | int signature_len; |
| 53 | char *signature_val; |
| 54 | }; |
| 55 | |
| 56 | __BEGIN_DECLS |
| 57 | |
| 58 | void nis_freeresult(nis_result *); |
| 59 | nis_result *nis_lookup(nis_name, u_long); |
| 60 | nis_result *nis_list(nis_name, u_long, |
| 61 | int (*)(nis_name, nis_object *, void *), void *); |
| 62 | nis_result *nis_add(nis_name, nis_object *); |
| 63 | nis_result *nis_remove(nis_name, nis_object *); |
| 64 | nis_result *nis_modify(nis_name, nis_object *); |
| 65 | |
| 66 | nis_result *nis_add_entry(nis_name, nis_object *, u_long); |
| 67 | nis_result *nis_remove_entry(nis_name, nis_object *, u_long); |
| 68 | nis_result *nis_modify_entry(nis_name, nis_object *, u_long); |
| 69 | nis_result *nis_first_entry(nis_name); |
| 70 | nis_result *nis_next_entry(nis_name, netobj *); |
| 71 | |
| 72 | nis_error nis_mkdir(nis_name, nis_server *); |
| 73 | nis_error nis_rmdir(nis_name, nis_server *); |
| 74 | name_pos nis_dir_cmp(nis_name, nis_name); |
| 75 | |
| 76 | nis_name *nis_getnames(nis_name); |
| 77 | void nis_freenames(nis_name *); |
| 78 | nis_name nis_domain_of(nis_name); |
| 79 | nis_name nis_leaf_of(nis_name); |
| 80 | nis_name nis_leaf_of_r(const nis_name, char *, size_t); |
| 81 | nis_name nis_name_of(nis_name); |
| 82 | nis_name nis_local_group(void); |
| 83 | nis_name nis_local_directory(void); |
| 84 | nis_name nis_local_principal(void); |
| 85 | nis_name nis_local_host(void); |
| 86 | |
| 87 | void nis_destroy_object(nis_object *); |
| 88 | nis_object *nis_clone_object(nis_object *, nis_object *); |
| 89 | void nis_print_object(nis_object *); |
| 90 | |
| 91 | char *nis_sperrno(nis_error); |
| 92 | void nis_perror(nis_error, char *); |
| 93 | char *nis_sperror(nis_error, char *); |
| 94 | void nis_lerror(nis_error, char *); |
| 95 | |
| 96 | void nis_print_group_entry(nis_name); |
| 97 | bool_t nis_ismember(nis_name, nis_name); |
| 98 | nis_error nis_creategroup(nis_name, u_long); |
| 99 | nis_error nis_destroygroup(nis_name); |
| 100 | nis_error nis_addmember(nis_name, nis_name); |
| 101 | nis_error nis_removemember(nis_name, nis_name); |
| 102 | nis_error nis_verifygroup(nis_name); |
| 103 | |
| 104 | void nis_freeservlist(nis_server **); |
| 105 | nis_server * *nis_getservlist(nis_name); |
| 106 | nis_error nis_stats(nis_server *, nis_tag *, int, nis_tag **); |
| 107 | nis_error nis_servstate(nis_server *, nis_tag *, int, nis_tag **); |
| 108 | void nis_freetags(nis_tag *, int); |
| 109 | |
| 110 | nis_result *nis_checkpoint(nis_name); |
| 111 | void nis_ping(nis_name, u_long, nis_object *); |
| 112 | |
| 113 | /* |
| 114 | * XXX: PLEASE NOTE THAT THE FOLLOWING FUNCTIONS ARE INTERNAL |
| 115 | * TO NIS+ AND SHOULD NOT BE USED BY ANY APPLICATION PROGRAM. |
| 116 | * THEIR SEMANTICS AND/OR SIGNATURE CAN CHANGE WITHOUT NOTICE. |
| 117 | * SO, PLEASE DO NOT USE THEM. YOU ARE WARNED!!!! |
| 118 | */ |
| 119 | |
| 120 | char **__break_name(nis_name, int *); |
| 121 | int __name_distance(char **, char **); |
| 122 | nis_result *nis_make_error(nis_error, u_long, u_long, u_long, u_long); |
| 123 | nis_attr *__cvt2attr(int *, char **); |
| 124 | void nis_free_request(ib_request *); |
| 125 | nis_error nis_get_request(nis_name, nis_object *, netobj*, ib_request*); |
| 126 | nis_object *nis_read_obj(char *); |
| 127 | int nis_write_obj(char *, nis_object *); |
| 128 | int nis_in_table(nis_name, NIS_HASH_TABLE *, int *); |
| 129 | int nis_insert_item(NIS_HASH_ITEM *, NIS_HASH_TABLE *); |
| 130 | NIS_HASH_ITEM *nis_find_item(nis_name, NIS_HASH_TABLE *); |
| 131 | NIS_HASH_ITEM *nis_remove_item(nis_name, NIS_HASH_TABLE *); |
| 132 | void nis_insert_name(nis_name, NIS_HASH_TABLE *); |
| 133 | void nis_remove_name(nis_name, NIS_HASH_TABLE *); |
| 134 | CLIENT *nis_make_rpchandle(nis_server *, int, u_long, u_long, u_long, |
| 135 | int, int); |
| 136 | void *nis_get_static_storage(struct nis_sdata *, u_long, u_long); |
| 137 | char *nis_data(char *); |
| 138 | void nis_print_rights(u_long); |
| 139 | void nis_print_directory(directory_obj *); |
| 140 | void nis_print_group(group_obj *); |
| 141 | void nis_print_table(table_obj *); |
| 142 | void nis_print_link(link_obj *); |
| 143 | void nis_print_entry(entry_obj *); |
| 144 | nis_object *nis_get_object(char *, char *, char *, u_long, u_long, |
| 145 | zotypes); |
| 146 | nis_server *__nis_init_callback(CLIENT *, |
| 147 | int (*)(nis_name, nis_object *, void *), void *); |
| 148 | int nis_getdtblsize(void); |
| 149 | int __nis_run_callback(netobj *, u_long, struct timeval *, CLIENT *); |
| 150 | |
| 151 | log_result *nis_dumplog(nis_server *, nis_name, u_long); |
| 152 | log_result *nis_dump(nis_server *, nis_name, |
| 153 | int (*)(nis_name, nis_object *, void *)); |
| 154 | |
| 155 | bool_t __do_ismember(nis_name, nis_name, |
| 156 | nis_result *(*)(nis_name, u_long)); |
| 157 | nis_name __nis_map_group(nis_name); |
| 158 | nis_name __nis_map_group_r(nis_name, char*, size_t); |
| 159 | |
| 160 | nis_error __nis_CacheBind(char *, directory_obj *); |
| 161 | nis_error __nis_CacheSearch(char *, directory_obj *); |
| 162 | bool_t __nis_CacheRemoveEntry(directory_obj *); |
| 163 | void __nis_CacheRestart(void); |
| 164 | void __nis_CachePrint(void); |
| 165 | void __nis_CacheDumpStatistics(void); |
| 166 | bool_t writeColdStartFile(directory_obj *); |
| 167 | |
| 168 | CLIENT *__get_ti_clnt(char *, CLIENT *, char **, pid_t *); |
| 169 | int __strcmp_case_insens(char *, char *); |
| 170 | int __strncmp_case_insens(char *, char *); |
| 171 | |
| 172 | fd_result *nis_finddirectory(directory_obj *, nis_name); |
| 173 | int __start_clock(int); |
| 174 | u_long __stop_clock(int); |
| 175 | |
| 176 | /* |
| 177 | * This particular function is part of the FreeBSD NIS+ implementation |
| 178 | * only. Ideally it should be somewhere else, but it is used by both |
| 179 | * rpc.nisd and nis_cachemgr, and there aren't that many headers common |
| 180 | * to both programs. |
| 181 | */ |
| 182 | |
| 183 | struct signature *__nis_calculate_encrypted_cksum(unsigned char *, |
| 184 | unsigned int, char *, int); |
| 185 | |
| 186 | __END_DECLS |
| 187 | |
| 188 | #endif /* _RPCSVC_NISLIB_H */ |