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 or with the express written consent of
8 * Sun Microsystems, Inc.
10 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
11 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
12 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
14 * Sun RPC is provided with no support and without any obligation on the
15 * part of Sun Microsystems, Inc. to assist in its use, correction,
16 * modification or enhancement.
18 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
19 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
20 * OR ANY PART THEREOF.
22 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
23 * or profits or other special, indirect and consequential damages, even if
24 * Sun has been advised of the possibility of such damages.
26 * Sun Microsystems, Inc.
28 * Mountain View, California 94043
32 #define _RPCSVC_NIS_H 1
36 #include <rpcsvc/nis_tags.h>
43 * This file is the main include file for NIS clients. It contains
44 * both the client library function defines and the various data
45 * structures used by the NIS service. It includes the file nis_tags.h
46 * which defines the tag values. This allows the tags to change without
47 * having to change the nis.x file.
49 * NOTE : THIS FILE IS NOT GENERATED WITH RPCGEN ! SO YOU HAVE TO
50 * ADD ALL THE CHANGES ON nis_*.x FILES HERE AGAIN !
52 * I have removed all the Solaris internal structs and variables,
53 * because they are not supported, Sun changed them between various
54 * releases and they shouldn't be used in user programs.
55 * <kukuk@vt.uni-paderborn.de>
59 #ifndef __nis_object_h
60 #define __nis_object_h
62 #define NIS_MAXSTRINGLEN 255
63 #define NIS_MAXNAMELEN 1024
64 #define NIS_MAXATTRNAME 32
65 #define NIS_MAXATTRVAL 2048
66 #define NIS_MAXCOLUMNS 64
67 #define NIS_MAXATTR 16
68 #define NIS_MAXPATH 1024
69 #define NIS_MAXREPLICAS 128
70 #define NIS_MAXLINKS 16
83 typedef struct nis_attr nis_attr
;
85 typedef char *nis_name
;
98 NIS_DIRECTORY_OBJ
= 2,
105 typedef enum zotypes zotypes
;
118 typedef enum nstype nstype
;
124 typedef struct oar_mask oar_mask
;
131 typedef struct endpoint endpoint
;
142 typedef struct nis_server nis_server
;
144 struct directory_obj
{
148 u_int do_servers_len
;
149 nis_server
*do_servers_val
;
154 oar_mask
*do_armask_val
;
157 typedef struct directory_obj directory_obj
;
162 #define EN_MODIFIED 8
172 typedef struct entry_col entry_col
;
178 entry_col
*en_cols_val
;
181 typedef struct entry_obj entry_obj
;
186 u_int gr_members_len
;
187 nis_name
*gr_members_val
;
190 typedef struct group_obj group_obj
;
196 nis_attr
*li_attrs_val
;
200 typedef struct link_obj link_obj
;
205 #define TA_SEARCHABLE 8
207 #define TA_MODIFIED 32
215 typedef struct table_col table_col
;
223 table_col
*ta_cols_val
;
227 typedef struct table_obj table_obj
;
232 struct directory_obj di_data
;
233 struct group_obj gr_data
;
234 struct table_obj ta_data
;
235 struct entry_obj en_data
;
236 struct link_obj li_data
;
243 typedef struct objdata objdata
;
249 typedef struct nis_oid nis_oid
;
261 typedef struct nis_object nis_object
;
263 #endif /* if __nis_object_h */
270 NIS_CACHEEXPIRED
= 4,
271 NIS_NAMEUNREACHABLE
= 5,
289 NIS_NOSUCHTABLE
= 23,
290 NIS_TYPEMISMATCH
= 24,
291 NIS_LINKNAMEERROR
= 25,
293 NIS_TOOMANYATTRS
= 27,
295 NIS_BADATTRIBUTE
= 29,
296 NIS_NOTSEARCHABLE
= 30,
304 NIS_COLDSTART_ERR
= 38,
311 NIS_NOFILESPACE
= 45,
315 typedef enum nis_error nis_error
;
321 nis_object
*objects_val
;
329 typedef struct nis_result nis_result
;
335 nis_object
*ns_object_val
;
338 typedef struct ns_request ns_request
;
344 nis_attr
*ibr_srch_val
;
349 nis_object
*ibr_obj_val
;
352 u_int ibr_cbhost_len
;
353 nis_server
*ibr_cbhost_val
;
358 typedef struct ib_request ib_request
;
364 typedef struct ping_args ping_args
;
377 typedef enum log_entry_t log_entry_t
;
386 nis_attr
*le_attrs_val
;
388 nis_object le_object
;
390 typedef struct log_entry log_entry
;
396 u_int lr_entries_len
;
397 log_entry
*lr_entries_val
;
400 typedef struct log_result log_result
;
407 typedef struct cp_result cp_result
;
413 typedef struct nis_tag nis_tag
;
421 typedef struct nis_taglist nis_taglist
;
428 nis_server
*da_cbhost_val
;
431 typedef struct dump_args dump_args
;
437 typedef struct fd_args fd_args
;
451 typedef struct fd_result fd_result
;
453 /* Generic client creating flags */
458 /* Testing Access rights for objects */
460 #define NIS_READ_ACC 1
461 #define NIS_MODIFY_ACC 2
462 #define NIS_CREATE_ACC 4
463 #define NIS_DESTROY_ACC 8
464 /* Test macros. a == access rights, m == desired rights. */
465 #define NIS_WORLD(a, m) (((a) & (m)) != 0)
466 #define NIS_GROUP(a, m) (((a) & ((m) << 8)) != 0)
467 #define NIS_OWNER(a, m) (((a) & ((m) << 16)) != 0)
468 #define NIS_NOBODY(a, m) (((a) & ((m) << 24)) != 0)
470 * EOL Alert - The following non-prefixed test macros are
471 * here for backward compatability, and will be not be present
472 * in future releases - use the NIS_*() macros above.
474 #define WORLD(a, m) (((a) & (m)) != 0)
475 #define GROUP(a, m) (((a) & ((m) << 8)) != 0)
476 #define OWNER(a, m) (((a) & ((m) << 16)) != 0)
477 #define NOBODY(a, m) (((a) & ((m) << 24)) != 0)
479 #define OATYPE(d, n) (((d)->do_armask.do_armask_val+n)->oa_otype)
480 #define OARIGHTS(d, n) (((d)->do_armask.do_armask_val+n)->oa_rights)
481 #define WORLD_DEFAULT (NIS_READ_ACC)
482 #define GROUP_DEFAULT (NIS_READ_ACC << 8)
483 #define OWNER_DEFAULT ((NIS_READ_ACC + NIS_MODIFY_ACC + NIS_CREATE_ACC +\
484 NIS_DESTROY_ACC) << 16)
485 #define DEFAULT_RIGHTS (WORLD_DEFAULT | GROUP_DEFAULT | OWNER_DEFAULT)
487 /* Result manipulation defines ... */
488 #define NIS_RES_NUMOBJ(x) ((x)->objects.objects_len)
489 #define NIS_RES_OBJECT(x) ((x)->objects.objects_val)
490 #define NIS_RES_COOKIE(x) ((x)->cookie)
491 #define NIS_RES_STATUS(x) ((x)->status)
493 /* These defines make getting at the variant part of the object easier. */
494 #define TA_data zo_data.objdata_u.ta_data
495 #define EN_data zo_data.objdata_u.en_data
496 #define DI_data zo_data.objdata_u.di_data
497 #define LI_data zo_data.objdata_u.li_data
498 #define GR_data zo_data.objdata_u.gr_data
500 #define __type_of(o) ((o)->zo_data.zo_type)
502 /* Declarations for the internal subroutines in nislib.c */
503 enum name_pos
{SAME_NAME
, HIGHER_NAME
, LOWER_NAME
, NOT_SEQUENTIAL
, BAD_NAME
};
504 typedef enum name_pos name_pos
;
507 * Defines for getting at column data in entry objects. Because RPCGEN
508 * generates some rather wordy structures, we create some defines that
509 * collapse the needed keystrokes to access a particular value using
510 * these definitions they take an nis_object *, and an int and return
511 * a u_char * for Value, and an int for length.
513 #define ENTRY_VAL(obj, col) (obj)->EN_data.en_cols.en_cols_val[col].ec_value.ec_value_val
514 #define ENTRY_LEN(obj, col) (obj)->EN_data.en_cols.en_cols_val[col].ec_value.ec_value_len
517 /* Prototypes, and extern declarations for the NIS library functions. */
518 #include <rpcsvc/nislib.h>
524 * This file contains definitions that are only of interest to the actual
525 * service daemon and client stubs. Normal users of NIS will not include
528 * NOTE : This include file is automatically created by a combination
529 * of rpcgen and sed. DO NOT EDIT IT, change the nis.x file instead
530 * and then remake this file.
535 #define NIS_PROG ((u_long)100300)
536 #define NIS_VERSION ((u_long)3)
538 #define NIS_LOOKUP ((u_long)1)
539 extern nis_result
* nis_lookup_3
__P ((ns_request
*, CLIENT
*));
540 extern nis_result
* nis_lookup_3_svc
__P ((ns_request
*, struct svc_req
*));
541 #define NIS_ADD ((u_long)2)
542 extern nis_result
* nis_add_3
__P ((ns_request
*, CLIENT
*));
543 extern nis_result
* nis_add_3_svc
__P ((ns_request
*, struct svc_req
*));
544 #define NIS_MODIFY ((u_long)3)
545 extern nis_result
* nis_modify_3
__P ((ns_request
*, CLIENT
*));
546 extern nis_result
* nis_modify_3_svc
__P ((ns_request
*, struct svc_req
*));
547 #define NIS_REMOVE ((u_long)4)
548 extern nis_result
* nis_remove_3
__P ((ns_request
*, CLIENT
*));
549 extern nis_result
* nis_remove_3_svc
__P ((ns_request
*, struct svc_req
*));
550 #define NIS_IBLIST ((u_long)5)
551 extern nis_result
* nis_iblist_3
__P ((ib_request
*, CLIENT
*));
552 extern nis_result
* nis_iblist_3_svc
__P ((ib_request
*, struct svc_req
*));
553 #define NIS_IBADD ((u_long)6)
554 extern nis_result
* nis_ibadd_3
__P ((ib_request
*, CLIENT
*));
555 extern nis_result
* nis_ibadd_3_svc
__P ((ib_request
*, struct svc_req
*));
556 #define NIS_IBMODIFY ((u_long)7)
557 extern nis_result
* nis_ibmodify_3
__P ((ib_request
*, CLIENT
*));
558 extern nis_result
* nis_ibmodify_3_svc
__P ((ib_request
*, struct svc_req
*));
559 #define NIS_IBREMOVE ((u_long)8)
560 extern nis_result
* nis_ibremove_3
__P ((ib_request
*, CLIENT
*));
561 extern nis_result
* nis_ibremove_3_svc
__P ((ib_request
*, struct svc_req
*));
562 #define NIS_IBFIRST ((u_long)9)
563 extern nis_result
* nis_ibfirst_3
__P ((ib_request
*, CLIENT
*));
564 extern nis_result
* nis_ibfirst_3_svc
__P ((ib_request
*, struct svc_req
*));
565 #define NIS_IBNEXT ((u_long)10)
566 extern nis_result
* nis_ibnext_3
__P ((ib_request
*, CLIENT
*));
567 extern nis_result
* nis_ibnext_3_svc
__P ((ib_request
*, struct svc_req
*));
568 #define NIS_FINDDIRECTORY ((u_long)12)
569 extern fd_result
* nis_finddirectory_3
__P ((fd_args
*, CLIENT
*));
570 extern fd_result
* nis_finddirectory_3_svc
__P ((fd_args
*,
572 #define NIS_STATUS ((u_long)14)
573 extern nis_taglist
* nis_status_3
__P ((nis_taglist
*, CLIENT
*));
574 extern nis_taglist
* nis_status_3_svc
__P ((nis_taglist
*, struct svc_req
*));
575 #define NIS_DUMPLOG ((u_long)15)
576 extern log_result
* nis_dumplog_3
__P ((dump_args
*, CLIENT
*));
577 extern log_result
* nis_dumplog_3_svc
__P ((dump_args
*, struct svc_req
*));
578 #define NIS_DUMP ((u_long)16)
579 extern log_result
* nis_dump_3
__P ((dump_args
*, CLIENT
*));
580 extern log_result
* nis_dump_3_svc
__P ((dump_args
*, struct svc_req
*));
581 #define NIS_CALLBACK ((u_long)17)
582 extern bool_t
* nis_callback_3
__P ((netobj
*, CLIENT
*));
583 extern bool_t
* nis_callback_3_svc
__P ((netobj
*, struct svc_req
*));
584 #define NIS_CPTIME ((u_long)18)
585 extern u_long
* nis_cptime_3
__P ((nis_name
*, CLIENT
*));
586 extern u_long
* nis_cptime_3_svc
__P ((nis_name
*, struct svc_req
*));
587 #define NIS_CHECKPOINT ((u_long)19)
588 extern cp_result
* nis_checkpoint_3
__P ((nis_name
*, CLIENT
*));
589 extern cp_result
* nis_checkpoint_3_svc
__P ((nis_name
*, struct svc_req
*));
590 #define NIS_PING ((u_long)20)
591 extern void * nis_ping_3
__P ((ping_args
*, CLIENT
*));
592 extern void * nis_ping_3_svc
__P ((ping_args
*, struct svc_req
*));
593 #define NIS_SERVSTATE ((u_long)21)
594 extern nis_taglist
* nis_servstate_3
__P ((nis_taglist
*, CLIENT
*));
595 extern nis_taglist
* nis_servstate_3_svc
__P ((nis_taglist
*,
597 #define NIS_MKDIR ((u_long)22)
598 extern nis_error
* nis_mkdir_3
__P ((nis_name
*, CLIENT
*));
599 extern nis_error
* nis_mkdir_3_svc
__P ((nis_name
*, struct svc_req
*));
600 #define NIS_RMDIR ((u_long)23)
601 extern nis_error
* nis_rmdir_3
__P ((nis_name
*, CLIENT
*));
602 extern nis_error
* nis_rmdir_3_svc
__P ((nis_name
*, struct svc_req
*));
603 #define NIS_UPDKEYS ((u_long)24)
604 extern nis_error
* nis_updkeys_3
__P ((nis_name
*, CLIENT
*));
605 extern nis_error
* nis_updkeys_3_svc
__P ((nis_name
*, struct svc_req
*));
609 #endif /* !_NIS_H_RPCGEN */