hjl / source-git / glibc

Forked from source-git/glibc 3 years ago
Clone

Blame nis/rpcsvc/nis.h

Packit 6c4009
/*
Packit 6c4009
 * Copyright (c) 2010, Oracle America, Inc.
Packit 6c4009
 *
Packit 6c4009
 * Redistribution and use in source and binary forms, with or without
Packit 6c4009
 * modification, are permitted provided that the following conditions are
Packit 6c4009
 * met:
Packit 6c4009
 *
Packit 6c4009
 *     * Redistributions of source code must retain the above copyright
Packit 6c4009
 *       notice, this list of conditions and the following disclaimer.
Packit 6c4009
 *     * Redistributions in binary form must reproduce the above
Packit 6c4009
 *       copyright notice, this list of conditions and the following
Packit 6c4009
 *       disclaimer in the documentation and/or other materials
Packit 6c4009
 *       provided with the distribution.
Packit 6c4009
 *     * Neither the name of the "Oracle America, Inc." nor the names of its
Packit 6c4009
 *       contributors may be used to endorse or promote products derived
Packit 6c4009
 *       from this software without specific prior written permission.
Packit 6c4009
 *
Packit 6c4009
 *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
Packit 6c4009
 *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
Packit 6c4009
 *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
Packit 6c4009
 *   FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
Packit 6c4009
 *   COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
Packit 6c4009
 *   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Packit 6c4009
 *   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
Packit 6c4009
 *   GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
Packit 6c4009
 *   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
Packit 6c4009
 *   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
Packit 6c4009
 *   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
Packit 6c4009
 *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Packit 6c4009
 */
Packit 6c4009
Packit 6c4009
#ifndef _RPCSVC_NIS_H
Packit 6c4009
#define _RPCSVC_NIS_H 1
Packit 6c4009
Packit 6c4009
#include <features.h>
Packit 6c4009
#include <rpc/rpc.h>
Packit 6c4009
#include <rpcsvc/nis_tags.h>
Packit 6c4009
Packit 6c4009
__BEGIN_DECLS
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 *	nis.h
Packit 6c4009
 *
Packit 6c4009
 *	This file is the main include file for NIS clients. It contains
Packit 6c4009
 *	both the client library function defines and the various data
Packit 6c4009
 *	structures used by the NIS service. It includes the file nis_tags.h
Packit 6c4009
 *	which defines the tag values. This allows the tags to change without
Packit 6c4009
 *	having to change the nis.x file.
Packit 6c4009
 *
Packit 6c4009
 *	NOTE : THIS FILE IS NOT GENERATED WITH RPCGEN ! SO YOU HAVE TO
Packit 6c4009
 *             ADD ALL THE CHANGES ON nis_*.x FILES HERE AGAIN !
Packit 6c4009
 *
Packit 6c4009
 *      I have removed all the Solaris internal structs and variables,
Packit 6c4009
 *      because they are not supported, Sun changed them between various
Packit 6c4009
 *      releases and they shouldn't be used in user programs.
Packit 6c4009
 *                                              <kukuk@suse.de>
Packit 6c4009
 */
