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.
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
75 #define NIS_PK_DHEXT 4
84 typedef struct nis_attr nis_attr
;
86 typedef char *nis_name
;
99 NIS_DIRECTORY_OBJ
= 2,
106 typedef enum zotypes zotypes
;
119 typedef enum nstype nstype
;
125 typedef struct oar_mask oar_mask
;
132 typedef struct endpoint endpoint
;
143 typedef struct nis_server nis_server
;
145 struct directory_obj
{
149 u_int do_servers_len
;
150 nis_server
*do_servers_val
;
155 oar_mask
*do_armask_val
;
158 typedef struct directory_obj directory_obj
;
163 #define EN_MODIFIED 8
173 typedef struct entry_col entry_col
;
179 entry_col
*en_cols_val
;
182 typedef struct entry_obj entry_obj
;
187 u_int gr_members_len
;
188 nis_name
*gr_members_val
;
191 typedef struct group_obj group_obj
;
197 nis_attr
*li_attrs_val
;
201 typedef struct link_obj link_obj
;
206 #define TA_SEARCHABLE 8
208 #define TA_MODIFIED 32
216 typedef struct table_col table_col
;
224 table_col
*ta_cols_val
;
228 typedef struct table_obj table_obj
;
233 struct directory_obj di_data
;
234 struct group_obj gr_data
;
235 struct table_obj ta_data
;
236 struct entry_obj en_data
;
237 struct link_obj li_data
;
244 typedef struct objdata objdata
;
250 typedef struct nis_oid nis_oid
;
262 typedef struct nis_object nis_object
;
264 #endif /* if __nis_object_h */
271 NIS_CACHEEXPIRED
= 4,
272 NIS_NAMEUNREACHABLE
= 5,
290 NIS_NOSUCHTABLE
= 23,
291 NIS_TYPEMISMATCH
= 24,
292 NIS_LINKNAMEERROR
= 25,
294 NIS_TOOMANYATTRS
= 27,
296 NIS_BADATTRIBUTE
= 29,
297 NIS_NOTSEARCHABLE
= 30,
305 NIS_COLDSTART_ERR
= 38,
312 NIS_NOFILESPACE
= 45,
316 typedef enum nis_error nis_error
;
322 nis_object
*objects_val
;
330 typedef struct nis_result nis_result
;
336 nis_object
*ns_object_val
;
339 typedef struct ns_request ns_request
;
345 nis_attr
*ibr_srch_val
;
350 nis_object
*ibr_obj_val
;
353 u_int ibr_cbhost_len
;
354 nis_server
*ibr_cbhost_val
;
359 typedef struct ib_request ib_request
;
365 typedef struct ping_args ping_args
;
378 typedef enum log_entry_t log_entry_t
;
387 nis_attr
*le_attrs_val
;
389 nis_object le_object
;
391 typedef struct log_entry log_entry
;
397 u_int lr_entries_len
;
398 log_entry
*lr_entries_val
;
401 typedef struct log_result log_result
;
408 typedef struct cp_result cp_result
;
414 typedef struct nis_tag nis_tag
;
422 typedef struct nis_taglist nis_taglist
;
429 nis_server
*da_cbhost_val
;
432 typedef struct dump_args dump_args
;
438 typedef struct fd_args fd_args
;
452 typedef struct fd_result fd_result
;
454 /* Generic client creating flags */
459 /* Testing Access rights for objects */
461 #define NIS_READ_ACC 1
462 #define NIS_MODIFY_ACC 2
463 #define NIS_CREATE_ACC 4
464 #define NIS_DESTROY_ACC 8
465 /* Test macros. a == access rights, m == desired rights. */
466 #define NIS_WORLD(a, m) (((a) & (m)) != 0)
467 #define NIS_GROUP(a, m) (((a) & ((m) << 8)) != 0)
468 #define NIS_OWNER(a, m) (((a) & ((m) << 16)) != 0)
469 #define NIS_NOBODY(a, m) (((a) & ((m) << 24)) != 0)
471 * EOL Alert - The following non-prefixed test macros are
472 * here for backward compatability, and will be not be present
473 * in future releases - use the NIS_*() macros above.
475 #define WORLD(a, m) (((a) & (m)) != 0)
476 #define GROUP(a, m) (((a) & ((m) << 8)) != 0)
477 #define OWNER(a, m) (((a) & ((m) << 16)) != 0)
478 #define NOBODY(a, m) (((a) & ((m) << 24)) != 0)
480 #define OATYPE(d, n) (((d)->do_armask.do_armask_val+n)->oa_otype)
481 #define OARIGHTS(d, n) (((d)->do_armask.do_armask_val+n)->oa_rights)
482 #define WORLD_DEFAULT (NIS_READ_ACC)
483 #define GROUP_DEFAULT (NIS_READ_ACC << 8)
484 #define OWNER_DEFAULT ((NIS_READ_ACC + NIS_MODIFY_ACC + NIS_CREATE_ACC +\
485 NIS_DESTROY_ACC) << 16)
486 #define DEFAULT_RIGHTS (WORLD_DEFAULT | GROUP_DEFAULT | OWNER_DEFAULT)
488 /* Result manipulation defines ... */
489 #define NIS_RES_NUMOBJ(x) ((x)->objects.objects_len)
490 #define NIS_RES_OBJECT(x) ((x)->objects.objects_val)
491 #define NIS_RES_COOKIE(x) ((x)->cookie)
492 #define NIS_RES_STATUS(x) ((x)->status)
494 /* These defines make getting at the variant part of the object easier. */
495 #define TA_data zo_data.objdata_u.ta_data
496 #define EN_data zo_data.objdata_u.en_data
497 #define DI_data zo_data.objdata_u.di_data
498 #define LI_data zo_data.objdata_u.li_data
499 #define GR_data zo_data.objdata_u.gr_data
501 #define __type_of(o) ((o)->zo_data.zo_type)
503 /* Declarations for the internal subroutines in nislib.c */
504 enum name_pos
{SAME_NAME
, HIGHER_NAME
, LOWER_NAME
, NOT_SEQUENTIAL
, BAD_NAME
};
505 typedef enum name_pos name_pos
;
508 * Defines for getting at column data in entry objects. Because RPCGEN
509 * generates some rather wordy structures, we create some defines that
510 * collapse the needed keystrokes to access a particular value using
511 * these definitions they take an nis_object *, and an int and return
512 * a u_char * for Value, and an int for length.
514 #define ENTRY_VAL(obj, col) (obj)->EN_data.en_cols.en_cols_val[col].ec_value.ec_value_val
515 #define ENTRY_LEN(obj, col) (obj)->EN_data.en_cols.en_cols_val[col].ec_value.ec_value_len
518 /* Prototypes, and extern declarations for the NIS library functions. */
519 #include <rpcsvc/nislib.h>
525 * This file contains definitions that are only of interest to the actual
526 * service daemon and client stubs. Normal users of NIS will not include
529 * NOTE : This include file is automatically created by a combination
530 * of rpcgen and sed. DO NOT EDIT IT, change the nis.x file instead
531 * and then remake this file.
536 #define NIS_PROG 100300
537 #define NIS_VERSION 3
540 extern nis_result
* nis_lookup_3 (ns_request
*, CLIENT
*) __THROW
;
541 extern nis_result
* nis_lookup_3_svc (ns_request
*, struct svc_req
*) __THROW
;
543 extern nis_result
* nis_add_3 (ns_request
*, CLIENT
*) __THROW
;
544 extern nis_result
* nis_add_3_svc (ns_request
*, struct svc_req
*) __THROW
;
546 extern nis_result
* nis_modify_3 (ns_request
*, CLIENT
*) __THROW
;
547 extern nis_result
* nis_modify_3_svc (ns_request
*, struct svc_req
*) __THROW
;
549 extern nis_result
* nis_remove_3 (ns_request
*, CLIENT
*) __THROW
;
550 extern nis_result
* nis_remove_3_svc (ns_request
*, struct svc_req
*) __THROW
;
552 extern nis_result
* nis_iblist_3 (ib_request
*, CLIENT
*) __THROW
;
553 extern nis_result
* nis_iblist_3_svc (ib_request
*, struct svc_req
*) __THROW
;
555 extern nis_result
* nis_ibadd_3 (ib_request
*, CLIENT
*) __THROW
;
556 extern nis_result
* nis_ibadd_3_svc (ib_request
*, struct svc_req
*) __THROW
;
557 #define NIS_IBMODIFY 7
558 extern nis_result
* nis_ibmodify_3 (ib_request
*, CLIENT
*) __THROW
;
559 extern nis_result
* nis_ibmodify_3_svc (ib_request
*, struct svc_req
*)
561 #define NIS_IBREMOVE 8
562 extern nis_result
* nis_ibremove_3 (ib_request
*, CLIENT
*) __THROW
;
563 extern nis_result
* nis_ibremove_3_svc (ib_request
*, struct svc_req
*)
565 #define NIS_IBFIRST 9
566 extern nis_result
* nis_ibfirst_3 (ib_request
*, CLIENT
*) __THROW
;
567 extern nis_result
* nis_ibfirst_3_svc (ib_request
*, struct svc_req
*)
569 #define NIS_IBNEXT 10
570 extern nis_result
* nis_ibnext_3 (ib_request
*, CLIENT
*) __THROW
;
571 extern nis_result
* nis_ibnext_3_svc (ib_request
*, struct svc_req
*) __THROW
;
572 #define NIS_FINDDIRECTORY 12
573 extern fd_result
* nis_finddirectory_3 (fd_args
*, CLIENT
*) __THROW
;
574 extern fd_result
* nis_finddirectory_3_svc (fd_args
*,
575 struct svc_req
*) __THROW
;
576 #define NIS_STATUS 14
577 extern nis_taglist
* nis_status_3 (nis_taglist
*, CLIENT
*) __THROW
;
578 extern nis_taglist
* nis_status_3_svc (nis_taglist
*, struct svc_req
*)
580 #define NIS_DUMPLOG 15
581 extern log_result
* nis_dumplog_3 (dump_args
*, CLIENT
*) __THROW
;
582 extern log_result
* nis_dumplog_3_svc (dump_args
*, struct svc_req
*) __THROW
;
584 extern log_result
* nis_dump_3 (dump_args
*, CLIENT
*) __THROW
;
585 extern log_result
* nis_dump_3_svc (dump_args
*, struct svc_req
*) __THROW
;
586 #define NIS_CALLBACK 17
587 extern bool_t
* nis_callback_3 (netobj
*, CLIENT
*) __THROW
;
588 extern bool_t
* nis_callback_3_svc (netobj
*, struct svc_req
*) __THROW
;
589 #define NIS_CPTIME 18
590 extern uint32_t * nis_cptime_3 (nis_name
*, CLIENT
*) __THROW
;
591 extern uint32_t * nis_cptime_3_svc (nis_name
*, struct svc_req
*) __THROW
;
592 #define NIS_CHECKPOINT 19
593 extern cp_result
* nis_checkpoint_3 (nis_name
*, CLIENT
*) __THROW
;
594 extern cp_result
* nis_checkpoint_3_svc (nis_name
*, struct svc_req
*)
597 extern void * nis_ping_3 (ping_args
*, CLIENT
*) __THROW
;
598 extern void * nis_ping_3_svc (ping_args
*, struct svc_req
*) __THROW
;
599 #define NIS_SERVSTATE 21
600 extern nis_taglist
* nis_servstate_3 (nis_taglist
*, CLIENT
*) __THROW
;
601 extern nis_taglist
* nis_servstate_3_svc (nis_taglist
*,
602 struct svc_req
*) __THROW
;
604 extern nis_error
* nis_mkdir_3 (nis_name
*, CLIENT
*) __THROW
;
605 extern nis_error
* nis_mkdir_3_svc (nis_name
*, struct svc_req
*) __THROW
;
607 extern nis_error
* nis_rmdir_3 (nis_name
*, CLIENT
*) __THROW
;
608 extern nis_error
* nis_rmdir_3_svc (nis_name
*, struct svc_req
*) __THROW
;
609 #define NIS_UPDKEYS 24
610 extern nis_error
* nis_updkeys_3 (nis_name
*, CLIENT
*) __THROW
;
611 extern nis_error
* nis_updkeys_3_svc (nis_name
*, struct svc_req
*) __THROW
;
615 #endif /* ! _RPCSVC_NIS_H */