1259117Shrs%/*- 2259117Shrs% * Copyright (c) 2010, Oracle America, Inc. 326206Swpaul% * 4259117Shrs% * Redistribution and use in source and binary forms, with or without 5259117Shrs% * modification, are permitted provided that the following conditions are 6259117Shrs% * met: 726206Swpaul% * 8259117Shrs% * * Redistributions of source code must retain the above copyright 9259117Shrs% * notice, this list of conditions and the following disclaimer. 10259117Shrs% * * Redistributions in binary form must reproduce the above 11259117Shrs% * copyright notice, this list of conditions and the following 12259117Shrs% * disclaimer in the documentation and/or other materials 13259117Shrs% * provided with the distribution. 14259117Shrs% * * Neither the name of the "Oracle America, Inc." nor the names of its 15259117Shrs% * contributors may be used to endorse or promote products derived 16259117Shrs% * from this software without specific prior written permission. 1726206Swpaul% * 18259117Shrs% * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19259117Shrs% * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20259117Shrs% * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 21259117Shrs% * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 22259117Shrs% * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, 23259117Shrs% * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 24259117Shrs% * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE 25259117Shrs% * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 26259117Shrs% * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 27259117Shrs% * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING 28259117Shrs% * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29259117Shrs% * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 3026206Swpaul% */ 3126206Swpaul 3226206Swpaul#ifndef RPC_HDR 33114629Sobrien%#include <sys/cdefs.h> 34114629Sobrien%__FBSDID("$FreeBSD: releng/11.0/include/rpcsvc/nis.x 272808 2014-10-09 06:58:33Z bapt $"); 3526206Swpaul#endif 3626206Swpaul 3726206Swpaul/* 3826206Swpaul * From 4.1 : @(#)nis.x 1.61 Copyright 1989 Sun Microsystems 3926206Swpaul * 4026206Swpaul * RPC Language Protocol description file for NIS Plus 4126206Swpaul * This version : 1.61 4226206Swpaul * Last Modified : 3/19/91 4326206Swpaul */ 4426206Swpaul#ifdef RPC_HDR 4526206Swpaul%/* 4626206Swpaul% * nis.h 4726206Swpaul% * 4826206Swpaul% * This file is the main include file for NIS clients. It contains 4926206Swpaul% * both the client library function defines and the various data 5026206Swpaul% * structures used by the NIS service. It includes the file nis_tags.h 5126206Swpaul% * which defines the tag values. This allows the tags to change without 5226206Swpaul% * having to change the nis.x file. 5326206Swpaul% * 5426206Swpaul% * NOTE : DO NOT EDIT THIS FILE! It is automatically generated when 5526206Swpaul% * rpcgen is run on the nis.x file. Note that there is a 5626206Swpaul% * simple sed script to remove some unneeded lines. (See the 5726206Swpaul% * Makefile target nis.h) 5826206Swpaul% * 5926206Swpaul% */ 6026206Swpaul%#include <rpcsvc/nis_tags.h> 6126206Swpaul#endif 6226206Swpaul 6326206Swpaul/* This gets stuffed into the source files. */ 6426206Swpaul#if RPC_HDR 6526206Swpaul%#include <rpc/xdr.h> 6626206Swpaul#endif 6726206Swpaul/* 6826206Swpaul * This is just pointless. 6926206Swpaul */ 7026206Swpaul#ifdef SUN_STUPIDITY 7126206Swpaul#if RPC_SVC 7226206Swpaul%#include "nis_svc.h" 7326206Swpaul#endif 7426206Swpaul#endif 7526206Swpaul 7626206Swpaul/* Include the RPC Language description of NIS objects */ 7726206Swpaul#include "nis_object.x" 7826206Swpaul 7926206Swpaul/* Errors that can be returned by the service */ 8026206Swpaulenum nis_error { 8126206Swpaul NIS_SUCCESS = 0, /* A-ok, let's rock n roll */ 8226206Swpaul NIS_S_SUCCESS = 1, /* Name found (maybe) */ 8326206Swpaul NIS_NOTFOUND = 2, /* Name definitely not found */ 8426206Swpaul NIS_S_NOTFOUND = 3, /* Name maybe not found */ 8526206Swpaul NIS_CACHEEXPIRED = 4, /* Name exists but cache out of date */ 8626206Swpaul NIS_NAMEUNREACHABLE = 5, /* Can't get there from here */ 8726206Swpaul NIS_UNKNOWNOBJ = 6, /* Object type is bogus */ 8826206Swpaul NIS_TRYAGAIN = 7, /* I'm busy, call back */ 8926206Swpaul NIS_SYSTEMERROR = 8, /* Out of band failure */ 9026206Swpaul NIS_CHAINBROKEN = 9, /* First/Next warning */ 9126206Swpaul NIS_PERMISSION = 10, /* Not enough permission to access */ 9226206Swpaul NIS_NOTOWNER = 11, /* You don't own it, sorry */ 9326206Swpaul NIS_NOT_ME = 12, /* I don't serve this name */ 9426206Swpaul NIS_NOMEMORY = 13, /* Outta VM! Help! */ 9526206Swpaul NIS_NAMEEXISTS = 14, /* Can't create over another name */ 9626206Swpaul NIS_NOTMASTER = 15, /* I'm justa secondaray, don't ask me */ 9726206Swpaul NIS_INVALIDOBJ = 16, /* Object is broken somehow */ 9826206Swpaul NIS_BADNAME = 17, /* Unparsable name */ 9926206Swpaul NIS_NOCALLBACK = 18, /* Couldn't talk to call back proc */ 10026206Swpaul NIS_CBRESULTS = 19, /* Results being called back to you */ 10126206Swpaul NIS_NOSUCHNAME = 20, /* Name unknown */ 10226206Swpaul NIS_NOTUNIQUE = 21, /* Value is not uniques (entry) */ 10326206Swpaul NIS_IBMODERROR = 22, /* Inf. Base. Modify error. */ 10426206Swpaul NIS_NOSUCHTABLE = 23, /* Name for table was wrong */ 10526206Swpaul NIS_TYPEMISMATCH = 24, /* Entry and table type mismatch */ 10626206Swpaul NIS_LINKNAMEERROR = 25, /* Link points to bogus name */ 10726206Swpaul NIS_PARTIAL = 26, /* Partial success, found table */ 10826206Swpaul NIS_TOOMANYATTRS = 27, /* Too many attributes */ 10926206Swpaul NIS_RPCERROR = 28, /* RPC error encountered */ 11026206Swpaul NIS_BADATTRIBUTE = 29, /* Bad or invalid attribute */ 11126206Swpaul NIS_NOTSEARCHABLE = 30, /* Non-searchable object searched */ 11226206Swpaul NIS_CBERROR = 31, /* Error during callback (svc crash) */ 11326206Swpaul NIS_FOREIGNNS = 32, /* Foreign Namespace */ 11426206Swpaul NIS_BADOBJECT = 33, /* Malformed object structure */ 11526206Swpaul NIS_NOTSAMEOBJ = 34, /* Object swapped during deletion */ 11626206Swpaul NIS_MODFAIL = 35, /* Failure during a Modify. */ 11726206Swpaul NIS_BADREQUEST = 36, /* Illegal query for table */ 11826206Swpaul NIS_NOTEMPTY = 37, /* Attempt to remove a non-empty tbl */ 11926206Swpaul NIS_COLDSTART_ERR = 38, /* Error accesing the cold start file */ 12026206Swpaul NIS_RESYNC = 39, /* Transaction log too far out of date */ 12126206Swpaul NIS_FAIL = 40, /* NIS operation failed. */ 12226206Swpaul NIS_UNAVAIL = 41, /* NIS+ service is unavailable (client) */ 12326206Swpaul NIS_RES2BIG = 42, /* NIS+ result too big for datagram */ 12426206Swpaul NIS_SRVAUTH = 43, /* NIS+ server wasn't authenticated. */ 12526206Swpaul NIS_CLNTAUTH = 44, /* NIS+ Client wasn't authenticated. */ 12626206Swpaul NIS_NOFILESPACE = 45, /* NIS+ server ran out of disk space */ 12726206Swpaul NIS_NOPROC = 46, /* NIS+ server couldn't create new proc */ 12826206Swpaul NIS_DUMPLATER = 47 /* NIS+ server already has dump child */ 12926206Swpaul}; 13026206Swpaul 13126206Swpaul 13226206Swpaul/* 13326206Swpaul * Structure definitions for the parameters and results of the actual 13426206Swpaul * NIS RPC calls. 13526206Swpaul * 13626206Swpaul * This is the standard result (in the protocol) of most of the nis 13726206Swpaul * requests. 13826206Swpaul */ 13926206Swpaul 14026206Swpaulstruct nis_result { 14126206Swpaul nis_error status; /* Status of the response */ 14226206Swpaul nis_object objects<>; /* objects found */ 14326206Swpaul netobj cookie; /* Cookie Data */ 14426206Swpaul u_long zticks; /* server ticks */ 14526206Swpaul u_long dticks; /* DBM ticks. */ 14626206Swpaul u_long aticks; /* Cache (accel) ticks */ 14726206Swpaul u_long cticks; /* Client ticks */ 14826206Swpaul}; 14926206Swpaul 15026206Swpaul/* 15126206Swpaul * A Name Service request 15226206Swpaul * This request is used to access the name space, ns_name is the name 15326206Swpaul * of the object within the namespace and the object is it's value, for 15426206Swpaul * add/modify, a copy of the original for remove. 15526206Swpaul */ 15626206Swpaul 15726206Swpaulstruct ns_request { 15826206Swpaul nis_name ns_name; /* Name in the NIS name space */ 15926206Swpaul nis_object ns_object<1>; /* Optional Object (add/remove) */ 16026206Swpaul}; 16126206Swpaul 16226206Swpaul/* 16326206Swpaul * An information base request 16426206Swpaul * This request includes the NIS name of the table we wish to search, the 16526206Swpaul * search criteria in the form of attribute/value pairs and an optional 16626206Swpaul * callback program number. If the callback program number is provided 16726206Swpaul * the server will send back objects one at a time, otherwise it will 16826206Swpaul * return them all in the response. 16926206Swpaul */ 17026206Swpaul 17126206Swpaulstruct ib_request { 17226206Swpaul nis_name ibr_name; /* The name of the Table */ 17326206Swpaul nis_attr ibr_srch<>; /* The search critereia */ 17426206Swpaul u_long ibr_flags; /* Optional flags */ 17526206Swpaul nis_object ibr_obj<1>; /* optional object (add/modify) */ 17626206Swpaul nis_server ibr_cbhost<1>; /* Optional callback info */ 17726206Swpaul u_long ibr_bufsize; /* Optional first/next bufsize */ 17826206Swpaul netobj ibr_cookie; /* The first/next cookie */ 17926206Swpaul}; 18026206Swpaul 18126206Swpaul/* 18226206Swpaul * This argument to the PING call notifies the replicas that something in 18326206Swpaul * a directory has changed and this is it's timestamp. The replica will use 18426206Swpaul * the timestamp to determine if its resync operation was successful. 18526206Swpaul */ 18626206Swpaulstruct ping_args { 18726206Swpaul nis_name dir; /* Directory that had the change */ 18826206Swpaul u_long stamp; /* timestamp of the transaction */ 18926206Swpaul}; 19026206Swpaul 19126206Swpaul/* 19226206Swpaul * These are the type of entries that are stored in the transaction log, 19326206Swpaul * note that modifications will appear as two entries, for names, they have 194108533Sschweikh * an "OLD" entry followed by a "NEW" entry. For entries in tables, there 19526206Swpaul * is a remove followed by an add. It is done this way so that we can read 196229781Suqs * the log backwards to back out transactions and forwards to propagate 197229781Suqs * updates. 19826206Swpaul */ 19926206Swpaulenum log_entry_t { 20026206Swpaul LOG_NOP = 0, 20126206Swpaul ADD_NAME = 1, /* Name Added to name space */ 20226206Swpaul REM_NAME = 2, /* Name removed from name space */ 20326206Swpaul MOD_NAME_OLD = 3, /* Name was modified in the name space */ 20426206Swpaul MOD_NAME_NEW = 4, /* Name was modified in the name space */ 20526206Swpaul ADD_IBASE = 5, /* Entry added to information base */ 20626206Swpaul REM_IBASE = 6, /* Entry removed from information base */ 20726206Swpaul MOD_IBASE = 7, /* Entry was modified in information base */ 20826206Swpaul UPD_STAMP = 8 /* Update timestamp (used as fenceposts) */ 20926206Swpaul}; 21026206Swpaul 21126206Swpaul/* 21226206Swpaul * This result is returned from the name service when it is requested to 21326206Swpaul * dump logged entries from its transaction log. Information base updates 21426206Swpaul * will have the name of the information base in the le_name field and 21526206Swpaul * a canonical set of attribute/value pairs to fully specify the entry's 21626206Swpaul * 'name'. 21726206Swpaul */ 21826206Swpaulstruct log_entry { 21926206Swpaul u_long le_time; /* Time in seconds */ 22026206Swpaul log_entry_t le_type; /* Type of log entry */ 22126206Swpaul nis_name le_princp; /* Principal making the change */ 22226206Swpaul nis_name le_name; /* Name of table/dir involved */ 22326206Swpaul nis_attr le_attrs<>; /* List of AV pairs. */ 22426206Swpaul nis_object le_object; /* Actual object value */ 22526206Swpaul}; 22626206Swpaul 22726206Swpaulstruct log_result { 22826206Swpaul nis_error lr_status; /* The status itself */ 22926206Swpaul netobj lr_cookie; /* Used by the dump callback */ 23026206Swpaul log_entry lr_entries<>; /* zero or more entries */ 23126206Swpaul}; 23226206Swpaul 23326206Swpaulstruct cp_result { 23426206Swpaul nis_error cp_status; /* Status of the checkpoint */ 23526206Swpaul u_long cp_zticks; /* Service 'ticks' */ 23626206Swpaul u_long cp_dticks; /* Database 'ticks' */ 23726206Swpaul}; 23826206Swpaul 23926206Swpaul/* 24026206Swpaul * This structure defines a generic NIS tag list. The taglist contains 24126206Swpaul * zero or tags, each of which is a type and a value. (u_long). 24226206Swpaul * These are used to report statistics (see tag definitions below) 24326206Swpaul * and to set or reset state variables. 24426206Swpaul */ 24526206Swpaulstruct nis_tag { 24626206Swpaul u_long tag_type; /* Statistic tag (may vary) */ 24726206Swpaul string tag_val<1024>; /* Statistic value may also vary */ 24826206Swpaul}; 24926206Swpaul 25026206Swpaulstruct nis_taglist { 25126206Swpaul nis_tag tags<>; /* List of tags */ 25226206Swpaul}; 25326206Swpaul 25426206Swpaulstruct dump_args { 25526206Swpaul nis_name da_dir; /* Directory to dump */ 25626206Swpaul u_long da_time; /* From this timestamp */ 25726206Swpaul nis_server da_cbhost<1>; /* Callback to use. */ 25826206Swpaul}; 25926206Swpaul 26026206Swpaulstruct fd_args { 26126206Swpaul nis_name dir_name; /* The directory we're looking for */ 26226206Swpaul nis_name requester; /* Host principal name for signature */ 26326206Swpaul}; 26426206Swpaul 26526206Swpaulstruct fd_result { 26626206Swpaul nis_error status; /* Status returned by function */ 26726206Swpaul nis_name source; /* Source of this answer */ 26826206Swpaul opaque dir_data<>; /* Directory Data (XDR'ed) */ 26926206Swpaul opaque signature<>; /* Signature of the source */ 27026206Swpaul}; 27126206Swpaul 27226206Swpaul 27326206Swpaul/* 27426206Swpaul * What's going on here? Well, it's like this. When the service 27526206Swpaul * is being compiled it wants to have the service definition specific 27626206Swpaul * info included, and when the client is being compiled it wants that 27726206Swpaul * info. This includes the appropriate file which was generated by 27826206Swpaul * make in the protocols directory (probably /usr/include/rpcsvc). 27926206Swpaul * 28072089Sasmodai * Uhm... guys? With RPC, you aren't supposed to have separate 28126206Swpaul * server-specific and client-specific header files. You have one header 28226206Swpaul * file that's suitable for both. If your code doesn't work using just 28326206Swpaul * the one header file, I submit to you that it's broken. 28426206Swpaul * -Bill 28526206Swpaul */ 28626206Swpaul#ifdef SUN_STUPIDITY 28726206Swpaul#ifdef RPC_SVC 28826206Swpaul%#include "nis_svc.h" 28926206Swpaul#endif 29026206Swpaul#ifdef RPC_CLNT 29126206Swpaul%#include "nis_clnt.h" 29226206Swpaul#endif 29326206Swpaul#endif 29426206Swpaul 29526206Swpaulprogram NIS_PROG { 29626206Swpaul 29726206Swpaul /* RPC Language description of the NIS+ protocol */ 29826206Swpaul version NIS_VERSION { 29926206Swpaul /* The name service functions */ 30026206Swpaul nis_result NIS_LOOKUP(ns_request) = 1; 30126206Swpaul nis_result NIS_ADD(ns_request) = 2; 30226206Swpaul nis_result NIS_MODIFY(ns_request) = 3; 30326206Swpaul nis_result NIS_REMOVE(ns_request) = 4; 30426206Swpaul 30526206Swpaul /* The information base functions */ 30626206Swpaul nis_result NIS_IBLIST(ib_request) = 5; 30726206Swpaul nis_result NIS_IBADD(ib_request) = 6; 30826206Swpaul nis_result NIS_IBMODIFY(ib_request) = 7; 30926206Swpaul nis_result NIS_IBREMOVE(ib_request) = 8; 31026206Swpaul nis_result NIS_IBFIRST(ib_request) = 9; 31126206Swpaul nis_result NIS_IBNEXT(ib_request) = 10; 31226206Swpaul 31326206Swpaul /* NIS Administrative functions */ 31426206Swpaul fd_result NIS_FINDDIRECTORY(fd_args) = 12; 31526206Swpaul 31626206Swpaul /* If fetch and optionally reset statistics */ 31726206Swpaul nis_taglist NIS_STATUS(nis_taglist) = 14; 31826206Swpaul 31926206Swpaul /* Dump changes to directory since time in da_time */ 32026206Swpaul log_result NIS_DUMPLOG(dump_args) = 15; 32126206Swpaul 32226206Swpaul /* Dump contents of directory named */ 32326206Swpaul log_result NIS_DUMP(dump_args) = 16; 32426206Swpaul 32526206Swpaul /* Check status of callback thread */ 32626206Swpaul bool NIS_CALLBACK(netobj) = 17; 32726206Swpaul 32826206Swpaul /* Return last update time for named dir */ 32926206Swpaul u_long NIS_CPTIME(nis_name) = 18; 33026206Swpaul 33126206Swpaul /* Checkpoint directory or table named */ 33226206Swpaul cp_result NIS_CHECKPOINT(nis_name) = 19; 33326206Swpaul 33426206Swpaul /* Send 'status changed' ping to replicates */ 33526206Swpaul void NIS_PING(ping_args) = 20; 33626206Swpaul 33726206Swpaul /* Modify server behaviour (such as debugging) */ 33826206Swpaul nis_taglist NIS_SERVSTATE(nis_taglist) = 21; 33926206Swpaul 34026206Swpaul /* Create a Directory */ 34126206Swpaul nis_error NIS_MKDIR(nis_name) = 22; 34226206Swpaul 34326206Swpaul /* Remove a Directory */ 34426206Swpaul nis_error NIS_RMDIR(nis_name) = 23; 34526206Swpaul 34626206Swpaul /* Update public keys of a directory object */ 34726206Swpaul nis_error NIS_UPDKEYS(nis_name) = 24; 34826206Swpaul } = 3; 34926206Swpaul} = 100300; 35026206Swpaul 35126206Swpaul/* 35226206Swpaul * Included below are the defines that become part of nis.h, 35326206Swpaul * they are technically not part of the protocol, but do define 35426206Swpaul * key aspects of the implementation and are therefore useful 35526206Swpaul * in building a conforming server or client. 35626206Swpaul */ 35726206Swpaul#if RPC_HDR 35826206Swpaul%/* 35926206Swpaul% * Generic "hash" datastructures, used by all types of hashed data. 36026206Swpaul% */ 36126206Swpaul%struct nis_hash_data { 36226206Swpaul% nis_name name; /* NIS name of hashed item */ 36326206Swpaul% int keychain; /* It's hash key (for pop) */ 36426206Swpaul% struct nis_hash_data *next; /* Hash collision pointer */ 36526206Swpaul% struct nis_hash_data *prv_item; /* A serial, doubly linked list */ 36626206Swpaul% struct nis_hash_data *nxt_item; /* of items in the hash table */ 36726206Swpaul%}; 36826206Swpaul%typedef struct nis_hash_data NIS_HASH_ITEM; 36926206Swpaul% 37026206Swpaul%struct nis_hash_table { 37126206Swpaul% NIS_HASH_ITEM *keys[64]; /* A hash table of items */ 37226206Swpaul% NIS_HASH_ITEM *first; /* The first "item" in serial list */ 37326206Swpaul%}; 37426206Swpaul%typedef struct nis_hash_table NIS_HASH_TABLE; 37526206Swpaul% 37626206Swpaul%/* Structure for storing dynamically allocated static data */ 37726206Swpaul%struct nis_sdata { 37826206Swpaul% void *buf; /* Memory allocation pointer */ 37926206Swpaul% u_long size; /* Buffer size */ 38026206Swpaul%}; 38126206Swpaul% 38226206Swpaul%/* Generic client creating flags */ 38326206Swpaul%#define ZMH_VC 1 38426206Swpaul%#define ZMH_DG 2 38526206Swpaul%#define ZMH_AUTH 4 38626206Swpaul% 38726206Swpaul%/* Testing Access rights for objects */ 38826206Swpaul% 38926206Swpaul%#define NIS_READ_ACC 1 39026206Swpaul%#define NIS_MODIFY_ACC 2 39126206Swpaul%#define NIS_CREATE_ACC 4 39226206Swpaul%#define NIS_DESTROY_ACC 8 39326206Swpaul%/* Test macros. a == access rights, m == desired rights. */ 39426206Swpaul%#define WORLD(a, m) (((a) & (m)) != 0) 39526206Swpaul%#define GROUP(a, m) (((a) & ((m) << 8)) != 0) 39626206Swpaul%#define OWNER(a, m) (((a) & ((m) << 16)) != 0) 39726206Swpaul%#define NOBODY(a, m) (((a) & ((m) << 24)) != 0) 39826206Swpaul% 39926206Swpaul%#define OATYPE(d, n) (((d)->do_armask.do_armask_val+n)->oa_otype) 40026206Swpaul%#define OARIGHTS(d, n) (((d)->do_armask.do_armask_val+n)->oa_rights) 40126206Swpaul%#define WORLD_DEFAULT (NIS_READ_ACC) 40226206Swpaul%#define GROUP_DEFAULT (NIS_READ_ACC << 8) 403272808Sbapt%#define OWNER_DEFAULT ((NIS_READ_ACC + NIS_MODIFY_ACC + NIS_CREATE_ACC + NIS_DESTROY_ACC) << 16) 40426206Swpaul%#define DEFAULT_RIGHTS (WORLD_DEFAULT | GROUP_DEFAULT | OWNER_DEFAULT) 40526206Swpaul% 40626206Swpaul%/* Result manipulation defines ... */ 40726206Swpaul%#define NIS_RES_NUMOBJ(x) ((x)->objects.objects_len) 40826206Swpaul%#define NIS_RES_OBJECT(x) ((x)->objects.objects_val) 40926206Swpaul%#define NIS_RES_COOKIE(x) ((x)->cookie) 41026206Swpaul%#define NIS_RES_STATUS(x) ((x)->status) 41126206Swpaul% 41226206Swpaul%/* These defines make getting at the variant part of the object easier. */ 41326206Swpaul%#define TA_data zo_data.objdata_u.ta_data 41426206Swpaul%#define EN_data zo_data.objdata_u.en_data 41526206Swpaul%#define DI_data zo_data.objdata_u.di_data 41626206Swpaul%#define LI_data zo_data.objdata_u.li_data 41726206Swpaul%#define GR_data zo_data.objdata_u.gr_data 41826206Swpaul% 41926206Swpaul%#define __type_of(o) ((o)->zo_data.zo_type) 42026206Swpaul% 42126206Swpaul%/* Declarations for the internal subroutines in nislib.c */ 42226206Swpaul%enum name_pos {SAME_NAME, HIGHER_NAME, LOWER_NAME, NOT_SEQUENTIAL, BAD_NAME}; 42326206Swpaul%typedef enum name_pos name_pos; 42426206Swpaul% 42526206Swpaul%/* 42626206Swpaul% * Defines for getting at column data in entry objects. Because RPCGEN 42726206Swpaul% * generates some rather wordy structures, we create some defines that 42826206Swpaul% * collapse the needed keystrokes to access a particular value using 42926206Swpaul% * these definitions they take an nis_object *, and an int and return 43026206Swpaul% * a u_char * for Value, and an int for length. 43126206Swpaul% */ 432272808Sbapt%#define ENTRY_VAL(obj, col) (obj)->EN_data.en_cols.en_cols_val[col].ec_value.ec_value_val 433272808Sbapt%#define ENTRY_LEN(obj, col) (obj)->EN_data.en_cols.en_cols_val[col].ec_value.ec_value_len 43426206Swpaul% 43526206Swpaul%#ifdef __cplusplus 43626206Swpaul%} 43726206Swpaul%#endif 43826206Swpaul% 43926206Swpaul%/* Prototypes, and extern declarations for the NIS library functions. */ 44026206Swpaul%#include <rpcsvc/nislib.h> 44126206Swpaul%#endif /* __NIS_RPCGEN_H */ 44226206Swpaul%/* EDIT_START */ 44326206Swpaul% 44426206Swpaul%/* 44526206Swpaul% * nis_3.h 44626206Swpaul% * 44726206Swpaul% * This file contains definitions that are only of interest to the actual 44826206Swpaul% * service daemon and client stubs. Normal users of NIS will not include 44926206Swpaul% * this file. 45026206Swpaul% * 45126206Swpaul% * NOTE : This include file is automatically created by a combination 45226206Swpaul% * of rpcgen and sed. DO NOT EDIT IT, change the nis.x file instead 45326206Swpaul% * and then remake this file. 45426206Swpaul% */ 45526206Swpaul%#ifndef __nis_3_h 45626206Swpaul%#define __nis_3_h 45726206Swpaul%#ifdef __cplusplus 45826206Swpaul%extern "C" { 45926206Swpaul%#endif 46026206Swpaul#endif 461