Packit 6c4009
Packit 6c4009
Packit 6c4009
#ifndef __nis_object_h
Packit 6c4009
#define __nis_object_h
Packit 6c4009
Packit 6c4009
#define NIS_MAXSTRINGLEN 255
Packit 6c4009
#define NIS_MAXNAMELEN 1024
Packit 6c4009
#define NIS_MAXATTRNAME 32
Packit 6c4009
#define NIS_MAXATTRVAL 2048
Packit 6c4009
#define NIS_MAXCOLUMNS 64
Packit 6c4009
#define NIS_MAXATTR 16
Packit 6c4009
#define NIS_MAXPATH 1024
Packit 6c4009
#define NIS_MAXREPLICAS 128
Packit 6c4009
#define NIS_MAXLINKS 16
Packit 6c4009
#define NIS_PK_NONE 0
Packit 6c4009
#define NIS_PK_DH 1
Packit 6c4009
#define NIS_PK_RSA 2
Packit 6c4009
#define NIS_PK_KERB 3
Packit 6c4009
#define NIS_PK_DHEXT 4
Packit 6c4009
Packit 6c4009
struct nis_attr {
Packit 6c4009
	char *zattr_ndx;
Packit 6c4009
	struct {
Packit 6c4009
		u_int zattr_val_len;
Packit 6c4009
		char *zattr_val_val;
Packit 6c4009
	} zattr_val;
Packit 6c4009
};
Packit 6c4009
typedef struct nis_attr nis_attr;
Packit 6c4009
Packit 6c4009
typedef char *nis_name;
Packit 6c4009
Packit 6c4009
enum zotypes {
Packit 6c4009
	BOGUS_OBJ = 0,
Packit 6c4009
	NO_OBJ = 1,
Packit 6c4009
	DIRECTORY_OBJ = 2,
Packit 6c4009
	GROUP_OBJ = 3,
Packit 6c4009
	TABLE_OBJ = 4,
Packit 6c4009
	ENTRY_OBJ = 5,
Packit 6c4009
	LINK_OBJ = 6,
Packit 6c4009
	PRIVATE_OBJ = 7,
Packit 6c4009
	NIS_BOGUS_OBJ = 0,
Packit 6c4009
	NIS_NO_OBJ = 1,
Packit 6c4009
	NIS_DIRECTORY_OBJ = 2,
Packit 6c4009
	NIS_GROUP_OBJ = 3,
Packit 6c4009
	NIS_TABLE_OBJ = 4,
Packit 6c4009
	NIS_ENTRY_OBJ = 5,
Packit 6c4009
	NIS_LINK_OBJ = 6,
Packit 6c4009
	NIS_PRIVATE_OBJ = 7
Packit 6c4009
};
Packit 6c4009
typedef enum zotypes zotypes;
Packit 6c4009
Packit 6c4009
enum nstype {
Packit 6c4009
	UNKNOWN = 0,
Packit 6c4009
	NIS = 1,
Packit 6c4009
	SUNYP = 2,
Packit 6c4009
	IVY = 3,
Packit 6c4009
	DNS = 4,
Packit 6c4009
	X500 = 5,
Packit 6c4009
	DNANS = 6,
Packit 6c4009
	XCHS = 7,
Packit 6c4009
	CDS = 8,
Packit 6c4009
};
Packit 6c4009
typedef enum nstype nstype;
Packit 6c4009
Packit 6c4009
struct oar_mask {
Packit 6c4009
	uint32_t oa_rights;
Packit 6c4009
	zotypes oa_otype;
Packit 6c4009
};
Packit 6c4009
typedef struct oar_mask oar_mask;
Packit 6c4009
Packit 6c4009
struct endpoint {
Packit 6c4009
	char *uaddr;
Packit 6c4009
	char *family;
Packit 6c4009
	char *proto;
Packit 6c4009
};
Packit 6c4009
typedef struct endpoint endpoint;
Packit 6c4009
Packit 6c4009
struct nis_server {
Packit 6c4009
	nis_name name;
Packit 6c4009
	struct {
Packit 6c4009
		u_int ep_len;
Packit 6c4009
		endpoint *ep_val;
Packit 6c4009
	} ep;
Packit 6c4009
	uint32_t key_type;
Packit 6c4009
	netobj pkey;
Packit 6c4009
};
Packit 6c4009
typedef struct nis_server nis_server;
Packit 6c4009
Packit 6c4009
struct directory_obj {
Packit 6c4009
	nis_name do_name;
Packit 6c4009
	nstype do_type;
Packit 6c4009
	struct {
Packit 6c4009
		u_int do_servers_len;
Packit 6c4009
		nis_server *do_servers_val;
Packit 6c4009
	} do_servers;
Packit 6c4009
	uint32_t do_ttl;
Packit 6c4009
	struct {
Packit 6c4009
		u_int do_armask_len;
Packit 6c4009
		oar_mask *do_armask_val;
Packit 6c4009
	} do_armask;
Packit 6c4009
};
Packit 6c4009
typedef struct directory_obj directory_obj;
Packit 6c4009
Packit 6c4009
#define EN_BINARY 1
Packit 6c4009
#define EN_CRYPT 2
Packit 6c4009
#define EN_XDR 4
Packit 6c4009
#define EN_MODIFIED 8
Packit 6c4009
#define EN_ASN1 64
Packit 6c4009
Packit 6c4009
struct entry_col {
Packit 6c4009
	uint32_t ec_flags;
Packit 6c4009
	struct {
Packit 6c4009
		u_int ec_value_len;
Packit 6c4009
		char *ec_value_val;
Packit 6c4009
	} ec_value;
Packit 6c4009
};
Packit 6c4009
typedef struct entry_col entry_col;
Packit 6c4009
Packit 6c4009
struct entry_obj {
Packit 6c4009
	char *en_type;
Packit 6c4009
	struct {
Packit 6c4009
		u_int en_cols_len;
Packit 6c4009
		entry_col *en_cols_val;
Packit 6c4009
	} en_cols;
Packit 6c4009
};
Packit 6c4009
typedef struct entry_obj entry_obj;
Packit 6c4009
Packit 6c4009
struct group_obj {
Packit 6c4009
	uint32_t gr_flags;
Packit 6c4009
	struct {
Packit 6c4009
		u_int gr_members_len;
Packit 6c4009
		nis_name *gr_members_val;
Packit 6c4009
	} gr_members;
Packit 6c4009
};
Packit 6c4009
typedef struct group_obj group_obj;
Packit 6c4009
Packit 6c4009
struct link_obj {
Packit 6c4009
	zotypes li_rtype;
Packit 6c4009
	struct {
Packit 6c4009
		u_int li_attrs_len;
Packit 6c4009
		nis_attr *li_attrs_val;
Packit 6c4009
	} li_attrs;
Packit 6c4009
	nis_name li_name;
Packit 6c4009
};
Packit 6c4009
typedef struct link_obj link_obj;
Packit 6c4009
Packit 6c4009
#define TA_BINARY 1
Packit 6c4009
#define TA_CRYPT 2
Packit 6c4009
#define TA_XDR 4
Packit 6c4009
#define TA_SEARCHABLE 8
Packit 6c4009
#define TA_CASE 16
Packit 6c4009
#define TA_MODIFIED 32
Packit 6c4009
#define TA_ASN1 64
Packit 6c4009
Packit 6c4009
struct table_col {
Packit 6c4009
	char *tc_name;
Packit 6c4009
	uint32_t tc_flags;
Packit 6c4009
	uint32_t tc_rights;
Packit 6c4009
};
Packit 6c4009
typedef struct table_col table_col;
Packit 6c4009
Packit 6c4009
struct table_obj {
Packit 6c4009
	char *ta_type;
Packit 6c4009
	int ta_maxcol;
Packit 6c4009
	u_char ta_sep;
Packit 6c4009
	struct {
Packit 6c4009
		u_int ta_cols_len;
Packit 6c4009
		table_col *ta_cols_val;
Packit 6c4009
	} ta_cols;
Packit 6c4009
	char *ta_path;
Packit 6c4009
};
Packit 6c4009
typedef struct table_obj table_obj;
Packit 6c4009
Packit 6c4009
struct objdata {
Packit 6c4009
	zotypes zo_type;
Packit 6c4009
	union {
Packit 6c4009
		struct directory_obj di_data;
Packit 6c4009
		struct group_obj gr_data;
Packit 6c4009
		struct table_obj ta_data;
Packit 6c4009
		struct entry_obj en_data;
Packit 6c4009
		struct link_obj li_data;
Packit 6c4009
		struct {
Packit 6c4009
			u_int po_data_len;
Packit 6c4009
			char *po_data_val;
Packit 6c4009
		} po_data;
Packit 6c4009
	} objdata_u;
Packit 6c4009
};
Packit 6c4009
typedef struct objdata objdata;
Packit 6c4009
Packit 6c4009
struct nis_oid {
Packit 6c4009
	uint32_t ctime;
Packit 6c4009
	uint32_t mtime;
Packit 6c4009
};
Packit 6c4009
typedef struct nis_oid nis_oid;
Packit 6c4009
Packit 6c4009
struct nis_object {
Packit 6c4009
	nis_oid zo_oid;
Packit 6c4009
	nis_name zo_name;
Packit 6c4009
	nis_name zo_owner;
Packit 6c4009
	nis_name zo_group;
Packit 6c4009
	nis_name zo_domain;
Packit 6c4009
	uint32_t zo_access;
Packit 6c4009
	uint32_t zo_ttl;
Packit 6c4009
	objdata zo_data;
Packit 6c4009
};
Packit 6c4009
typedef struct nis_object nis_object;
Packit 6c4009
Packit 6c4009
#endif /* if __nis_object_h */
Packit 6c4009
Packit 6c4009
enum nis_error {
Packit 6c4009
	NIS_SUCCESS = 0,
Packit 6c4009
	NIS_S_SUCCESS = 1,
Packit 6c4009
	NIS_NOTFOUND = 2,
Packit 6c4009
	NIS_S_NOTFOUND = 3,
Packit 6c4009
	NIS_CACHEEXPIRED = 4,
Packit 6c4009
	NIS_NAMEUNREACHABLE = 5,
Packit 6c4009
	NIS_UNKNOWNOBJ = 6,
Packit 6c4009
	NIS_TRYAGAIN = 7,
Packit 6c4009
	NIS_SYSTEMERROR = 8,
Packit 6c4009
	NIS_CHAINBROKEN = 9,
Packit 6c4009
	NIS_PERMISSION = 10,
Packit 6c4009
	NIS_NOTOWNER = 11,
Packit 6c4009
	NIS_NOT_ME = 12,
Packit 6c4009
	NIS_NOMEMORY = 13,
Packit 6c4009
	NIS_NAMEEXISTS = 14,
Packit 6c4009
	NIS_NOTMASTER = 15,
Packit 6c4009
	NIS_INVALIDOBJ = 16,
Packit 6c4009
	NIS_BADNAME = 17,
Packit 6c4009
	NIS_NOCALLBACK = 18,
Packit 6c4009
	NIS_CBRESULTS = 19,
Packit 6c4009
	NIS_NOSUCHNAME = 20,
Packit 6c4009
	NIS_NOTUNIQUE = 21,
Packit 6c4009
	NIS_IBMODERROR = 22,
Packit 6c4009
	NIS_NOSUCHTABLE = 23,
Packit 6c4009
	NIS_TYPEMISMATCH = 24,
Packit 6c4009
	NIS_LINKNAMEERROR = 25,
Packit 6c4009
	NIS_PARTIAL = 26,
Packit 6c4009
	NIS_TOOMANYATTRS = 27,
Packit 6c4009
	NIS_RPCERROR = 28,
Packit 6c4009
	NIS_BADATTRIBUTE = 29,
Packit 6c4009
	NIS_NOTSEARCHABLE = 30,
Packit 6c4009
	NIS_CBERROR = 31,
Packit 6c4009
	NIS_FOREIGNNS = 32,
Packit 6c4009
	NIS_BADOBJECT = 33,
Packit 6c4009
	NIS_NOTSAMEOBJ = 34,
Packit 6c4009
	NIS_MODFAIL = 35,
Packit 6c4009
	NIS_BADREQUEST = 36,
Packit 6c4009
	NIS_NOTEMPTY = 37,
Packit 6c4009
	NIS_COLDSTART_ERR = 38,
Packit 6c4009
	NIS_RESYNC = 39,
Packit 6c4009
	NIS_FAIL = 40,
Packit 6c4009
	NIS_UNAVAIL = 41,
Packit 6c4009
	NIS_RES2BIG = 42,
Packit 6c4009
	NIS_SRVAUTH = 43,
Packit 6c4009
	NIS_CLNTAUTH = 44,
Packit 6c4009
	NIS_NOFILESPACE = 45,
Packit 6c4009
	NIS_NOPROC = 46,
Packit 6c4009
	NIS_DUMPLATER = 47,
Packit 6c4009
};
Packit 6c4009
typedef enum nis_error nis_error;
Packit 6c4009
Packit 6c4009
struct nis_result {
Packit 6c4009
	nis_error status;
Packit 6c4009
	struct {
Packit 6c4009
		u_int objects_len;
Packit 6c4009
		nis_object *objects_val;
Packit 6c4009
	} objects;
Packit 6c4009
	netobj cookie;
Packit 6c4009
	uint32_t zticks;
Packit 6c4009
	uint32_t dticks;
Packit 6c4009
	uint32_t aticks;
Packit 6c4009
	uint32_t cticks;
Packit 6c4009
};
Packit 6c4009
typedef struct nis_result nis_result;
Packit 6c4009
Packit 6c4009
struct ns_request {
Packit 6c4009
	nis_name ns_name;
Packit 6c4009
	struct {
Packit 6c4009
		u_int ns_object_len;
Packit 6c4009
		nis_object *ns_object_val;
Packit 6c4009
	} ns_object;
Packit 6c4009
};
Packit 6c4009
typedef struct ns_request ns_request;
Packit 6c4009
Packit 6c4009
struct ib_request {
Packit 6c4009
	nis_name ibr_name;
Packit 6c4009
	struct {
Packit 6c4009
		u_int ibr_srch_len;
Packit 6c4009
		nis_attr *ibr_srch_val;
Packit 6c4009
	} ibr_srch;
Packit 6c4009
	uint32_t ibr_flags;
Packit 6c4009
	struct {
Packit 6c4009
		u_int ibr_obj_len;
Packit 6c4009
		nis_object *ibr_obj_val;
Packit 6c4009
	} ibr_obj;
Packit 6c4009
	struct {
Packit 6c4009
		u_int ibr_cbhost_len;
Packit 6c4009
		nis_server *ibr_cbhost_val;
Packit 6c4009
	} ibr_cbhost;
Packit 6c4009
	u_int ibr_bufsize;
Packit 6c4009
	netobj ibr_cookie;
Packit 6c4009
};
Packit 6c4009
typedef struct ib_request ib_request;
Packit 6c4009
Packit 6c4009
struct ping_args {
Packit 6c4009
	nis_name dir;
Packit 6c4009
	uint32_t stamp;
Packit 6c4009
};
Packit 6c4009
typedef struct ping_args ping_args;
Packit 6c4009
Packit 6c4009
enum log_entry_t {
Packit 6c4009
	LOG_NOP = 0,
Packit 6c4009
	ADD_NAME = 1,
Packit 6c4009
	REM_NAME = 2,
Packit 6c4009
	MOD_NAME_OLD = 3,
Packit 6c4009
	MOD_NAME_NEW = 4,
Packit 6c4009
	ADD_IBASE = 5,
Packit 6c4009
	REM_IBASE = 6,
Packit 6c4009
	MOD_IBASE = 7,
Packit 6c4009
	UPD_STAMP = 8,
Packit 6c4009
};
Packit 6c4009
typedef enum log_entry_t log_entry_t;
Packit 6c4009
Packit 6c4009
struct log_entry {
Packit 6c4009
	uint32_t le_time;
Packit 6c4009
	log_entry_t le_type;
Packit 6c4009
	nis_name le_princp;
Packit 6c4009
	nis_name le_name;
Packit 6c4009
	struct {
Packit 6c4009
		u_int le_attrs_len;
Packit 6c4009
		nis_attr *le_attrs_val;
Packit 6c4009
	} le_attrs;
Packit 6c4009
	nis_object le_object;
Packit 6c4009
};
Packit 6c4009
typedef struct log_entry log_entry;
Packit 6c4009
Packit 6c4009
struct log_result {
Packit 6c4009
	nis_error lr_status;
Packit 6c4009
	netobj lr_cookie;
Packit 6c4009
	struct {
Packit 6c4009
		u_int lr_entries_len;
Packit 6c4009
		log_entry *lr_entries_val;
Packit 6c4009
	} lr_entries;
Packit 6c4009
};
Packit 6c4009
typedef struct log_result log_result;
Packit 6c4009
Packit 6c4009
struct cp_result {
Packit 6c4009
	nis_error cp_status;
Packit 6c4009
	uint32_t cp_zticks;
Packit 6c4009
	uint32_t cp_dticks;
Packit 6c4009
};
Packit 6c4009
typedef struct cp_result cp_result;
Packit 6c4009
Packit 6c4009
struct nis_tag {
Packit 6c4009
	uint32_t tag_type;
Packit 6c4009
	char *tag_val;
Packit 6c4009
};
Packit 6c4009
typedef struct nis_tag nis_tag;
Packit 6c4009
Packit 6c4009
struct nis_taglist {
Packit 6c4009
	struct {
Packit 6c4009
		u_int tags_len;
Packit 6c4009
		nis_tag *tags_val;
Packit 6c4009
	} tags;
Packit 6c4009
};
Packit 6c4009
typedef struct nis_taglist nis_taglist;
Packit 6c4009
Packit 6c4009
struct dump_args {
Packit 6c4009
	nis_name da_dir;
Packit 6c4009
	uint32_t da_time;
Packit 6c4009
	struct {
Packit 6c4009
		u_int da_cbhost_len;
Packit 6c4009
		nis_server *da_cbhost_val;
Packit 6c4009
	} da_cbhost;
Packit 6c4009
};
Packit 6c4009
typedef struct dump_args dump_args;
Packit 6c4009
Packit 6c4009
struct fd_args {
Packit 6c4009
	nis_name dir_name;
Packit 6c4009
	nis_name requester;
Packit 6c4009
};
Packit 6c4009
typedef struct fd_args fd_args;
Packit 6c4009
Packit 6c4009
struct fd_result {
Packit 6c4009
	nis_error status;
Packit 6c4009
	nis_name source;
Packit 6c4009
	struct {
Packit 6c4009
		u_int dir_data_len;
Packit 6c4009
		char *dir_data_val;
Packit 6c4009
	} dir_data;
Packit 6c4009
	struct {
Packit 6c4009
		u_int signature_len;
Packit 6c4009
		char *signature_val;
Packit 6c4009
	} signature;
Packit 6c4009
};
Packit 6c4009
typedef struct fd_result fd_result;
Packit 6c4009
Packit 6c4009
/* Generic client creating flags */
Packit 6c4009
#define ZMH_VC		1
Packit 6c4009
#define ZMH_DG		2
Packit 6c4009
#define ZMH_AUTH	4
Packit 6c4009
Packit 6c4009
/* Testing Access rights for objects */
Packit 6c4009
Packit 6c4009
#define NIS_READ_ACC		1
Packit 6c4009
#define NIS_MODIFY_ACC		2
Packit 6c4009
#define NIS_CREATE_ACC		4
Packit 6c4009
#define NIS_DESTROY_ACC	8
Packit 6c4009
/* Test macros. a == access rights, m == desired rights. */
Packit 6c4009
#define NIS_WORLD(a, m)        (((a) & (m)) != 0)
Packit 6c4009
#define NIS_GROUP(a, m)        (((a) & ((m) << 8)) != 0)
Packit 6c4009
#define NIS_OWNER(a, m)        (((a) & ((m) << 16)) != 0)
Packit 6c4009
#define NIS_NOBODY(a, m)       (((a) & ((m) << 24)) != 0)
Packit 6c4009
/*
Packit 6c4009
 * EOL Alert - The following non-prefixed test macros are
Packit 6c4009
 * here for backward compatibility, and will be not be present
Packit 6c4009
 * in future releases - use the NIS_*() macros above.
Packit 6c4009
 */
