The C and C++ Include Header Files
/usr/include/rpcsvc/nislib.h
$ cat -n /usr/include/rpcsvc/nislib.h 1 /* Copyright (C) 1997-2015 Free Software Foundation, Inc. 2 This file is part of the GNU C Library. 3 Contributed by Thorsten Kukuk
, 1997. 4 5 The GNU C Library is free software; you can redistribute it and/or 6 modify it under the terms of the GNU Lesser General Public 7 License as published by the Free Software Foundation; either 8 version 2.1 of the License, or (at your option) any later version. 9 10 The GNU C Library is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 Lesser General Public License for more details. 14 15 You should have received a copy of the GNU Lesser General Public 16 License along with the GNU C Library; if not, see 17
. */ 18 19 #ifndef __RPCSVC_NISLIB_H__ 20 #define __RPCSVC_NISLIB_H__ 21 22 #ifdef __cplusplus 23 extern "C" { 24 #endif 25 26 typedef const char *const_nis_name; 27 28 /* nis_names: These functions are used to locate and manipulate all NIS+ 29 * objects except the NIS+ entry objects. 30 * 31 * nis_lookup (name, flags) resolves a NIS+ name and returns a copy of 32 * that object from a NIS+ server. 33 * const nis_name name: name of the object to be resolved 34 * unsigned int flags: logically ORing zero or more flags (FOLLOW_LINKS, 35 * HARD_LOOKUP, [NO_CACHE], MASTER_ONLY, EXPAND_NAME) 36 * 37 * nis_add (name, obj) adds objects to the NIS+ namespace. 38 * const nis_name name: fully qualified NIS+ name. 39 * const nis_object *obj: object members zo_name and zo_domain will be 40 * constructed from name. 41 * 42 * nis_remove (name, obj) removes objects from the NIS+ namespace. 43 * const nis_name name: fully qualified NIS+ name. 44 * const nis_object *obj: if not NULL, it is assumed to point to a copy 45 * of the object being removed. In this case, if 46 * the object on the server does not have the same 47 * object identifier as the object being passed, 48 * the operation will fail with the NIS_NOTSAMEOBJ 49 * error. 50 * 51 * nis_modify (name, obj) can change specific attributes of an object 52 * that already exists in the namespace. 53 */ 54 extern nis_result *nis_lookup (const_nis_name name, unsigned int flags) 55 ; 56 extern nis_result *nis_add (const_nis_name name, const nis_object *obj) 57 ; 58 extern nis_result *nis_remove (const_nis_name name, 59 const nis_object *obj); 60 extern nis_result *nis_modify (const_nis_name name, 61 const nis_object *obj); 62 63 /* nis_tables: These functions are used to search and modify NIS+ tables. 64 * 65 * nis_list (table_name, flags, callback(table_name, obj, userdata), userdata) 66 * search a table in the NIS+ namespace. 67 * const nis_name table_name: indexed name ([xx=yy],table.dir) 68 * unsigned int flags: logically ORing one or more flags (FOLLOW_LINKS, 69 * [FOLLOW_PATH], HARD_LOOKUP, [ALL_RESULTS], [NO_CACHE], 70 * MASTER_ONLY, EXPAND_NAME, RETURN_RESULT) 71 * callback(): callback is an optional pointer to a function that will 72 * process the ENTRY type objects that are returned from the 73 * search. If this pointer is NULL, then all entries that match 74 * the search criteria are returned in the nis_result structure, 75 * otherwise this function will be called once for each 76 * entry returned. 77 * void *userdata: passed to callback function along with the returned 78 * entry object. 79 * 80 * nis_add_entry (table_name, obj, flags) will add the NIS+ object to the 81 * NIS+ table_name. 82 * const nis_name table_name 83 * const nis_object *obj 84 * unsigned int flags: 0, ADD_OVERWRITE, RETURN_RESULT 85 * 86 * nis_modify_entry (name, obj, flags) modifies an object identified by name. 87 * const nis_name name: object identifier 88 * const nis_object *obj: should point to an entry with the EN_MODIFIED 89 * flag set in each column that contains new 90 * information. 91 * unsigned int flags: 0, MOD_SAMEOBJ, RETURN_RESULT 92 * 93 * nis_remove_entry (table_name, obj, flags) removes a set of entries 94 * identified by table_name from the table. 95 * const nis_name table_name: indexed NIS+ name 96 * const nis_object *obj: if obj is non-null, it is presumed to point to 97 * a cached copy of the entry. When the removal is 98 * attempted, and the object that would be removed 99 * is not the same as the cached object pointed to 100 * by object then the operation will fail with an 101 * NIS_NOTSAMEOBJ error 102 * unsigned int flags: 0, REM_MULTIPLE 103 * 104 * nis_first_entry (table_name) fetches entries from a table one at a time. 105 * const nis_name table_name 106 * 107 * nis_next_entry (table_name, cookie) retrieves the "next" entry from a 108 * table specified by table_name. 109 * const nis_name table_name: 110 * const netobj *cookie: The value of cookie from the nis_result structure 111 * form the previous call. 112 */ 113 extern nis_result *nis_list (const_nis_name __name, unsigned int __flags, 114 int (*__callback)(const_nis_name __table_name, 115 const nis_object *__obj, 116 const void *__userdata), 117 const void *__userdata); 118 extern nis_result *nis_add_entry (const_nis_name __table_name, 119 const nis_object *__obj, 120 unsigned int __flags); 121 extern nis_result *nis_modify_entry (const_nis_name __name, 122 const nis_object *__obj, 123 unsigned int __flags); 124 extern nis_result *nis_remove_entry (const_nis_name __table_name, 125 const nis_object *__obj, 126 unsigned int __flags); 127 extern nis_result *nis_first_entry (const_nis_name __table_name); 128 extern nis_result *nis_next_entry (const_nis_name __table_name, 129 const netobj *__cookie); 130 /* 131 ** nis_server 132 */ 133 extern nis_error nis_mkdir (const_nis_name __dirname, 134 const nis_server *__machine); 135 extern nis_error nis_rmdir (const_nis_name __dirname, 136 const nis_server *__machine); 137 extern nis_error nis_servstate (const nis_server *__machine, 138 const nis_tag *__tags, int __numtags, 139 nis_tag **__result); 140 extern nis_error nis_stats (const nis_server *__machine, 141 const nis_tag *__tags, int __numtags, 142 nis_tag **__result); 143 extern void nis_freetags (nis_tag *__tags, int __numtags); 144 extern nis_server **nis_getservlist (const_nis_name __dirname); 145 extern void nis_freeservlist (nis_server **__machines); 146 147 /* 148 ** nis_subr 149 */ 150 extern nis_name nis_leaf_of (const_nis_name __name); 151 extern nis_name nis_leaf_of_r (const_nis_name __name, char *__buffer, 152 size_t __buflen); 153 extern nis_name nis_name_of (const_nis_name __name); 154 extern nis_name nis_name_of_r (const_nis_name __name, char *__buffer, 155 size_t __buflen); 156 extern nis_name nis_domain_of (const_nis_name __name); 157 extern nis_name nis_domain_of_r (const_nis_name __name, char *__buffer, 158 size_t __buflen); 159 extern nis_name *nis_getnames (const_nis_name __name); 160 extern void nis_freenames (nis_name *__namelist); 161 extern name_pos nis_dir_cmp (const_nis_name __n1, const_nis_name __n2); 162 extern nis_object *nis_clone_object (const nis_object *__src, 163 nis_object *__dest); 164 extern void nis_destroy_object (nis_object *__obj); 165 extern void nis_print_object (const nis_object *__obj); 166 167 /* 168 ** nis_local_names 169 */ 170 extern nis_name nis_local_group (void); 171 extern nis_name nis_local_directory (void); 172 extern nis_name nis_local_principal (void); 173 extern nis_name nis_local_host (void); 174 175 /* 176 ** nis_error 177 */ 178 extern const char *nis_sperrno (const nis_error __status); 179 extern void nis_perror (const nis_error __status, const char *__label); 180 extern void nis_lerror (const nis_error __status, const char *__label); 181 extern char *nis_sperror (const nis_error status, const char *__label); 182 extern char *nis_sperror_r (const nis_error __status, const char *__label, 183 char *__buffer, size_t __buflen); 184 /* 185 ** nis_groups 186 */ 187 extern bool_t nis_ismember (const_nis_name __principal, 188 const_nis_name __group); 189 extern nis_error nis_addmember (const_nis_name __member, 190 const_nis_name __group); 191 extern nis_error nis_removemember (const_nis_name __member, 192 const_nis_name __group); 193 extern nis_error nis_creategroup (const_nis_name __group, 194 unsigned int __flags); 195 extern nis_error nis_destroygroup (const_nis_name __group); 196 extern void nis_print_group_entry (const_nis_name __group); 197 extern nis_error nis_verifygroup (const_nis_name __group); 198 199 /* 200 ** nis_ping 201 */ 202 extern void nis_ping (const_nis_name __dirname, uint32_t __utime, 203 const nis_object *__dirobj); 204 extern nis_result *nis_checkpoint (const_nis_name __dirname); 205 206 /* 207 ** nis_print (XXX INTERNAL FUNCTIONS, SHOULD NOT BE USED !!) 208 */ 209 extern void nis_print_result (const nis_result *__result); 210 extern void nis_print_rights (unsigned int __rights); 211 extern void nis_print_directory (const directory_obj *__dirobj); 212 extern void nis_print_group (const group_obj *__grpobj); 213 extern void nis_print_table (const table_obj *__tblobj); 214 extern void nis_print_link (const link_obj *__lnkobj); 215 extern void nis_print_entry (const entry_obj *__enobj); 216 217 /* 218 ** nis_file (XXX INTERNAL FUNCTIONS, SHOULD NOT BE USED !!) 219 */ 220 extern directory_obj *readColdStartFile (void); 221 extern bool_t writeColdStartFile (const directory_obj *__dirobj); 222 extern nis_object *nis_read_obj (const char *__obj); 223 extern bool_t nis_write_obj (const char *__file, const nis_object *__obj); 224 225 /* 226 ** nis_clone - (XXX INTERNAL FUNCTIONS, SHOULD NOT BE USED !!) 227 */ 228 extern directory_obj *nis_clone_directory (const directory_obj *__src, 229 directory_obj *__dest); 230 extern nis_result *nis_clone_result (const nis_result *__src, 231 nis_result *__dest); 232 233 /* nis_free - nis_freeresult */ 234 extern void nis_freeresult (nis_result *__result); 235 /* (XXX THE FOLLOWING ARE INTERNAL FUNCTIONS, SHOULD NOT BE USED !!) */ 236 extern void nis_free_request (ib_request *__req); 237 extern void nis_free_directory (directory_obj *__dirobj); 238 extern void nis_free_object (nis_object *__obj); 239 240 /* (XXX INTERNAL FUNCTIONS, SHOULD NOT BE USED !!) */ 241 extern nis_name __nis_default_owner (char *); 242 extern nis_name __nis_default_group (char *); 243 extern uint32_t __nis_default_ttl (char *); 244 extern unsigned int __nis_default_access (char *, unsigned int); 245 extern fd_result *__nis_finddirectory (directory_obj *, const_nis_name); 246 extern void __free_fdresult (fd_result *); 247 extern uint32_t __nis_hash (const void *__keyarg, size_t __len); 248 249 /* NIS+ cache locking */ 250 extern int __nis_lock_cache (void); 251 extern int __nis_unlock_cache (void); 252 253 /* (XXX INTERNAL FUNCTIONS, ONLY FOR rpc.nisd AND glibc !!) */ 254 #if defined (NIS_INTERNAL) 255 256 struct dir_binding 257 { 258 CLIENT *clnt; /* RPC CLIENT handle */ 259 nis_server *server_val; /* List of servers */ 260 unsigned int server_len; /* # of servers */ 261 unsigned int server_used; /* Which server we are bind in the moment ? */ 262 unsigned int current_ep; /* Which endpoint of the server are in use? */ 263 unsigned int trys; /* How many server have we tried ? */ 264 unsigned int class; /* From which class is server_val ? */ 265 bool_t master_only; /* Is only binded to the master */ 266 bool_t use_auth; /* Do we use AUTH ? */ 267 bool_t use_udp; /* Do we use UDP ? */ 268 struct sockaddr_in addr; /* Server's IP address */ 269 int socket; /* Server's local socket */ 270 }; 271 typedef struct dir_binding dir_binding; 272 273 extern nis_error __nisbind_create (dir_binding *, const nis_server *, 274 unsigned int, unsigned int, unsigned int, 275 unsigned int); 276 extern nis_error __nisbind_connect (dir_binding *); 277 extern nis_error __nisbind_next (dir_binding *); 278 extern void __nisbind_destroy (dir_binding *); 279 extern nis_error __nisfind_server (const_nis_name, int, directory_obj **, 280 dir_binding *, unsigned int); 281 282 #endif 283 284 #ifdef __cplusplus 285 } 286 #endif 287 288 #endif /* __RPCSVC_NISLIB_H__ */
Contact us
|
About us
|
Term of use
|
Copyright © 2000-2024 MyWebUniversity.com ™