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
;
84 extern bool_t xdr_nis_attr
__P ((XDR
*, nis_attr
*));
86 typedef char *nis_name
;
87 extern bool_t xdr_nis_name
__P ((XDR
*, nis_name
*));
100 NIS_DIRECTORY_OBJ
= 2,
107 typedef enum zotypes zotypes
;
108 extern bool_t xdr_zotypes
__P ((XDR
*, zotypes
*));
121 typedef enum nstype nstype
;
122 extern bool_t xdr_nstype
__P ((XDR
*, nstype
*));
128 typedef struct oar_mask oar_mask
;
129 extern bool_t xdr_oar_mask
__P ((XDR
*, oar_mask
*));
136 typedef struct endpoint endpoint
;
137 extern bool_t xdr_endpoint
__P ((XDR
*, endpoint
*));
148 typedef struct nis_server nis_server
;
149 extern bool_t xdr_nis_server
__P ((XDR
*, nis_server
*));
151 struct directory_obj
{
155 u_int do_servers_len
;
156 nis_server
*do_servers_val
;
161 oar_mask
*do_armask_val
;
164 typedef struct directory_obj directory_obj
;
165 extern bool_t xdr_directory_obj
__P ((XDR
*, directory_obj
*));
170 #define EN_MODIFIED 8
180 typedef struct entry_col entry_col
;
181 extern bool_t xdr_entry_col
__P ((XDR
*, entry_col
*));
187 entry_col
*en_cols_val
;
190 typedef struct entry_obj entry_obj
;
191 extern bool_t xdr_entry_obj
__P ((XDR
*, entry_obj
*));
196 u_int gr_members_len
;
197 nis_name
*gr_members_val
;
200 typedef struct group_obj group_obj
;
201 extern bool_t xdr_group_obj
__P ((XDR
*, group_obj
*));
207 nis_attr
*li_attrs_val
;
211 typedef struct link_obj link_obj
;
212 extern bool_t xdr_link_obj
__P ((XDR
*, link_obj
*));
217 #define TA_SEARCHABLE 8
219 #define TA_MODIFIED 32
227 typedef struct table_col table_col
;
228 extern bool_t xdr_table_col
__P ((XDR
*, table_col
*));
236 table_col
*ta_cols_val
;
240 typedef struct table_obj table_obj
;
241 extern bool_t xdr_table_obj
__P ((XDR
*, table_obj
*));
246 struct directory_obj di_data
;
247 struct group_obj gr_data
;
248 struct table_obj ta_data
;
249 struct entry_obj en_data
;
250 struct link_obj li_data
;
257 typedef struct objdata objdata
;
258 extern bool_t xdr_objdata
__P ((XDR
*, objdata
*));
264 typedef struct nis_oid nis_oid
;
265 extern bool_t xdr_nis_oid
__P ((XDR
*, nis_oid
*));
277 typedef struct nis_object nis_object
;
278 extern bool_t xdr_nis_object
__P ((XDR
*, nis_object
*));
280 #endif /* if __nis_object_h */
287 NIS_CACHEEXPIRED
= 4,
288 NIS_NAMEUNREACHABLE
= 5,
306 NIS_NOSUCHTABLE
= 23,
307 NIS_TYPEMISMATCH
= 24,
308 NIS_LINKNAMEERROR
= 25,
310 NIS_TOOMANYATTRS
= 27,
312 NIS_BADATTRIBUTE
= 29,
313 NIS_NOTSEARCHABLE
= 30,
321 NIS_COLDSTART_ERR
= 38,
328 NIS_NOFILESPACE
= 45,
332 typedef enum nis_error nis_error
;
333 extern bool_t xdr_nis_error
__P ((XDR
*, nis_error
*));
339 nis_object
*objects_val
;
347 typedef struct nis_result nis_result
;
348 extern bool_t xdr_nis_result
__P ((XDR
*, nis_result
*));
354 nis_object
*ns_object_val
;
357 typedef struct ns_request ns_request
;
358 extern bool_t xdr_ns_request
__P ((XDR
*, ns_request
*));
364 nis_attr
*ibr_srch_val
;
369 nis_object
*ibr_obj_val
;
372 u_int ibr_cbhost_len
;
373 nis_server
*ibr_cbhost_val
;
378 typedef struct ib_request ib_request
;
379 extern bool_t xdr_ib_request
__P ((XDR
*, ib_request
*));
385 typedef struct ping_args ping_args
;
386 extern bool_t xdr_ping_args
__P ((XDR
*, ping_args
*));
399 typedef enum log_entry_t log_entry_t
;
400 extern bool_t xdr_log_entry_t
__P ((XDR
*, log_entry_t
*));
409 nis_attr
*le_attrs_val
;
411 nis_object le_object
;
413 typedef struct log_entry log_entry
;
414 extern bool_t xdr_log_entry
__P ((XDR
*, log_entry
*));
420 u_int lr_entries_len
;
421 log_entry
*lr_entries_val
;
424 typedef struct log_result log_result
;
425 extern bool_t xdr_log_result
__P ((XDR
*, log_result
*));
432 typedef struct cp_result cp_result
;
433 extern bool_t xdr_cp_result
__P ((XDR
*, cp_result
*));
439 typedef struct nis_tag nis_tag
;
440 extern bool_t xdr_nis_tag
__P ((XDR
*, nis_tag
*));
448 typedef struct nis_taglist nis_taglist
;
449 extern bool_t xdr_nis_taglist
__P ((XDR
*, nis_taglist
*));
456 nis_server
*da_cbhost_val
;
459 typedef struct dump_args dump_args
;
460 extern bool_t xdr_dump_args
__P ((XDR
*, dump_args
*));
466 typedef struct fd_args fd_args
;
467 extern bool_t xdr_fd_args
__P ((XDR
*, fd_args
*));
481 typedef struct fd_result fd_result
;
482 extern bool_t xdr_fd_result
__P ((XDR
*, fd_result
*));
484 /* Generic client creating flags */
489 /* Testing Access rights for objects */
491 #define NIS_READ_ACC 1
492 #define NIS_MODIFY_ACC 2
493 #define NIS_CREATE_ACC 4
494 #define NIS_DESTROY_ACC 8
495 /* Test macros. a == access rights, m == desired rights. */
496 #define NIS_WORLD(a, m) (((a) & (m)) != 0)
497 #define NIS_GROUP(a, m) (((a) & ((m) << 8)) != 0)
498 #define NIS_OWNER(a, m) (((a) & ((m) << 16)) != 0)
499 #define NIS_NOBODY(a, m) (((a) & ((m) << 24)) != 0)
501 * EOL Alert - The following non-prefixed test macros are
502 * here for backward compatability, and will be not be present
503 * in future releases - use the NIS_*() macros above.
505 #define WORLD(a, m) (((a) & (m)) != 0)
506 #define GROUP(a, m) (((a) & ((m) << 8)) != 0)
507 #define OWNER(a, m) (((a) & ((m) << 16)) != 0)
508 #define NOBODY(a, m) (((a) & ((m) << 24)) != 0)
510 #define OATYPE(d, n) (((d)->do_armask.do_armask_val+n)->oa_otype)
511 #define OARIGHTS(d, n) (((d)->do_armask.do_armask_val+n)->oa_rights)
512 #define WORLD_DEFAULT (NIS_READ_ACC)
513 #define GROUP_DEFAULT (NIS_READ_ACC << 8)
514 #define OWNER_DEFAULT ((NIS_READ_ACC + NIS_MODIFY_ACC + NIS_CREATE_ACC +\
515 NIS_DESTROY_ACC) << 16)
516 #define DEFAULT_RIGHTS (WORLD_DEFAULT | GROUP_DEFAULT | OWNER_DEFAULT)
518 /* Result manipulation defines ... */
519 #define NIS_RES_NUMOBJ(x) ((x)->objects.objects_len)
520 #define NIS_RES_OBJECT(x) ((x)->objects.objects_val)
521 #define NIS_RES_COOKIE(x) ((x)->cookie)
522 #define NIS_RES_STATUS(x) ((x)->status)
524 /* These defines make getting at the variant part of the object easier. */
525 #define TA_data zo_data.objdata_u.ta_data
526 #define EN_data zo_data.objdata_u.en_data
527 #define DI_data zo_data.objdata_u.di_data
528 #define LI_data zo_data.objdata_u.li_data
529 #define GR_data zo_data.objdata_u.gr_data
531 #define __type_of(o) ((o)->zo_data.zo_type)
533 /* Declarations for the internal subroutines in nislib.c */
534 enum name_pos
{SAME_NAME
, HIGHER_NAME
, LOWER_NAME
, NOT_SEQUENTIAL
, BAD_NAME
};
535 typedef enum name_pos name_pos
;
538 * Defines for getting at column data in entry objects. Because RPCGEN
539 * generates some rather wordy structures, we create some defines that
540 * collapse the needed keystrokes to access a particular value using
541 * these definitions they take an nis_object *, and an int and return
542 * a u_char * for Value, and an int for length.
544 #define ENTRY_VAL(obj, col) (obj)->EN_data.en_cols.en_cols_val[col].ec_value.ec_value_val
545 #define ENTRY_LEN(obj, col) (obj)->EN_data.en_cols.en_cols_val[col].ec_value.ec_value_len
548 /* Prototypes, and extern declarations for the NIS library functions. */
549 #include <rpcsvc/nislib.h>
555 * This file contains definitions that are only of interest to the actual
556 * service daemon and client stubs. Normal users of NIS will not include
559 * NOTE : This include file is automatically created by a combination
560 * of rpcgen and sed. DO NOT EDIT IT, change the nis.x file instead
561 * and then remake this file.
566 #define NIS_PROG ((u_long)100300)
567 #define NIS_VERSION ((u_long)3)
569 #define NIS_LOOKUP ((u_long)1)
570 extern nis_result
* nis_lookup_3
__P ((ns_request
*, CLIENT
*));
571 extern nis_result
* nis_lookup_3_svc
__P ((ns_request
*, struct svc_req
*));
572 #define NIS_ADD ((u_long)2)
573 extern nis_result
* nis_add_3
__P ((ns_request
*, CLIENT
*));
574 extern nis_result
* nis_add_3_svc
__P ((ns_request
*, struct svc_req
*));
575 #define NIS_MODIFY ((u_long)3)
576 extern nis_result
* nis_modify_3
__P ((ns_request
*, CLIENT
*));
577 extern nis_result
* nis_modify_3_svc
__P ((ns_request
*, struct svc_req
*));
578 #define NIS_REMOVE ((u_long)4)
579 extern nis_result
* nis_remove_3
__P ((ns_request
*, CLIENT
*));
580 extern nis_result
* nis_remove_3_svc
__P ((ns_request
*, struct svc_req
*));
581 #define NIS_IBLIST ((u_long)5)
582 extern nis_result
* nis_iblist_3
__P ((ib_request
*, CLIENT
*));
583 extern nis_result
* nis_iblist_3_svc
__P ((ib_request
*, struct svc_req
*));
584 #define NIS_IBADD ((u_long)6)
585 extern nis_result
* nis_ibadd_3
__P ((ib_request
*, CLIENT
*));
586 extern nis_result
* nis_ibadd_3_svc
__P ((ib_request
*, struct svc_req
*));
587 #define NIS_IBMODIFY ((u_long)7)
588 extern nis_result
* nis_ibmodify_3
__P ((ib_request
*, CLIENT
*));
589 extern nis_result
* nis_ibmodify_3_svc
__P ((ib_request
*, struct svc_req
*));
590 #define NIS_IBREMOVE ((u_long)8)
591 extern nis_result
* nis_ibremove_3
__P ((ib_request
*, CLIENT
*));
592 extern nis_result
* nis_ibremove_3_svc
__P ((ib_request
*, struct svc_req
*));
593 #define NIS_IBFIRST ((u_long)9)
594 extern nis_result
* nis_ibfirst_3
__P ((ib_request
*, CLIENT
*));
595 extern nis_result
* nis_ibfirst_3_svc
__P ((ib_request
*, struct svc_req
*));
596 #define NIS_IBNEXT ((u_long)10)
597 extern nis_result
* nis_ibnext_3
__P ((ib_request
*, CLIENT
*));
598 extern nis_result
* nis_ibnext_3_svc
__P ((ib_request
*, struct svc_req
*));
599 #define NIS_FINDDIRECTORY ((u_long)12)
600 extern fd_result
* nis_finddirectory_3
__P ((fd_args
*, CLIENT
*));
601 extern fd_result
* nis_finddirectory_3_svc
__P ((fd_args
*,
603 #define NIS_STATUS ((u_long)14)
604 extern nis_taglist
* nis_status_3
__P ((nis_taglist
*, CLIENT
*));
605 extern nis_taglist
* nis_status_3_svc
__P ((nis_taglist
*, struct svc_req
*));
606 #define NIS_DUMPLOG ((u_long)15)
607 extern log_result
* nis_dumplog_3
__P ((dump_args
*, CLIENT
*));
608 extern log_result
* nis_dumplog_3_svc
__P ((dump_args
*, struct svc_req
*));
609 #define NIS_DUMP ((u_long)16)
610 extern log_result
* nis_dump_3
__P ((dump_args
*, CLIENT
*));
611 extern log_result
* nis_dump_3_svc
__P ((dump_args
*, struct svc_req
*));
612 #define NIS_CALLBACK ((u_long)17)
613 extern bool_t
* nis_callback_3
__P ((netobj
*, CLIENT
*));
614 extern bool_t
* nis_callback_3_svc
__P ((netobj
*, struct svc_req
*));
615 #define NIS_CPTIME ((u_long)18)
616 extern u_long
* nis_cptime_3
__P ((nis_name
*, CLIENT
*));
617 extern u_long
* nis_cptime_3_svc
__P ((nis_name
*, struct svc_req
*));
618 #define NIS_CHECKPOINT ((u_long)19)
619 extern cp_result
* nis_checkpoint_3
__P ((nis_name
*, CLIENT
*));
620 extern cp_result
* nis_checkpoint_3_svc
__P ((nis_name
*, struct svc_req
*));
621 #define NIS_PING ((u_long)20)
622 extern void * nis_ping_3
__P ((ping_args
*, CLIENT
*));
623 extern void * nis_ping_3_svc
__P ((ping_args
*, struct svc_req
*));
624 #define NIS_SERVSTATE ((u_long)21)
625 extern nis_taglist
* nis_servstate_3
__P ((nis_taglist
*, CLIENT
*));
626 extern nis_taglist
* nis_servstate_3_svc
__P ((nis_taglist
*,
628 #define NIS_MKDIR ((u_long)22)
629 extern nis_error
* nis_mkdir_3
__P ((nis_name
*, CLIENT
*));
630 extern nis_error
* nis_mkdir_3_svc
__P ((nis_name
*, struct svc_req
*));
631 #define NIS_RMDIR ((u_long)23)
632 extern nis_error
* nis_rmdir_3
__P ((nis_name
*, CLIENT
*));
633 extern nis_error
* nis_rmdir_3_svc
__P ((nis_name
*, struct svc_req
*));
634 #define NIS_UPDKEYS ((u_long)24)
635 extern nis_error
* nis_updkeys_3
__P ((nis_name
*, CLIENT
*));
636 extern nis_error
* nis_updkeys_3_svc
__P ((nis_name
*, struct svc_req
*));
640 #endif /* !_NIS_H_RPCGEN */