Packit 6c4009
#define WORLD(a, m)	(((a) & (m)) != 0)
Packit 6c4009
#define GROUP(a, m)	(((a) & ((m) << 8)) != 0)
Packit 6c4009
#define OWNER(a, m)	(((a) & ((m) << 16)) != 0)
Packit 6c4009
#define NOBODY(a, m)	(((a) & ((m) << 24)) != 0)
Packit 6c4009
Packit 6c4009
#define OATYPE(d, n) (((d)->do_armask.do_armask_val+n)->oa_otype)
Packit 6c4009
#define OARIGHTS(d, n) (((d)->do_armask.do_armask_val+n)->oa_rights)
Packit 6c4009
#define WORLD_DEFAULT (NIS_READ_ACC)
Packit 6c4009
#define GROUP_DEFAULT (NIS_READ_ACC << 8)
Packit 6c4009
#define OWNER_DEFAULT ((NIS_READ_ACC + NIS_MODIFY_ACC + NIS_CREATE_ACC +\
Packit 6c4009
			NIS_DESTROY_ACC) << 16)
Packit 6c4009
#define DEFAULT_RIGHTS (WORLD_DEFAULT | GROUP_DEFAULT | OWNER_DEFAULT)
Packit 6c4009
Packit 6c4009
/* Result manipulation defines ... */
Packit 6c4009
#define NIS_RES_NUMOBJ(x)	((x)->objects.objects_len)
Packit 6c4009
#define NIS_RES_OBJECT(x)	((x)->objects.objects_val)
Packit 6c4009
#define NIS_RES_COOKIE(x)	((x)->cookie)
Packit 6c4009
#define NIS_RES_STATUS(x)	((x)->status)
Packit 6c4009
Packit 6c4009
/* These defines make getting at the variant part of the object easier. */
Packit 6c4009
#define TA_data zo_data.objdata_u.ta_data
Packit 6c4009
#define EN_data zo_data.objdata_u.en_data
Packit 6c4009
#define DI_data zo_data.objdata_u.di_data
Packit 6c4009
#define LI_data zo_data.objdata_u.li_data
Packit 6c4009
#define GR_data zo_data.objdata_u.gr_data
Packit 6c4009
Packit 6c4009
#define __type_of(o) ((o)->zo_data.zo_type)
Packit 6c4009
Packit 6c4009
/* Declarations for the internal subroutines in nislib.c */
Packit 6c4009
enum name_pos {SAME_NAME, HIGHER_NAME, LOWER_NAME, NOT_SEQUENTIAL, BAD_NAME};
Packit 6c4009
typedef enum name_pos name_pos;
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 * Defines for getting at column data in entry objects. Because RPCGEN
Packit 6c4009
 * generates some rather wordy structures, we create some defines that
