Dr Andrew Scott G7VAV

My photo
 
June 2025
Mo Tu We Th Fr Sa Su
26 27 28 29 30 31 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 1 2 3 4 5 6


nislib.h
001: /* Copyright (C) 1997, 1998, 1999, 2006, 2007, 2009
002:    Free Software Foundation, Inc.
003:    This file is part of the GNU C Library.
004:    Contributed by Thorsten Kukuk <kukuk@suse.de>, 1997.
005: 
006:    The GNU C Library is free software; you can redistribute it and/or
007:    modify it under the terms of the GNU Lesser General Public
008:    License as published by the Free Software Foundation; either
009:    version 2.1 of the License, or (at your option) any later version.
010: 
011:    The GNU C Library is distributed in the hope that it will be useful,
012:    but WITHOUT ANY WARRANTY; without even the implied warranty of
013:    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
014:    Lesser General Public License for more details.
015: 
016:    You should have received a copy of the GNU Lesser General Public
017:    License along with the GNU C Library; if not, write to the Free
018:    Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
019:    02111-1307 USA.  */
020: 
021: #ifndef __RPCSVC_NISLIB_H__
022: #define __RPCSVC_NISLIB_H__
023: 
024: #include <features.h>
025: 
026: __BEGIN_DECLS
027: 
028: typedef const char *const_nis_name;
029: 
030: /* nis_names: These functions are used to locate and manipulate all NIS+
031:  * objects except the NIS+ entry objects.
032:  *
033:  * nis_lookup (name, flags) resolves a NIS+ name and returns a copy of
034:  *                          that object  from a NIS+ server.
035:  *    const nis_name name: name of the object to be resolved
036:  *    unsigned int flags: logically ORing zero or more flags (FOLLOW_LINKS,
037:  *                          HARD_LOOKUP, [NO_CACHE], MASTER_ONLY, EXPAND_NAME)
038:  *
039:  * nis_add (name, obj) adds objects to the NIS+ namespace.
040:  *    const nis_name name: fully qualified NIS+ name.
041:  *    const nis_object *obj: object members zo_name and zo_domain will be
042:  *                           constructed from name.
043:  *
044:  * nis_remove (name, obj) removes objects from the NIS+ namespace.
045:  *    const nis_name name: fully qualified NIS+ name.
046:  *    const nis_object *obj: if not NULL, it is assumed to point to a copy
047:  *                           of the object being removed. In this case, if
048:  *                           the object on the server does not have the same
049:  *                           object identifier as the  object  being  passed,
050:  *                           the operation will fail with the NIS_NOTSAMEOBJ
051:  *                           error.
052:  *
053:  * nis_modify (name, obj) can change specific attributes of an object
054:  *                        that already exists in the namespace.
055:  */
056: extern nis_result *nis_lookup (const_nis_name name, unsigned int flags)
057:      __THROW;
058: extern nis_result *nis_add (const_nis_name name, const nis_object *obj)
059:      __THROW;
060: extern nis_result *nis_remove (const_nis_name name,
061:                                const nis_object *obj) __THROW;
062: extern nis_result *nis_modify (const_nis_name name,
063:                                const nis_object *obj) __THROW;
064: 
065: /* nis_tables: These functions are used to search and modify NIS+ tables.
066:  *
067:  * nis_list (table_name, flags, callback(table_name, obj, userdata), userdata)
068:  *           search a table in the NIS+ namespace.
069:  *    const nis_name table_name: indexed name ([xx=yy],table.dir)
070:  *    unsigned int flags: logically ORing one or more flags (FOLLOW_LINKS,
071:  *                      [FOLLOW_PATH], HARD_LOOKUP, [ALL_RESULTS], [NO_CACHE],
072:  *                      MASTER_ONLY, EXPAND_NAME, RETURN_RESULT)
073:  *    callback(): callback is an optional pointer to a function that will
074:  *                process the ENTRY type objects that are returned from the
075:  *                search. If this pointer is NULL, then all entries that match
076:  *                the search criteria are returned in the nis_result structure,
077:  *                otherwise  this  function  will  be  called once for each
078:  *                entry returned.
079:  *    void *userdata: passed to callback function along with the returned
080:  *                    entry object.
081:  *
082:  * nis_add_entry (table_name, obj, flags) will add the NIS+ object to the
083:  *                                        NIS+ table_name.
084:  *    const nis_name table_name
085:  *    const nis_object *obj
086:  *    unsigned int flags: 0, ADD_OVERWRITE, RETURN_RESULT
087:  *
088:  * nis_modify_entry (name, obj, flags) modifies an object identified by name.
089:  *    const nis_name name: object identifier
090:  *    const nis_object *obj: should point to an entry with the EN_MODIFIED
091:  *                           flag set in each column that contains new
092:  *                           information.
093:  *    unsigned int flags: 0, MOD_SAMEOBJ, RETURN_RESULT
094:  *
095:  * nis_remove_entry (table_name, obj, flags) removes a set of entries
096:  *                                 identified by table_name from the table.
097:  *    const nis_name table_name: indexed NIS+ name
098:  *    const nis_object *obj: if obj is non-null, it is presumed to point to
099:  *                           a cached copy of the entry. When the removal is
100:  *                           attempted, and the object that would be removed
101:  *                           is not the same as the cached object pointed to
102:  *                           by object then the operation will fail with an
103:  *                           NIS_NOTSAMEOBJ error
104:  *    unsigned int flags: 0, REM_MULTIPLE
105:  *
106:  * nis_first_entry (table_name) fetches entries from a table one at a time.
107:  *    const nis_name table_name
108:  *
109:  * nis_next_entry (table_name, cookie) retrieves the "next" entry from a
110:  *                                     table specified by table_name.
111:  *    const nis_name table_name:
112:  *    const netobj *cookie: The value of cookie from the nis_result structure
113:  *                          form the previous call.
114:  */
115: extern nis_result *nis_list (const_nis_name __name, unsigned int __flags,
116:                              int (*__callback)(const_nis_name __table_name,
117:                                                const nis_object *__obj,
118:                                                const void *__userdata),
119:                              const void *__userdata) __THROW;
120: extern nis_result *nis_add_entry (const_nis_name __table_name,
121:                                   const nis_object *__obj,
122:                                   unsigned int __flags) __THROW;
123: extern nis_result *nis_modify_entry (const_nis_name __name,
124:                                      const nis_object *__obj,
125:                                      unsigned int __flags) __THROW;
126: extern nis_result *nis_remove_entry (const_nis_name __table_name,
127:                                      const nis_object *__obj,
128:                                      unsigned int __flags) __THROW;
129: extern nis_result *nis_first_entry (const_nis_name __table_name) __THROW;
130: extern nis_result *nis_next_entry (const_nis_name __table_name,
131:                                    const netobj *__cookie) __THROW;
132: /*
133: ** nis_server
134: */
135: extern nis_error nis_mkdir (const_nis_name __dirname,
136:                             const nis_server *__machine) __THROW;
137: extern nis_error nis_rmdir (const_nis_name __dirname,
138:                             const nis_server *__machine) __THROW;
139: extern nis_error nis_servstate (const nis_server *__machine,
140:                                 const nis_tag *__tags, int __numtags,
141:                                 nis_tag **__result) __THROW;
142: extern nis_error nis_stats (const nis_server *__machine,
143:                             const nis_tag *__tags, int __numtags,
144:                             nis_tag **__result) __THROW;
145: extern void nis_freetags (nis_tag *__tags, int __numtags) __THROW;
146: extern nis_server **nis_getservlist (const_nis_name __dirname) __THROW;
147: extern void nis_freeservlist (nis_server **__machines) __THROW;
148: 
149: /*
150: ** nis_subr
151: */
152: extern nis_name nis_leaf_of (const_nis_name __name) __THROW;
153: extern nis_name nis_leaf_of_r (const_nis_name __name, char *__buffer,
154:                                size_t __buflen) __THROW;
155: extern nis_name nis_name_of (const_nis_name __name) __THROW;
156: extern nis_name nis_name_of_r (const_nis_name __name, char *__buffer,
157:                                size_t __buflen) __THROW;
158: extern nis_name nis_domain_of (const_nis_name __name) __THROW;
159: extern nis_name nis_domain_of_r (const_nis_name __name, char *__buffer,
160:                                  size_t __buflen) __THROW;
161: extern nis_name *nis_getnames (const_nis_name __name) __THROW;
162: extern void nis_freenames (nis_name *__namelist) __THROW;
163: extern name_pos nis_dir_cmp (const_nis_name __n1, const_nis_name __n2) __THROW;
164: extern nis_object *nis_clone_object (const nis_object *__src,
165:                                      nis_object *__dest) __THROW;
166: extern void nis_destroy_object (nis_object *__obj) __THROW;
167: extern void nis_print_object (const nis_object *__obj) __THROW;
168: 
169: /*
170: ** nis_local_names
171: */
172: extern nis_name nis_local_group (void) __THROW;
173: extern nis_name nis_local_directory (void) __THROW;
174: extern nis_name nis_local_principal (void) __THROW;
175: extern nis_name nis_local_host (void) __THROW;
176: 
177: /*
178: ** nis_error
179: */
180: extern const char *nis_sperrno (const nis_error __status) __THROW;
181: extern void nis_perror (const nis_error __status, const char *__label) __THROW;
182: extern void nis_lerror (const nis_error __status, const char *__label) __THROW;
183: extern char *nis_sperror (const nis_error status, const char *__label) __THROW;
184: extern char *nis_sperror_r (const nis_error __status, const char *__label,
185:                             char *__buffer, size_t __buflen) __THROW;
186: /*
187: ** nis_groups
188: */
189: extern bool_t nis_ismember (const_nis_name __principal,
190:                             const_nis_name __group) __THROW;
191: extern nis_error nis_addmember (const_nis_name __member,
192:                                 const_nis_name __group) __THROW;
193: extern nis_error nis_removemember (const_nis_name __member,
194:                                    const_nis_name __group) __THROW;
195: extern nis_error nis_creategroup (const_nis_name __group,
196:                                   unsigned int __flags) __THROW;
197: extern nis_error nis_destroygroup (const_nis_name __group) __THROW;
198: extern void nis_print_group_entry (const_nis_name __group) __THROW;
199: extern nis_error nis_verifygroup (const_nis_name __group) __THROW;
200: 
201: /*
202: ** nis_ping
203: */
204: extern void nis_ping (const_nis_name __dirname, uint32_t __utime,
205:                       const nis_object *__dirobj) __THROW;
206: extern nis_result *nis_checkpoint (const_nis_name __dirname) __THROW;
207: 
208: /*
209: ** nis_print (XXX INTERNAL FUNCTIONS, SHOULD NOT BE USED !!)
210: */
211: extern void nis_print_result (const nis_result *__result) __THROW;
212: extern void nis_print_rights (unsigned int __rights) __THROW;
213: extern void nis_print_directory (const directory_obj *__dirobj) __THROW;
214: extern void nis_print_group (const group_obj *__grpobj) __THROW;
215: extern void nis_print_table (const table_obj *__tblobj) __THROW;
216: extern void nis_print_link (const link_obj *__lnkobj) __THROW;
217: extern void nis_print_entry (const entry_obj *__enobj) __THROW;
218: 
219: /*
220: ** nis_file (XXX INTERNAL FUNCTIONS, SHOULD NOT BE USED !!)
221: */
222: extern directory_obj *readColdStartFile (void) __THROW;
223: extern bool_t writeColdStartFile (const directory_obj *__dirobj) __THROW;
224: extern nis_object *nis_read_obj (const char *__obj) __THROW;
225: extern bool_t nis_write_obj (const char *__file, const nis_object *__obj) __THROW;
226: 
227: /*
228: ** nis_clone - (XXX INTERNAL FUNCTIONS, SHOULD NOT BE USED !!)
229: */
230: extern directory_obj *nis_clone_directory (const directory_obj *__src,
231:                                            directory_obj *__dest) __THROW;
232: extern nis_result *nis_clone_result (const nis_result *__src,
233:                                      nis_result *__dest) __THROW;
234: 
235: /* nis_free - nis_freeresult */
236: extern void nis_freeresult (nis_result *__result) __THROW;
237: /* (XXX THE FOLLOWING ARE INTERNAL FUNCTIONS, SHOULD NOT BE USED !!) */
238: extern void nis_free_request (ib_request *__req) __THROW;
239: extern void nis_free_directory (directory_obj *__dirobj) __THROW;
240: extern void nis_free_object (nis_object *__obj) __THROW;
241: 
242: /* (XXX INTERNAL FUNCTIONS, SHOULD NOT BE USED !!) */
243: extern nis_name __nis_default_owner (char *) __THROW;
244: extern nis_name __nis_default_group (char *) __THROW;
245: extern uint32_t __nis_default_ttl (char *) __THROW;
246: extern unsigned int __nis_default_access (char *, unsigned int) __THROW;
247: extern fd_result *__nis_finddirectory (directory_obj *, const_nis_name) __THROW;
248: extern void __free_fdresult (fd_result *) __THROW;
249: extern uint32_t __nis_hash (const void *__keyarg, size_t __len) __THROW;
250: 
251: /* NIS+ cache locking */
252: extern int __nis_lock_cache (void) __THROW;
253: extern int __nis_unlock_cache (void) __THROW;
254: 
255: /* (XXX INTERNAL FUNCTIONS, ONLY FOR rpc.nisd AND glibc !!) */
256: #if defined (NIS_INTERNAL) || defined (_LIBC)
257: 
258: struct dir_binding
259: {
260:   CLIENT *clnt;                  /* RPC CLIENT handle */
261:   nis_server *server_val;        /* List of servers */
262:   unsigned int server_len;       /* # of servers */
263:   unsigned int server_used;      /* Which server we are bind in the moment ? */
264:   unsigned int current_ep;       /* Which endpoint of the server are in use? */
265:   unsigned int trys;             /* How many server have we tried ? */
266:   unsigned int class;            /* From which class is server_val ? */
267:   bool_t master_only;            /* Is only binded to the master */
268:   bool_t use_auth;               /* Do we use AUTH ? */
269:   bool_t use_udp;                /* Do we use UDP ? */
270:   struct sockaddr_in addr;       /* Server's IP address */
271:   int socket;                    /* Server's local socket */
272: };
273: typedef struct dir_binding dir_binding;
274: 
275: extern nis_error __nisbind_create (dir_binding *, const nis_server *,
276:                                    unsigned int, unsigned int, unsigned int,
277:                                    unsigned int) __THROW;
278: extern nis_error __nisbind_connect (dir_binding *) __THROW;
279: extern nis_error __nisbind_next (dir_binding *) __THROW;
280: extern void __nisbind_destroy (dir_binding *) __THROW;
281: extern nis_error __nisfind_server (const_nis_name, int, directory_obj **,
282:                                    dir_binding *, unsigned int) __THROW;
283: 
284: #endif
285: 
286: __END_DECLS
287: 
288: #endif  /* __RPCSVC_NISLIB_H__ */
289: 


for client (none)
© Andrew Scott 2006 - 2025,
All Rights Reserved
http://www.andrew-scott.uk/
Andrew Scott
http://www.andrew-scott.co.uk/