Home | History | Annotate | Download | only in rpcsvc
      1  0  stevel /*
      2  0  stevel  * CDDL HEADER START
      3  0  stevel  *
      4  0  stevel  * The contents of this file are subject to the terms of the
      5  0  stevel  * Common Development and Distribution License, Version 1.0 only
      6  0  stevel  * (the "License").  You may not use this file except in compliance
      7  0  stevel  * with the License.
      8  0  stevel  *
      9  0  stevel  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
     10  0  stevel  * or http://www.opensolaris.org/os/licensing.
     11  0  stevel  * See the License for the specific language governing permissions
     12  0  stevel  * and limitations under the License.
     13  0  stevel  *
     14  0  stevel  * When distributing Covered Code, include this CDDL HEADER in each
     15  0  stevel  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
     16  0  stevel  * If applicable, add the following below this CDDL HEADER, with the
     17  0  stevel  * fields enclosed by brackets "[]" replaced with your own identifying
     18  0  stevel  * information: Portions Copyright [yyyy] [name of copyright owner]
     19  0  stevel  *
     20  0  stevel  * CDDL HEADER END
     21  0  stevel  */
     22  0  stevel /*
     23  0  stevel  * RPC Language Protocol description file for NIS Plus
     24  0  stevel  *
     25  0  stevel  * Copyright 2004 Sun Microsystems, Inc.  All rights reserved.
     26  0  stevel  * Use is subject to license terms.
     27  0  stevel  *
     28  0  stevel  * ident	"%Z%%M%	%I%	%E% SMI"
     29  0  stevel  *
     30  0  stevel  * From 4.1 : @(#)nis.x	1.61 Copyright 1989 Sun Microsystems
     31  0  stevel  */
     32  0  stevel #ifdef RPC_HDR
     33  0  stevel %/*
     34  0  stevel % *	nis.h
     35  0  stevel % *
     36  0  stevel % *	This file is the main include file for NIS clients. It contains
     37  0  stevel % *	both the client library function defines and the various data
     38  0  stevel % * 	structures used by the NIS service. It includes the file nis_tags.h
     39  0  stevel % *	which defines the tag values. This allows the tags to change without
     40  0  stevel % *	having to change the nis.x file.
     41  0  stevel % *
     42  0  stevel % *	NOTE : DO NOT EDIT THIS FILE! It is automatically generated when
     43  0  stevel % *	       rpcgen is run on the nis.x file. Note that there is a
     44  0  stevel % *	       simple sed script to remove some unneeded lines. (See the
     45  0  stevel % *	       Makefile target nis.h)
     46  0  stevel % *
     47  0  stevel % */
     48  0  stevel %#include <rpcsvc/nis_tags.h>
     49  0  stevel #endif
     50  0  stevel 
     51  0  stevel /* This gets stuffed into the source files. */
     52  0  stevel #if RPC_HDR
     53  0  stevel %#include <rpc/xdr.h>
     54  0  stevel #endif
     55  0  stevel #if defined(RPC_XDR) || defined(RPC_CLNT) || defined(RPC_SVC)
     56  0  stevel %#ifndef xdr_uint32_t
     57  0  stevel %#define xdr_uint32_t	xdr_u_int
     58  0  stevel %#endif
     59  0  stevel %#ifndef xdr_uint_t
     60  0  stevel %#define xdr_uint_t	xdr_u_int
     61  0  stevel %#endif
     62  0  stevel #endif
     63  0  stevel #if RPC_SVC
     64  0  stevel %#include "nis_svc.h"
     65  0  stevel #endif
     66  0  stevel 
     67  0  stevel /* Include the RPC Language description of NIS objects */
     68  0  stevel #include "nis_object.x"
     69  0  stevel 
     70  0  stevel /* Errors  that can be returned by the service */
     71  0  stevel enum nis_error {
     72  0  stevel 	NIS_SUCCESS = 0,	/* A-ok, let's rock n roll 	*/
     73  0  stevel 	NIS_S_SUCCESS = 1,	/* Name found (maybe)	   	*/
     74  0  stevel 	NIS_NOTFOUND = 2,	/* Name definitely not found 	*/
     75  0  stevel 	NIS_S_NOTFOUND = 3,	/* Name maybe not found 	*/
     76  0  stevel 	NIS_CACHEEXPIRED = 4,	/* Name exists but cache out of date */
     77  0  stevel 	NIS_NAMEUNREACHABLE = 5, /* Can't get there from here */
     78  0  stevel 	NIS_UNKNOWNOBJ = 6,	/* Object type is bogus */
     79  0  stevel 	NIS_TRYAGAIN = 7,	/* I'm busy, call back */
     80  0  stevel 	NIS_SYSTEMERROR = 8,	/* Generic system error */
     81  0  stevel 	NIS_CHAINBROKEN = 9,	/* First/Next warning */
     82  0  stevel 	NIS_PERMISSION = 10,	/* Not enough permission to access */
     83  0  stevel 	NIS_NOTOWNER = 11,	/* You don't own it, sorry */
     84  0  stevel 	NIS_NOT_ME = 12,	/* I don't serve this name */
     85  0  stevel 	NIS_NOMEMORY = 13,	/* Outta VM! Help! */
     86  0  stevel 	NIS_NAMEEXISTS = 14,	/* Can't create over another name */
     87  0  stevel 	NIS_NOTMASTER = 15,	/* I'm justa secondaray, don't ask me */
     88  0  stevel 	NIS_INVALIDOBJ = 16,	/* Object is broken somehow */
     89  0  stevel 	NIS_BADNAME = 17,	/* Unparsable name */
     90  0  stevel 	NIS_NOCALLBACK = 18,	/* Couldn't talk to call back proc */
     91  0  stevel 	NIS_CBRESULTS = 19,	/* Results being called back to you */
     92  0  stevel 	NIS_NOSUCHNAME = 20,	/* Name unknown */
     93  0  stevel 	NIS_NOTUNIQUE = 21,	/* Value is not uniques (entry) */
     94  0  stevel 	NIS_IBMODERROR = 22,	/* Inf. Base. Modify error. */
     95  0  stevel 	NIS_NOSUCHTABLE = 23,	/* Name for table was wrong */
     96  0  stevel 	NIS_TYPEMISMATCH = 24, 	/* Entry and table type mismatch */
     97  0  stevel 	NIS_LINKNAMEERROR = 25,	/* Link points to bogus name */
     98  0  stevel 	NIS_PARTIAL = 26,	/* Partial success, found table */
     99  0  stevel 	NIS_TOOMANYATTRS = 27,	/* Too many attributes */
    100  0  stevel 	NIS_RPCERROR = 28,	/* RPC error encountered */
    101  0  stevel 	NIS_BADATTRIBUTE = 29,	/* Bad or invalid attribute */
    102  0  stevel 	NIS_NOTSEARCHABLE = 30,	/* Non-searchable object searched */
    103  0  stevel 	NIS_CBERROR = 31,	/* Error during callback (svc crash) */
    104  0  stevel 	NIS_FOREIGNNS = 32,	/* Foreign Namespace */
    105  0  stevel 	NIS_BADOBJECT = 33,	/* Malformed object structure */
    106  0  stevel 	NIS_NOTSAMEOBJ = 34,	/* Object swapped during deletion */
    107  0  stevel 	NIS_MODFAIL = 35,	/* Failure during a Modify. */
    108  0  stevel 	NIS_BADREQUEST = 36,	/* Illegal query for table */
    109  0  stevel 	NIS_NOTEMPTY = 37,	/* Attempt to remove a non-empty tbl */
    110  0  stevel 	NIS_COLDSTART_ERR = 38, /* Error accesing the cold start file */
    111  0  stevel 	NIS_RESYNC = 39,	/* Transaction log too far out of date */
    112  0  stevel 	NIS_FAIL = 40,		/* NIS operation failed. */
    113  0  stevel 	NIS_UNAVAIL = 41,	/* NIS+ service is unavailable (client) */
    114  0  stevel 	NIS_RES2BIG = 42,	/* NIS+ result too big for datagram */
    115  0  stevel 	NIS_SRVAUTH = 43,	/* NIS+ server wasn't authenticated. */
    116  0  stevel 	NIS_CLNTAUTH = 44,	/* NIS+ Client wasn't authenticated. */
    117  0  stevel 	NIS_NOFILESPACE = 45,	/* NIS+ server ran out of disk space */
    118  0  stevel 	NIS_NOPROC = 46,	/* NIS+ server couldn't create new proc */
    119  0  stevel 	NIS_DUMPLATER = 47	/* NIS+ server already has dump child */
    120  0  stevel };
    121  0  stevel 
    122  0  stevel 
    123  0  stevel /*
    124  0  stevel  * Structure definitions for the parameters and results of the actual
    125  0  stevel  * NIS RPC calls.
    126  0  stevel  *
    127  0  stevel  * This is the standard result (in the protocol) of most of the nis
    128  0  stevel  * requests.
    129  0  stevel  */
    130  0  stevel 
    131  0  stevel struct nis_result {
    132  0  stevel 	nis_error	status;		/* Status of the response */
    133  0  stevel 	nis_object	objects<>;	/* objects found 	  */
    134  0  stevel 	netobj		cookie;		/* Cookie Data 		  */
    135  0  stevel 	uint32_t	zticks;		/* server ticks	 	  */
    136  0  stevel 	uint32_t	dticks;		/* DBM ticks.		  */
    137  0  stevel 	uint32_t	aticks;		/* Cache (accel) ticks	  */
    138  0  stevel 	uint32_t	cticks;		/* Client ticks		  */
    139  0  stevel };
    140  0  stevel 
    141  0  stevel /*
    142  0  stevel  * A Name Service request
    143  0  stevel  * This request is used to access the name space, ns_name is the name
    144  0  stevel  * of the object within the namespace and the object is it's value, for
    145  0  stevel  * add/modify, a copy of the original for remove.
    146  0  stevel  */
    147  0  stevel 
    148  0  stevel struct ns_request {
    149  0  stevel 	nis_name	ns_name;	/* Name in the NIS name space	*/
    150  0  stevel 	nis_object	ns_object<1>;	/* Optional Object (add/remove)	*/
    151  0  stevel };
    152  0  stevel 
    153  0  stevel /*
    154  0  stevel  * An information base request
    155  0  stevel  * This request includes the NIS name of the table we wish to search, the
    156  0  stevel  * search criteria in the form of attribute/value pairs and an optional
    157  0  stevel  * callback program number. If the callback program number is provided
    158  0  stevel  * the server will send back objects one at a time, otherwise it will
    159  0  stevel  * return them all in the response.
    160  0  stevel  */
    161  0  stevel 
    162  0  stevel struct ib_request {
    163  0  stevel 	nis_name  	ibr_name;	/* The name of the Table 	*/
    164  0  stevel 	nis_attr  	ibr_srch<>; 	/* The search critereia 	*/
    165  0  stevel 	u_int		ibr_flags;	/* Optional flags 		*/
    166  0  stevel 	nis_object	ibr_obj<1>;	/* optional object (add/modify) */
    167  0  stevel 	nis_server	ibr_cbhost<1>;	/* Optional callback info	*/
    168  0  stevel 	u_int		ibr_bufsize;	/* Optional first/next bufsize	*/
    169  0  stevel 	netobj		ibr_cookie;	/* The first/next cookie	*/
    170  0  stevel };
    171  0  stevel 
    172  0  stevel /*
    173  0  stevel  * This argument to the PING call notifies the replicas that something in
    174  0  stevel  * a directory has changed and this is it's timestamp. The replica will use
    175  0  stevel  * the timestamp to determine if its resync operation was successful.
    176  0  stevel  */
    177  0  stevel struct ping_args {
    178  0  stevel 	nis_name	dir;	/* Directory that had the change */
    179  0  stevel 	uint32_t	stamp;	/* timestamp of the transaction  */
    180  0  stevel };
    181  0  stevel 
    182  0  stevel /*
    183  0  stevel  * These are the type of entries that are stored in the transaction log,
    184  0  stevel  * note that modifications will appear as two entries, for names, they have
    185  0  stevel  * a "OLD" entry followed by a "NEW" entry. For entries in tables, there
    186  0  stevel  * is a remove followed by an add. It is done this way so that we can read
    187  0  stevel  * the log backwards to back out transactions and forwards to propogate
    188  0  stevel  * updated.
    189  0  stevel  */
    190  0  stevel enum log_entry_t {
    191  0  stevel 	LOG_NOP = 0,
    192  0  stevel 	ADD_NAME = 1,		/* Name Added to name space 		  */
    193  0  stevel 	REM_NAME = 2,		/* Name removed from name space 	  */
    194  0  stevel 	MOD_NAME_OLD = 3,	/* Name was modified in the name space 	  */
    195  0  stevel 	MOD_NAME_NEW = 4,	/* Name was modified in the name space 	  */
    196  0  stevel 	ADD_IBASE = 5,		/* Entry added to information base 	  */
    197  0  stevel 	REM_IBASE = 6,		/* Entry removed from information base    */
    198  0  stevel 	MOD_IBASE = 7,		/* Entry was modified in information base */
    199  0  stevel 	UPD_STAMP = 8		/* Update timestamp (used as fenceposts)  */
    200  0  stevel };
    201  0  stevel 
    202  0  stevel /*
    203  0  stevel  * This result is returned from the name service when it is requested to
    204  0  stevel  * dump logged entries from its transaction log. Information base updates
    205  0  stevel  * will have the name of the information base in the le_name field and
    206  0  stevel  * a canonical set of attribute/value pairs to fully specify the entry's
    207  0  stevel  * 'name'.
    208  0  stevel  */
    209  0  stevel struct log_entry {
    210  0  stevel 	uint32_t	le_time;	/* Time in seconds 		*/
    211  0  stevel 	log_entry_t	le_type;	/* Type of log entry 		*/
    212  0  stevel 	nis_name	le_princp;	/* Principal making the change	*/
    213  0  stevel 	nis_name	le_name;	/* Name of table/dir involved 	*/
    214  0  stevel 	nis_attr	le_attrs<>;	/* List of AV pairs.		*/
    215  0  stevel 	nis_object	le_object;	/* Actual object value 		*/
    216  0  stevel };
    217  0  stevel 
    218  0  stevel struct log_result {
    219  0  stevel 	nis_error 	lr_status;	/* The status itself 	 	*/
    220  0  stevel 	netobj		lr_cookie;	/* Used by the dump callback	*/
    221  0  stevel 	log_entry	lr_entries<>;	/* zero or more entries 	*/
    222  0  stevel };
    223  0  stevel 
    224  0  stevel struct cp_result {
    225  0  stevel 	nis_error	cp_status;	/* Status of the checkpoint 	*/
    226  0  stevel 	uint32_t	cp_zticks;	/* Service 'ticks' 	    	*/
    227  0  stevel 	uint32_t	cp_dticks;	/* Database 'ticks'	    	*/
    228  0  stevel };
    229  0  stevel 
    230  0  stevel /*
    231  0  stevel  * This structure defines a generic NIS tag list. The taglist contains
    232  0  stevel  * zero or tags, each of which is a type and a value. (u_int).
    233  0  stevel  * These are used to report statistics (see tag definitions below)
    234  0  stevel  * and to set or reset state variables.
    235  0  stevel  */
    236  0  stevel struct nis_tag {
    237  0  stevel 	u_int	tag_type;	/* Statistic tag (may vary) 	 */
    238  0  stevel 	string	tag_val<>;	/* Statistic value may also vary */
    239  0  stevel };
    240  0  stevel 
    241  0  stevel struct nis_taglist {
    242  0  stevel 	nis_tag tags<>;		/* List of tags */
    243  0  stevel };
    244  0  stevel 
    245  0  stevel struct dump_args {
    246  0  stevel 	nis_name	da_dir;		/* Directory to dump 	*/
    247  0  stevel 	uint32_t	da_time;	/* From this timestamp	*/
    248  0  stevel 	nis_server	da_cbhost<1>;	/* Callback to use.	*/
    249  0  stevel };
    250  0  stevel 
    251  0  stevel struct fd_args {
    252  0  stevel 	nis_name	dir_name;  /* The directory we're looking for */
    253  0  stevel 	nis_name	requester; /* Host principal name for signature */
    254  0  stevel };
    255  0  stevel 
    256  0  stevel struct fd_result {
    257  0  stevel 	nis_error	status;		/* Status returned by function	*/
    258  0  stevel 	nis_name	source;		/* Source of this answer   	*/
    259  0  stevel 	opaque		dir_data<>;	/* Directory Data (XDR'ed) 	*/
    260  0  stevel 	opaque		signature<>;	/* Signature of the source 	*/
    261  0  stevel };
    262  0  stevel 
    263  0  stevel %/*
    264  0  stevel % * Structures used for server binding.
    265  0  stevel % */
    266  0  stevel struct nis_bound_endpoint {
    267  0  stevel 	endpoint ep;
    268  0  stevel 	int generation;
    269  0  stevel 	int rank;
    270  0  stevel 	u_int flags;
    271  0  stevel 	int hostnum;
    272  0  stevel 	int epnum;
    273  0  stevel 	nis_name uaddr;
    274  0  stevel 	endpoint cbep;
    275  0  stevel };
    276  0  stevel typedef struct nis_bound_endpoint nis_bound_endpoint;
    277  0  stevel 
    278  0  stevel struct nis_bound_directory {
    279  0  stevel 	int generation;
    280  0  stevel 	int min_rank;           /* minimum rank of bound endpoints */
    281  0  stevel 	int optimal_rank;       /* best possible rank of all endpoints */
    282  0  stevel 	directory_obj dobj;
    283  0  stevel 	nis_bound_endpoint BEP<>;
    284  0  stevel };
    285  0  stevel typedef struct nis_bound_directory nis_bound_directory;
    286  0  stevel %#define bep_len BEP.BEP_len
    287  0  stevel %#define bep_val BEP.BEP_val
    288  0  stevel 
    289  0  stevel struct nis_active_endpoint {
    290  0  stevel 	endpoint ep;
    291  0  stevel 	nis_name hostname;
    292  0  stevel 	int rank;
    293  0  stevel 	int uaddr_generation;
    294  0  stevel 	nis_name uaddr;
    295  0  stevel 	int cbep_generation;
    296  0  stevel 	endpoint cbep;
    297  0  stevel };
    298  0  stevel typedef struct nis_active_endpoint nis_active_endpoint;
    299  0  stevel 
    300  0  stevel %/* defines for nis_bound_endpoint.flags */
    301  0  stevel %#define NIS_BOUND 0x1
    302  0  stevel %#define NIS_TRANSIENT_ERRORS 0x2
    303  0  stevel 
    304  0  stevel 
    305  0  stevel 
    306  0  stevel /*
    307  0  stevel  * What's going on here? Well, it's like this. When the service
    308  0  stevel  * is being compiled it wants to have the service definition specific
    309  0  stevel  * info included, and when the client is being compiled it wants that
    310  0  stevel  * info. This includes the appropriate file which was generated by
    311  0  stevel  * make in the protocols directory (probably /usr/include/rpcsvc).
    312  0  stevel  */
    313  0  stevel #ifdef RPC_SVC
    314  0  stevel %#include "nis_svc.h"
    315  0  stevel #endif
    316  0  stevel #ifdef RPC_CLNT
    317  0  stevel %#include "nis_clnt.h"
    318  0  stevel #endif
    319  0  stevel 
    320  0  stevel program  NIS_PROG {
    321  0  stevel 
    322  0  stevel 	/* RPC Language description of the NIS+ protocol */
    323  0  stevel 	version NIS_VERSION {
    324  0  stevel 		/* The name service functions */
    325  0  stevel 		nis_result  NIS_LOOKUP(ns_request) = 1;
    326  0  stevel 		nis_result  NIS_ADD(ns_request) = 2;
    327  0  stevel 		nis_result  NIS_MODIFY(ns_request) = 3;
    328  0  stevel 		nis_result  NIS_REMOVE(ns_request) = 4;
    329  0  stevel 
    330  0  stevel 		/* The information base functions */
    331  0  stevel 		nis_result  NIS_IBLIST(ib_request) = 5;
    332  0  stevel 		nis_result  NIS_IBADD(ib_request) = 6;
    333  0  stevel 		nis_result  NIS_IBMODIFY(ib_request) = 7;
    334  0  stevel 		nis_result  NIS_IBREMOVE(ib_request) = 8;
    335  0  stevel 		nis_result  NIS_IBFIRST(ib_request) = 9;
    336  0  stevel 		nis_result  NIS_IBNEXT(ib_request) = 10;
    337  0  stevel 
    338  0  stevel 		/* NIS Administrative functions */
    339  0  stevel 		fd_result   NIS_FINDDIRECTORY(fd_args) = 12;
    340  0  stevel 
    341  0  stevel 		/* If fetch and optionally reset statistics */
    342  0  stevel 		nis_taglist  NIS_STATUS(nis_taglist) = 14;
    343  0  stevel 
    344  0  stevel 		/* Dump changes to directory since time in da_time */
    345  0  stevel 		log_result  NIS_DUMPLOG(dump_args) = 15;
    346  0  stevel 
    347  0  stevel 		/* Dump contents of directory named */
    348  0  stevel 		log_result  NIS_DUMP(dump_args) = 16;
    349  0  stevel 
    350  0  stevel 		/* Check status of callback thread */
    351  0  stevel 		bool	    NIS_CALLBACK(netobj) = 17;
    352  0  stevel 
    353  0  stevel 		/* Return last update time for named dir */
    354  0  stevel 		uint32_t    NIS_CPTIME(nis_name) = 18;
    355  0  stevel 
    356  0  stevel 		/* Checkpoint directory or table named */
    357  0  stevel 		cp_result   NIS_CHECKPOINT(nis_name) = 19;
    358  0  stevel 
    359  0  stevel 		/* Send 'status changed' ping to replicates */
    360  0  stevel 		void	    NIS_PING(ping_args) = 20;
    361  0  stevel 
    362  0  stevel 		/* Modify server behaviour (such as debugging) */
    363  0  stevel 		nis_taglist NIS_SERVSTATE(nis_taglist) = 21;
    364  0  stevel 
    365  0  stevel 		/* Create a Directory */
    366  0  stevel 		nis_error   NIS_MKDIR(nis_name) = 22;
    367  0  stevel 
    368  0  stevel 		/* Remove a Directory */
    369  0  stevel 		nis_error   NIS_RMDIR(nis_name) = 23;
    370  0  stevel 
    371  0  stevel 		/* Update public keys of a directory object */
    372  0  stevel 		nis_error   NIS_UPDKEYS(nis_name) = 24;
    373  0  stevel 	} = 3;
    374  0  stevel } = 100300;
    375  0  stevel 
    376  0  stevel /*
    377  0  stevel  * Included below are the defines that become part of nis.h,
    378  0  stevel  * they are technically not part of the protocol, but do define
    379  0  stevel  * key aspects of the implementation and are therefore useful
    380  0  stevel  * in building a conforming server or client.
    381  0  stevel  */
    382  0  stevel #if RPC_HDR
    383  0  stevel %/*
    384  0  stevel % * Generic "hash" datastructures, used by all types of hashed data.
    385  0  stevel % */
    386  0  stevel %struct nis_hash_data {
    387  0  stevel %	nis_name		name;	   /* NIS name of hashed item      */
    388  0  stevel %	int			keychain;  /* It's hash key (for pop)      */
    389  0  stevel %	struct nis_hash_data	*next;	   /* Hash collision pointer       */
    390  0  stevel %	struct nis_hash_data	*prv_item; /* A serial, doubly linked list */
    391  0  stevel %	struct nis_hash_data	*nxt_item; /* of items in the hash table   */
    392  0  stevel %};
    393  0  stevel %typedef struct nis_hash_data NIS_HASH_ITEM;
    394  0  stevel %
    395  0  stevel %struct nis_hash_table {
    396  0  stevel %	NIS_HASH_ITEM	*keys[64];	/* A hash table of items           */
    397  0  stevel %	NIS_HASH_ITEM	*first;		/* The first "item" in serial list */
    398  0  stevel %};
    399  0  stevel %typedef struct nis_hash_table NIS_HASH_TABLE;
    400  0  stevel %
    401  0  stevel %/* Structure for storing dynamically allocated static data */
    402  0  stevel %struct nis_sdata {
    403  0  stevel %	void	*buf;	/* Memory allocation pointer 	*/
    404  0  stevel %	u_int	size;	/* Buffer size			*/
    405  0  stevel %};
    406  0  stevel %
    407  0  stevel %/* Generic client creating flags */
    408  0  stevel %#define ZMH_VC		1
    409  0  stevel %#define ZMH_DG		2
    410  0  stevel %#define ZMH_AUTH	4
    411  0  stevel %#define ZMH_NOFALLBACK 8
    412  0  stevel %
    413  0  stevel %/* Testing Access rights for objects */
    414  0  stevel %
    415  0  stevel %#define NIS_READ_ACC		1
    416  0  stevel %#define NIS_MODIFY_ACC		2
    417  0  stevel %#define NIS_CREATE_ACC		4
    418  0  stevel %#define NIS_DESTROY_ACC	8
    419  0  stevel %/* Test macros. a == access rights, m == desired rights. */
    420  0  stevel %#define NIS_WORLD(a, m)	(((a) & (m)) != 0)
    421  0  stevel %#define NIS_GROUP(a, m)	(((a) & ((m) << 8)) != 0)
    422  0  stevel %#define NIS_OWNER(a, m)	(((a) & ((m) << 16)) != 0)
    423  0  stevel %#define NIS_NOBODY(a, m)	(((a) & ((m) << 24)) != 0)
    424  0  stevel %/*
    425  0  stevel % * EOL Alert - The following non-prefixed test macros are
    426  0  stevel % * here for backward compatability, and will be not be present
    427  0  stevel % * in future releases - use the NIS_*() macros above.
    428  0  stevel % */
    429  0  stevel %#define WORLD(a, m)	(((a) & (m)) != 0)
    430  0  stevel %#define GROUP(a, m)	(((a) & ((m) << 8)) != 0)
    431  0  stevel %#define OWNER(a, m)	(((a) & ((m) << 16)) != 0)
    432  0  stevel %#define NOBODY(a, m)	(((a) & ((m) << 24)) != 0)
    433  0  stevel %
    434  0  stevel %#define OATYPE(d, n) (((d)->do_armask.do_armask_val+n)->oa_otype)
    435  0  stevel %#define OARIGHTS(d, n) (((d)->do_armask.do_armask_val+n)->oa_rights)
    436  0  stevel %#define WORLD_DEFAULT (NIS_READ_ACC)
    437  0  stevel %#define GROUP_DEFAULT (NIS_READ_ACC << 8)
    438  0  stevel %#define OWNER_DEFAULT ((NIS_READ_ACC +\
    439  0  stevel %			 NIS_MODIFY_ACC +\
    440  0  stevel %			 NIS_CREATE_ACC +\
    441  0  stevel %			 NIS_DESTROY_ACC) << 16)
    442  0  stevel %#define DEFAULT_RIGHTS (WORLD_DEFAULT | GROUP_DEFAULT | OWNER_DEFAULT)
    443  0  stevel %
    444  0  stevel %/* Result manipulation defines ... */
    445  0  stevel %#define NIS_RES_NUMOBJ(x)	((x)->objects.objects_len)
    446  0  stevel %#define NIS_RES_OBJECT(x)	((x)->objects.objects_val)
    447  0  stevel %#define NIS_RES_COOKIE(x)	((x)->cookie)
    448  0  stevel %#define NIS_RES_STATUS(x)	((x)->status)
    449  0  stevel %
    450  0  stevel %/* These defines make getting at the variant part of the object easier. */
    451  0  stevel %#define TA_data zo_data.objdata_u.ta_data
    452  0  stevel %#define EN_data zo_data.objdata_u.en_data
    453  0  stevel %#define DI_data zo_data.objdata_u.di_data
    454  0  stevel %#define LI_data zo_data.objdata_u.li_data
    455  0  stevel %#define GR_data zo_data.objdata_u.gr_data
    456  0  stevel %
    457  0  stevel %#define __type_of(o) ((o)->zo_data.zo_type)
    458  0  stevel %
    459  0  stevel %/* Declarations for the internal subroutines in nislib.c */
    460  0  stevel %enum name_pos {SAME_NAME, HIGHER_NAME, LOWER_NAME, NOT_SEQUENTIAL, BAD_NAME};
    461  0  stevel %typedef enum name_pos name_pos;
    462  0  stevel %
    463  0  stevel %/*
    464  0  stevel % * Defines for getting at column data in entry objects. Because RPCGEN
    465  0  stevel % * generates some rather wordy structures, we create some defines that
    466  0  stevel % * collapse the needed keystrokes to access a particular value using
    467  0  stevel % * these definitions they take an nis_object *, and an int and return
    468  0  stevel % * a u_char * for Value, and an int for length.
    469  0  stevel % */
    470  0  stevel %#define ENTRY_VAL(obj, col) \
    471  0  stevel %	(obj)->EN_data.en_cols.en_cols_val[col].ec_value.ec_value_val
    472  0  stevel %#define ENTRY_LEN(obj, col) \
    473  0  stevel %	(obj)->EN_data.en_cols.en_cols_val[col].ec_value.ec_value_len
    474  0  stevel %
    475  0  stevel %
    476  0  stevel %
    477  0  stevel %#ifdef __cplusplus
    478  0  stevel %}
    479  0  stevel %#endif
    480  0  stevel %
    481  0  stevel %/* Prototypes, and extern declarations for the NIS library functions. */
    482  0  stevel %#include <rpcsvc/nislib.h>
    483  0  stevel %#endif /* __NIS_RPCGEN_H */
    484  0  stevel %/* EDIT_START */
    485  0  stevel %
    486  0  stevel %/*
    487  0  stevel % * nis_3.h
    488  0  stevel % *
    489  0  stevel % * This file contains definitions that are only of interest to the actual
    490  0  stevel % * service daemon and client stubs. Normal users of NIS will not include
    491  0  stevel % * this file.
    492  0  stevel % *
    493  0  stevel % * NOTE : This include file is automatically created by a combination
    494  0  stevel % * of rpcgen and sed. DO NOT EDIT IT, change the nis.x file instead
    495  0  stevel % * and then remake this file.
    496  0  stevel % */
    497  0  stevel %#ifndef __nis_3_h
    498  0  stevel %#define __nis_3_h
    499  0  stevel %#ifdef __cplusplus
    500  0  stevel %extern "C" {
    501  0  stevel %#endif
    502  0  stevel #endif
    503