Packit 6c4009
 * collapse the needed keystrokes to access a particular value using
Packit 6c4009
 * these definitions they take an nis_object *, and an int and return
Packit 6c4009
 * a u_char * for Value, and an int for length.
Packit 6c4009
 */
Packit 6c4009
#define ENTRY_VAL(obj, col) (obj)->EN_data.en_cols.en_cols_val[col].ec_value.ec_value_val
Packit 6c4009
#define ENTRY_LEN(obj, col) (obj)->EN_data.en_cols.en_cols_val[col].ec_value.ec_value_len
Packit 6c4009
Packit 6c4009
Packit 6c4009
/* Prototypes, and extern declarations for the NIS library functions. */
Packit 6c4009
#include <rpcsvc/nislib.h>
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 * nis_3.h
Packit 6c4009
 *
Packit 6c4009
 * This file contains definitions that are only of interest to the actual
Packit 6c4009
 * service daemon and client stubs. Normal users of NIS will not include
Packit 6c4009
 * this file.
Packit 6c4009
 *
Packit 6c4009
 * NOTE : This include file is automatically created by a combination
Packit 6c4009
 * of rpcgen and sed. DO NOT EDIT IT, change the nis.x file instead
Packit 6c4009
 * and then remake this file.
Packit 6c4009
 */
Packit 6c4009
#ifndef __nis_3_h
Packit 6c4009
#define __nis_3_h
Packit 6c4009
Packit 6c4009
#define NIS_PROG 100300
Packit 6c4009
#define NIS_VERSION 3
Packit 6c4009
Packit 6c4009
#define NIS_LOOKUP 1
Packit 6c4009
extern  nis_result * nis_lookup_3 (ns_request *, CLIENT *) __THROW;
Packit 6c4009
extern  nis_result * nis_lookup_3_svc (ns_request *, struct svc_req *) __THROW;
Packit 6c4009
#define NIS_ADD 2
Packit 6c4009
extern  nis_result * nis_add_3 (ns_request *, CLIENT *) __THROW;
Packit 6c4009
extern  nis_result * nis_add_3_svc (ns_request *, struct svc_req *) __THROW;
Packit 6c4009
#define NIS_MODIFY 3
Packit 6c4009
extern  nis_result * nis_modify_3 (ns_request *, CLIENT *) __THROW;
Packit 6c4009
extern  nis_result * nis_modify_3_svc (ns_request *, struct svc_req *) __THROW;
Packit 6c4009
#define NIS_REMOVE 4
Packit 6c4009
extern  nis_result * nis_remove_3 (ns_request *, CLIENT *) __THROW;
Packit 6c4009
extern  nis_result * nis_remove_3_svc (ns_request *, struct svc_req *) __THROW;
Packit 6c4009
#define NIS_IBLIST 5
Packit 6c4009
extern  nis_result * nis_iblist_3 (ib_request *, CLIENT *) __THROW;
Packit 6c4009
extern  nis_result * nis_iblist_3_svc (ib_request *, struct svc_req *) __THROW;
Packit 6c4009
#define NIS_IBADD 6
Packit 6c4009
extern  nis_result * nis_ibadd_3 (ib_request *, CLIENT *) __THROW;
Packit 6c4009
extern  nis_result * nis_ibadd_3_svc (ib_request *, struct svc_req *) __THROW;
Packit 6c4009
#define NIS_IBMODIFY 7
Packit 6c4009
extern  nis_result * nis_ibmodify_3 (ib_request *, CLIENT *) __THROW;
Packit 6c4009
extern  nis_result * nis_ibmodify_3_svc (ib_request *, struct svc_req *)
Packit 6c4009
     __THROW;
Packit 6c4009
#define NIS_IBREMOVE 8
Packit 6c4009
extern  nis_result * nis_ibremove_3 (ib_request *, CLIENT *) __THROW;
Packit 6c4009
extern  nis_result * nis_ibremove_3_svc (ib_request *, struct svc_req *)
Packit 6c4009
     __THROW;
Packit 6c4009
#define NIS_IBFIRST 9
Packit 6c4009
extern  nis_result * nis_ibfirst_3 (ib_request *, CLIENT *) __THROW;
Packit 6c4009
extern  nis_result * nis_ibfirst_3_svc (ib_request *, struct svc_req *)
Packit 6c4009
     __THROW;
Packit 6c4009
#define NIS_IBNEXT 10
Packit 6c4009
extern  nis_result * nis_ibnext_3 (ib_request *, CLIENT *) __THROW;
Packit 6c4009
extern  nis_result * nis_ibnext_3_svc (ib_request *, struct svc_req *) __THROW;
Packit 6c4009
#define NIS_FINDDIRECTORY 12
Packit 6c4009
extern  fd_result * nis_finddirectory_3 (fd_args *, CLIENT *) __THROW;
Packit 6c4009
extern  fd_result * nis_finddirectory_3_svc (fd_args *,
Packit 6c4009
					     struct svc_req *) __THROW;
Packit 6c4009
#define NIS_STATUS 14
Packit 6c4009
extern  nis_taglist * nis_status_3 (nis_taglist *, CLIENT *) __THROW;
Packit 6c4009
extern  nis_taglist * nis_status_3_svc (nis_taglist *, struct svc_req *)
Packit 6c4009
     __THROW;
Packit 6c4009
#define NIS_DUMPLOG 15
Packit 6c4009
extern  log_result * nis_dumplog_3 (dump_args *, CLIENT *) __THROW;
Packit 6c4009
extern  log_result * nis_dumplog_3_svc (dump_args *, struct svc_req *) __THROW;
Packit 6c4009
#define NIS_DUMP 16
Packit 6c4009
extern  log_result * nis_dump_3 (dump_args *, CLIENT *) __THROW;
Packit 6c4009
extern  log_result * nis_dump_3_svc (dump_args *, struct svc_req *) __THROW;
Packit 6c4009
#define NIS_CALLBACK 17
Packit 6c4009
extern  bool_t * nis_callback_3 (netobj *, CLIENT *) __THROW;
Packit 6c4009
extern  bool_t * nis_callback_3_svc (netobj *, struct svc_req *) __THROW;
Packit 6c4009
#define NIS_CPTIME 18
Packit 6c4009
extern  uint32_t * nis_cptime_3 (nis_name *, CLIENT *) __THROW;
Packit 6c4009
extern  uint32_t * nis_cptime_3_svc (nis_name *, struct svc_req *) __THROW;
Packit 6c4009
#define NIS_CHECKPOINT 19
Packit 6c4009
extern  cp_result * nis_checkpoint_3 (nis_name *, CLIENT *) __THROW;
Packit 6c4009
extern  cp_result * nis_checkpoint_3_svc (nis_name *, struct svc_req *)
Packit 6c4009
     __THROW;
Packit 6c4009
#define NIS_PING 20
Packit 6c4009
extern  void * nis_ping_3 (ping_args *, CLIENT *) __THROW;
Packit 6c4009
extern  void * nis_ping_3_svc (ping_args *, struct svc_req *) __THROW;
Packit 6c4009
#define NIS_SERVSTATE 21
Packit 6c4009
extern  nis_taglist * nis_servstate_3 (nis_taglist *, CLIENT *) __THROW;
Packit 6c4009
extern  nis_taglist * nis_servstate_3_svc (nis_taglist *,
Packit 6c4009
					   struct svc_req *) __THROW;
Packit 6c4009
#define NIS_MKDIR 22
Packit 6c4009
extern  nis_error * nis_mkdir_3 (nis_name *, CLIENT *) __THROW;
Packit 6c4009
extern  nis_error * nis_mkdir_3_svc (nis_name *, struct svc_req *) __THROW;
Packit 6c4009
#define NIS_RMDIR 23
Packit 6c4009
extern  nis_error * nis_rmdir_3 (nis_name *, CLIENT *) __THROW;
Packit 6c4009
extern  nis_error * nis_rmdir_3_svc (nis_name *, struct svc_req *) __THROW;
Packit 6c4009
#define NIS_UPDKEYS 24
Packit 6c4009
extern  nis_error * nis_updkeys_3 (nis_name *, CLIENT *) __THROW;
Packit 6c4009
extern  nis_error * nis_updkeys_3_svc (nis_name *, struct svc_req *) __THROW;
Packit 6c4009
Packit 6c4009
__END_DECLS
Packit 6c4009
Packit 6c4009
#endif /* ! _RPCSVC_NIS_H */