diff options
author | Petr Vorel <pvorel@suse.cz> | 2020-07-08 13:06:55 +0200 |
---|---|---|
committer | Florian Weimer <fweimer@redhat.com> | 2020-07-08 17:25:57 +0200 |
commit | ae7a94e5e3edf78f4da562edc05ece229614c716 (patch) | |
tree | be0969c61080fc1dbd69293944a3362b20db7cff /nis/rpcsvc | |
parent | acb527929d0c2b3bb0798472c42ddb3203729708 (diff) | |
download | glibc-ae7a94e5e3edf78f4da562edc05ece229614c716.tar.gz glibc-ae7a94e5e3edf78f4da562edc05ece229614c716.tar.xz glibc-ae7a94e5e3edf78f4da562edc05ece229614c716.zip |
Remove --enable-obsolete-nsl configure flag
this means that *always* libnsl is only built as shared library for backward compatibility and the NSS modules libnss_nis and libnss_nisplus are not built at all, libnsl's headers aren't installed. This compatibility is kept only for architectures and ABIs that have been added in or before version 2.28. Replacement implementations based on TIRPC, which additionally support IPv6, are available from <https://github.com/thkukuk/>. This change does not affect libnss_compat which does not depended on libnsl since 2.27 and thus can be used without NIS. libnsl code depends on Sun RPC, e.g. on --enable-obsolete-rpc (installed libnsl headers use installed Sun RPC headers), which will be removed in the following commit.
Diffstat (limited to 'nis/rpcsvc')
-rw-r--r-- | nis/rpcsvc/nis.x | 474 | ||||
-rw-r--r-- | nis/rpcsvc/nis_callback.x | 63 | ||||
-rw-r--r-- | nis/rpcsvc/nis_object.x | 328 | ||||
-rw-r--r-- | nis/rpcsvc/yp.x | 311 | ||||
-rw-r--r-- | nis/rpcsvc/yp_prot.h | 366 |
5 files changed, 0 insertions, 1542 deletions
diff --git a/nis/rpcsvc/nis.x b/nis/rpcsvc/nis.x deleted file mode 100644 index e318af29a6..0000000000 --- a/nis/rpcsvc/nis.x +++ /dev/null @@ -1,474 +0,0 @@ -%/* -% * Copyright (c) 2010, Oracle America, Inc. -% * -% * Redistribution and use in source and binary forms, with or without -% * modification, are permitted provided that the following conditions are -% * met: -% * -% * * Redistributions of source code must retain the above copyright -% * notice, this list of conditions and the following disclaimer. -% * * Redistributions in binary form must reproduce the above -% * copyright notice, this list of conditions and the following -% * disclaimer in the documentation and/or other materials -% * provided with the distribution. -% * * Neither the name of the "Oracle America, Inc." nor the names of its -% * contributors may be used to endorse or promote products derived -% * from this software without specific prior written permission. -% * -% * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -% * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -% * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -% * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -% * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -% * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -% * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE -% * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -% * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -% * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -% * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -% * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -% */ - -#ifdef RPC_HDR -%/* -% * nis.h -% * -% * This file is the main include file for NIS clients. It contains -% * both the client library function defines and the various data -% * structures used by the NIS service. It includes the file nis_tags.h -% * which defines the tag values. This allows the tags to change without -% * having to change the nis.x file. -% * -% * NOTE : DO NOT EDIT THIS FILE! It is automatically generated when -% * rpcgen is run on the nis.x file. Note that there is a -% * simple sed script to remove some unneeded lines. (See the -% * Makefile target nis.h) -% * -% */ -%#include <rpcsvc/nis_tags.h> -#endif - -/* This gets stuffed into the source files. */ -#if RPC_HDR -%#include <rpc/xdr.h> -#endif - -/* Include the RPC Language description of NIS objects */ -#include "nis_object.x" - -/* Errors that can be returned by the service */ -enum nis_error { - NIS_SUCCESS = 0, /* A-ok, let's rock n roll */ - NIS_S_SUCCESS = 1, /* Name found (maybe) */ - NIS_NOTFOUND = 2, /* Name definitely not found */ - NIS_S_NOTFOUND = 3, /* Name maybe not found */ - NIS_CACHEEXPIRED = 4, /* Name exists but cache out of date */ - NIS_NAMEUNREACHABLE = 5, /* Can't get there from here */ - NIS_UNKNOWNOBJ = 6, /* Object type is bogus */ - NIS_TRYAGAIN = 7, /* I'm busy, call back */ - NIS_SYSTEMERROR = 8, /* Generic system error */ - NIS_CHAINBROKEN = 9, /* First/Next warning */ - NIS_PERMISSION = 10, /* Not enough permission to access */ - NIS_NOTOWNER = 11, /* You don't own it, sorry */ - NIS_NOT_ME = 12, /* I don't serve this name */ - NIS_NOMEMORY = 13, /* Outta VM! Help! */ - NIS_NAMEEXISTS = 14, /* Can't create over another name */ - NIS_NOTMASTER = 15, /* I'm justa secondaray, don't ask me */ - NIS_INVALIDOBJ = 16, /* Object is broken somehow */ - NIS_BADNAME = 17, /* Unparsable name */ - NIS_NOCALLBACK = 18, /* Couldn't talk to call back proc */ - NIS_CBRESULTS = 19, /* Results being called back to you */ - NIS_NOSUCHNAME = 20, /* Name unknown */ - NIS_NOTUNIQUE = 21, /* Value is not uniques (entry) */ - NIS_IBMODERROR = 22, /* Inf. Base. Modify error. */ - NIS_NOSUCHTABLE = 23, /* Name for table was wrong */ - NIS_TYPEMISMATCH = 24, /* Entry and table type mismatch */ - NIS_LINKNAMEERROR = 25, /* Link points to bogus name */ - NIS_PARTIAL = 26, /* Partial success, found table */ - NIS_TOOMANYATTRS = 27, /* Too many attributes */ - NIS_RPCERROR = 28, /* RPC error encountered */ - NIS_BADATTRIBUTE = 29, /* Bad or invalid attribute */ - NIS_NOTSEARCHABLE = 30, /* Non-searchable object searched */ - NIS_CBERROR = 31, /* Error during callback (svc crash) */ - NIS_FOREIGNNS = 32, /* Foreign Namespace */ - NIS_BADOBJECT = 33, /* Malformed object structure */ - NIS_NOTSAMEOBJ = 34, /* Object swapped during deletion */ - NIS_MODFAIL = 35, /* Failure during a Modify. */ - NIS_BADREQUEST = 36, /* Illegal query for table */ - NIS_NOTEMPTY = 37, /* Attempt to remove a non-empty tbl */ - NIS_COLDSTART_ERR = 38, /* Error accesing the cold start file */ - NIS_RESYNC = 39, /* Transaction log too far out of date */ - NIS_FAIL = 40, /* NIS operation failed. */ - NIS_UNAVAIL = 41, /* NIS+ service is unavailable (client) */ - NIS_RES2BIG = 42, /* NIS+ result too big for datagram */ - NIS_SRVAUTH = 43, /* NIS+ server wasn't authenticated. */ - NIS_CLNTAUTH = 44, /* NIS+ Client wasn't authenticated. */ - NIS_NOFILESPACE = 45, /* NIS+ server ran out of disk space */ - NIS_NOPROC = 46, /* NIS+ server couldn't create new proc */ - NIS_DUMPLATER = 47 /* NIS+ server already has dump child */ -}; - - -/* - * Structure definitions for the parameters and results of the actual - * NIS RPC calls. - * - * This is the standard result (in the protocol) of most of the nis - * requests. - */ - -struct nis_result { - nis_error status; /* Status of the response */ - nis_object objects<>; /* objects found */ - netobj cookie; /* Cookie Data */ - uint32_t zticks; /* server ticks */ - uint32_t dticks; /* DBM ticks. */ - uint32_t aticks; /* Cache (accel) ticks */ - uint32_t cticks; /* Client ticks */ -}; - -/* - * A Name Service request - * This request is used to access the name space, ns_name is the name - * of the object within the namespace and the object is it's value, for - * add/modify, a copy of the original for remove. - */ - -struct ns_request { - nis_name ns_name; /* Name in the NIS name space */ - nis_object ns_object<1>; /* Optional Object (add/remove) */ -}; - -/* - * An information base request - * This request includes the NIS name of the table we wish to search, the - * search criteria in the form of attribute/value pairs and an optional - * callback program number. If the callback program number is provided - * the server will send back objects one at a time, otherwise it will - * return them all in the response. - */ - -struct ib_request { - nis_name ibr_name; /* The name of the Table */ - nis_attr ibr_srch<>; /* The search critereia */ - uint32_t ibr_flags; /* Optional flags */ - nis_object ibr_obj<1>; /* optional object (add/modify) */ - nis_server ibr_cbhost<1>; /* Optional callback info */ - u_int ibr_bufsize; /* Optional first/next bufsize */ - netobj ibr_cookie; /* The first/next cookie */ -}; - -/* - * This argument to the PING call notifies the replicas that something in - * a directory has changed and this is it's timestamp. The replica will use - * the timestamp to determine if its resync operation was successful. - */ -struct ping_args { - nis_name dir; /* Directory that had the change */ - uint32_t stamp; /* timestamp of the transaction */ -}; - -/* - * These are the type of entries that are stored in the transaction log, - * note that modifications will appear as two entries, for names, they have - * a "OLD" entry followed by a "NEW" entry. For entries in tables, there - * is a remove followed by an add. It is done this way so that we can read - * the log backwards to back out transactions and forwards to propogate - * updated. - */ -enum log_entry_t { - LOG_NOP = 0, - ADD_NAME = 1, /* Name Added to name space */ - REM_NAME = 2, /* Name removed from name space */ - MOD_NAME_OLD = 3, /* Name was modified in the name space */ - MOD_NAME_NEW = 4, /* Name was modified in the name space */ - ADD_IBASE = 5, /* Entry added to information base */ - REM_IBASE = 6, /* Entry removed from information base */ - MOD_IBASE = 7, /* Entry was modified in information base */ - UPD_STAMP = 8 /* Update timestamp (used as fenceposts) */ -}; - -/* - * This result is returned from the name service when it is requested to - * dump logged entries from its transaction log. Information base updates - * will have the name of the information base in the le_name field and - * a canonical set of attribute/value pairs to fully specify the entry's - * 'name'. - */ -struct log_entry { - uint32_t le_time; /* Time in seconds */ - log_entry_t le_type; /* Type of log entry */ - nis_name le_princp; /* Principal making the change */ - nis_name le_name; /* Name of table/dir involved */ - nis_attr le_attrs<>; /* List of AV pairs. */ - nis_object le_object; /* Actual object value */ -}; - -struct log_result { - nis_error lr_status; /* The status itself */ - netobj lr_cookie; /* Used by the dump callback */ - log_entry lr_entries<>; /* zero or more entries */ -}; - -struct cp_result { - nis_error cp_status; /* Status of the checkpoint */ - uint32_t cp_zticks; /* Service 'ticks' */ - uint32_t cp_dticks; /* Database 'ticks' */ -}; - -/* - * This structure defines a generic NIS tag list. The taglist contains - * zero or tags, each of which is a type and a value. (u_int). - * These are used to report statistics (see tag definitions below) - * and to set or reset state variables. - */ -struct nis_tag { - uint32_t tag_type; /* Statistic tag (may vary) */ - string tag_val<>; /* Statistic value may also vary */ -}; - -struct nis_taglist { - nis_tag tags<>; /* List of tags */ -}; - -struct dump_args { - nis_name da_dir; /* Directory to dump */ - uint32_t da_time; /* From this timestamp */ - nis_server da_cbhost<1>; /* Callback to use. */ -}; - -struct fd_args { - nis_name dir_name; /* The directory we're looking for */ - nis_name requester; /* Host principal name for signature */ -}; - -struct fd_result { - nis_error status; /* Status returned by function */ - nis_name source; /* Source of this answer */ - opaque dir_data<>; /* Directory Data (XDR'ed) */ - opaque signature<>; /* Signature of the source */ -}; - -%/* -% * Structures used for server binding. -% */ -struct nis_bound_endpoint { - endpoint ep; - int generation; - int rank; - uint32_t flags; - int hostnum; - int epnum; - nis_name uaddr; - endpoint cbep; -}; -typedef struct nis_bound_endpoint nis_bound_endpoint; - -struct nis_bound_directory { - int generation; - int min_rank; /* minimum rank of bound endpoints */ - int optimal_rank; /* best possible rank of all endpoints */ - directory_obj dobj; - nis_bound_endpoint BEP<>; -}; -typedef struct nis_bound_directory nis_bound_directory; -%#define bep_len BEP.BEP_len -%#define bep_val BEP.BEP_val - -struct nis_active_endpoint { - endpoint ep; - nis_name hostname; - int rank; - int uaddr_generation; - nis_name uaddr; - int cbep_generation; - endpoint cbep; -}; -typedef struct nis_active_endpoint nis_active_endpoint; - -%/* defines for nis_bound_endpoint.flags */ -%#define NIS_BOUND 0x1 -%#define NIS_TRANSIENT_ERRORS 0x2 - -program NIS_PROG { - - /* RPC Language description of the NIS+ protocol */ - version NIS_VERSION { - /* The name service functions */ - nis_result NIS_LOOKUP(ns_request) = 1; - nis_result NIS_ADD(ns_request) = 2; - nis_result NIS_MODIFY(ns_request) = 3; - nis_result NIS_REMOVE(ns_request) = 4; - - /* The information base functions */ - nis_result NIS_IBLIST(ib_request) = 5; - nis_result NIS_IBADD(ib_request) = 6; - nis_result NIS_IBMODIFY(ib_request) = 7; - nis_result NIS_IBREMOVE(ib_request) = 8; - nis_result NIS_IBFIRST(ib_request) = 9; - nis_result NIS_IBNEXT(ib_request) = 10; - - /* NIS Administrative functions */ - fd_result NIS_FINDDIRECTORY(fd_args) = 12; - - /* If fetch and optionally reset statistics */ - nis_taglist NIS_STATUS(nis_taglist) = 14; - - /* Dump changes to directory since time in da_time */ - log_result NIS_DUMPLOG(dump_args) = 15; - - /* Dump contents of directory named */ - log_result NIS_DUMP(dump_args) = 16; - - /* Check status of callback thread */ - bool NIS_CALLBACK(netobj) = 17; - - /* Return last update time for named dir */ - uint32_t NIS_CPTIME(nis_name) = 18; - - /* Checkpoint directory or table named */ - cp_result NIS_CHECKPOINT(nis_name) = 19; - - /* Send 'status changed' ping to replicates */ - void NIS_PING(ping_args) = 20; - - /* Modify server behaviour (such as debugging) */ - nis_taglist NIS_SERVSTATE(nis_taglist) = 21; - - /* Create a Directory */ - nis_error NIS_MKDIR(nis_name) = 22; - - /* Remove a Directory */ - nis_error NIS_RMDIR(nis_name) = 23; - - /* Update public keys of a directory object */ - nis_error NIS_UPDKEYS(nis_name) = 24; - } = 3; -} = 100300; - -/* - * Included below are the defines that become part of nis.h, - * they are technically not part of the protocol, but do define - * key aspects of the implementation and are therefore useful - * in building a conforming server or client. - */ -#if RPC_HDR -%/* -% * Generic "hash" datastructures, used by all types of hashed data. -% */ -%struct nis_hash_data { -% nis_name name; /* NIS name of hashed item */ -% int keychain; /* It's hash key (for pop) */ -% struct nis_hash_data *next; /* Hash collision pointer */ -% struct nis_hash_data *prv_item; /* A serial, doubly linked list */ -% struct nis_hash_data *nxt_item; /* of items in the hash table */ -%}; -%typedef struct nis_hash_data NIS_HASH_ITEM; -% -%struct nis_hash_table { -% NIS_HASH_ITEM *keys[64]; /* A hash table of items */ -% NIS_HASH_ITEM *first; /* The first "item" in serial list */ -%}; -%typedef struct nis_hash_table NIS_HASH_TABLE; -% -%/* Structure for storing dynamically allocated static data */ -%struct nis_sdata { -% void *buf; /* Memory allocation pointer */ -% u_int size; /* Buffer size */ -%}; -% -%/* Generic client creating flags */ -%#define ZMH_VC 1 -%#define ZMH_DG 2 -%#define ZMH_AUTH 4 -% -%/* Testing Access rights for objects */ -% -%#define NIS_READ_ACC 1 -%#define NIS_MODIFY_ACC 2 -%#define NIS_CREATE_ACC 4 -%#define NIS_DESTROY_ACC 8 -%/* Test macros. a == access rights, m == desired rights. */ -%#define NIS_WORLD(a, m) (((a) & (m)) != 0) -%#define NIS_GROUP(a, m) (((a) & ((m) << 8)) != 0) -%#define NIS_OWNER(a, m) (((a) & ((m) << 16)) != 0) -%#define NIS_NOBODY(a, m) (((a) & ((m) << 24)) != 0) -%/* -% * EOL Alert - The following non-prefixed test macros are -% * here for backward compatability, and will be not be present -% * in future releases - use the NIS_*() macros above. -% */ -%#define WORLD(a, m) (((a) & (m)) != 0) -%#define GROUP(a, m) (((a) & ((m) << 8)) != 0) -%#define OWNER(a, m) (((a) & ((m) << 16)) != 0) -%#define NOBODY(a, m) (((a) & ((m) << 24)) != 0) -% -%#define OATYPE(d, n) (((d)->do_armask.do_armask_val+n)->oa_otype) -%#define OARIGHTS(d, n) (((d)->do_armask.do_armask_val+n)->oa_rights) -%#define WORLD_DEFAULT (NIS_READ_ACC) -%#define GROUP_DEFAULT (NIS_READ_ACC << 8) -%#define OWNER_DEFAULT ((NIS_READ_ACC +\ - NIS_MODIFY_ACC +\ - NIS_CREATE_ACC +\ - NIS_DESTROY_ACC) << 16) -%#define DEFAULT_RIGHTS (WORLD_DEFAULT | GROUP_DEFAULT | OWNER_DEFAULT) -% -%/* Result manipulation defines ... */ -%#define NIS_RES_NUMOBJ(x) ((x)->objects.objects_len) -%#define NIS_RES_OBJECT(x) ((x)->objects.objects_val) -%#define NIS_RES_COOKIE(x) ((x)->cookie) -%#define NIS_RES_STATUS(x) ((x)->status) -% -%/* These defines make getting at the variant part of the object easier. */ -%#define TA_data zo_data.objdata_u.ta_data -%#define EN_data zo_data.objdata_u.en_data -%#define DI_data zo_data.objdata_u.di_data -%#define LI_data zo_data.objdata_u.li_data -%#define GR_data zo_data.objdata_u.gr_data -% -%#define __type_of(o) ((o)->zo_data.zo_type) -% -%/* Declarations for the internal subroutines in nislib.c */ -%enum name_pos {SAME_NAME, HIGHER_NAME, LOWER_NAME, NOT_SEQUENTIAL, BAD_NAME}; -%typedef enum name_pos name_pos; -% -%/* -% * Defines for getting at column data in entry objects. Because RPCGEN -% * generates some rather wordy structures, we create some defines that -% * collapse the needed keystrokes to access a particular value using -% * these definitions they take an nis_object *, and an int and return -% * a u_char * for Value, and an int for length. -% */ -%#define ENTRY_VAL(obj, col) \ -% (obj)->EN_data.en_cols.en_cols_val[col].ec_value.ec_value_val -%#define ENTRY_LEN(obj, col) \ -% (obj)->EN_data.en_cols.en_cols_val[col].ec_value.ec_value_len -% -% -% -%#ifdef __cplusplus -%} -%#endif -% -%/* Prototypes, and extern declarations for the NIS library functions. */ -%#include <rpcsvc/nislib.h> -%#endif /* __NIS_RPCGEN_H */ -%/* EDIT_START */ -% -%/* -% * nis_3.h -% * -% * This file contains definitions that are only of interest to the actual -% * service daemon and client stubs. Normal users of NIS will not include -% * this file. -% * -% * NOTE : This include file is automatically created by a combination -% * of rpcgen and sed. DO NOT EDIT IT, change the nis.x file instead -% * and then remake this file. -% */ -%#ifndef __nis_3_h -%#define __nis_3_h -%#ifdef __cplusplus -%extern "C" { -%#endif -#endif diff --git a/nis/rpcsvc/nis_callback.x b/nis/rpcsvc/nis_callback.x deleted file mode 100644 index 0fdca9eeec..0000000000 --- a/nis/rpcsvc/nis_callback.x +++ /dev/null @@ -1,63 +0,0 @@ -%/* -% * Copyright (c) 2010, Oracle America, Inc. -% * -% * Redistribution and use in source and binary forms, with or without -% * modification, are permitted provided that the following conditions are -% * met: -% * -% * * Redistributions of source code must retain the above copyright -% * notice, this list of conditions and the following disclaimer. -% * * Redistributions in binary form must reproduce the above -% * copyright notice, this list of conditions and the following -% * disclaimer in the documentation and/or other materials -% * provided with the distribution. -% * * Neither the name of the "Oracle America, Inc." nor the names of its -% * contributors may be used to endorse or promote products derived -% * from this software without specific prior written permission. -% * -% * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS -% * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT -% * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS -% * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE -% * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, -% * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL -% * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE -% * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS -% * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -% * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING -% * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE -% * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -% */ - -/* - * nis_callback.x - */ - -%#pragma ident "@(#)nis_callback.x 1.7 94/05/03" - -/* - * "@(#)zns_cback.x 1.2 90/09/10" - * - * RPCL description of the Callback Service. - */ - -#ifdef RPC_HDR -%#include <rpcsvc/nis.h> -#endif -#ifdef RPC_XDR -%#include "nis_clnt.h" -#endif - -typedef nis_object *obj_p; - -struct cback_data { - obj_p entries<>; /* List of objects */ -}; - -program CB_PROG { - version CB_VERS { - bool CBPROC_RECEIVE(cback_data) = 1; - void CBPROC_FINISH(void) = 2; - void CBPROC_ERROR(nis_error) = 3; - } = 1; -} = 100302; diff --git a/nis/rpcsvc/nis_object.x b/nis/rpcsvc/nis_object.x deleted file mode 100644 index 774b38fa9c..0000000000 --- a/nis/rpcsvc/nis_object.x +++ /dev/null @@ -1,328 +0,0 @@ -/* - * nis_object.x - * - * Copyright (c) 2010, Oracle America, Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * * Neither the name of the "Oracle America, Inc." nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -%#pragma ident "@(#)nis_object.x 1.12 97/11/19" - -#if RPC_HDR -% -%#ifndef __nis_object_h -%#define __nis_object_h -% -#endif -/* - * This file defines the format for a NIS object in RPC language. - * It is included by the main .x file and the database access protocol - * file. It is common because both of them need to deal with the same - * type of object. Generating the actual code though is a bit messy because - * the nis.x file and the nis_dba.x file will generate xdr routines to - * encode/decode objects when only one set is needed. Such is life when - * one is using rpcgen. - * - * Note, the protocol doesn't specify any limits on such things as - * maximum name length, number of attributes, etc. These are enforced - * by the database backend. When you hit them you will no. Also see - * the db_getlimits() function for fetching the limit values. - * - */ - -/* Some manifest constants, chosen to maximize flexibility without - * plugging the wire full of data. - */ -const NIS_MAXSTRINGLEN = 255; -const NIS_MAXNAMELEN = 1024; -const NIS_MAXATTRNAME = 32; -const NIS_MAXATTRVAL = 2048; -const NIS_MAXCOLUMNS = 64; -const NIS_MAXATTR = 16; -const NIS_MAXPATH = 1024; -const NIS_MAXREPLICAS = 128; -const NIS_MAXLINKS = 16; - -const NIS_PK_NONE = 0; /* no public key (unix/sys auth) */ -const NIS_PK_DH = 1; /* Public key is Diffie-Hellman type */ -const NIS_PK_RSA = 2; /* Public key if RSA type */ -const NIS_PK_KERB = 3; /* Use kerberos style authentication */ -const NIS_PK_DHEXT = 4; /* Extended Diffie-Hellman for RPC-GSS */ - -/* - * The fundamental name type of NIS. The name may consist of two parts, - * the first being the fully qualified name, and the second being an - * optional set of attribute/value pairs. - */ -struct nis_attr { - string zattr_ndx<>; /* name of the index */ - opaque zattr_val<>; /* Value for the attribute. */ -}; - -typedef string nis_name<>; /* The NIS name itself. */ - -/* NIS object types are defined by the following enumeration. The numbers - * they use are based on the following scheme : - * 0 - 1023 are reserved for Sun, - * 1024 - 2047 are defined to be private to a particular tree. - * 2048 - 4095 are defined to be user defined. - * 4096 - ... are reserved for future use. - * - * EOL Alert - The non-prefixed names are present for backward - * compatability only, and will not exist in future releases. Use - * the NIS_* names for future compatability. - */ - -enum zotypes { - - BOGUS_OBJ = 0, /* Uninitialized object structure */ - NO_OBJ = 1, /* NULL object (no data) */ - DIRECTORY_OBJ = 2, /* Directory object describing domain */ - GROUP_OBJ = 3, /* Group object (a list of names) */ - TABLE_OBJ = 4, /* Table object (a database schema) */ - ENTRY_OBJ = 5, /* Entry object (a database record) */ - LINK_OBJ = 6, /* A name link. */ - PRIVATE_OBJ = 7, /* Private object (all opaque data) */ - - NIS_BOGUS_OBJ = 0, /* Uninitialized object structure */ - NIS_NO_OBJ = 1, /* NULL object (no data) */ - NIS_DIRECTORY_OBJ = 2, /* Directory object describing domain */ - NIS_GROUP_OBJ = 3, /* Group object (a list of names) */ - NIS_TABLE_OBJ = 4, /* Table object (a database schema) */ - NIS_ENTRY_OBJ = 5, /* Entry object (a database record) */ - NIS_LINK_OBJ = 6, /* A name link. */ - NIS_PRIVATE_OBJ = 7 /* Private object (all opaque data) */ -}; - -/* - * The types of Name services NIS knows about. They are enumerated - * here. The Binder code will use this type to determine if it has - * a set of library routines that will access the indicated name service. - */ -enum nstype { - UNKNOWN = 0, - NIS = 1, /* Nis Plus Service */ - SUNYP = 2, /* Old NIS Service */ - IVY = 3, /* Nis Plus Plus Service */ - DNS = 4, /* Domain Name Service */ - X500 = 5, /* ISO/CCCIT X.500 Service */ - DNANS = 6, /* Digital DECNet Name Service */ - XCHS = 7, /* Xerox ClearingHouse Service */ - CDS= 8 -}; - -/* - * DIRECTORY - The name service object. These objects identify other name - * servers that are serving some portion of the name space. Each has a - * type associated with it. The resolver library will note whether or not - * is has the needed routines to access that type of service. - * The oarmask structure defines an access rights mask on a per object - * type basis for the name spaces. The only bits currently used are - * create and destroy. By enabling or disabling these access rights for - * a specific object type for a one of the accessor entities (owner, - * group, world) the administrator can control what types of objects - * may be freely added to the name space and which require the - * administrator's approval. - */ -struct oar_mask { - uint32_t oa_rights; /* Access rights mask */ - zotypes oa_otype; /* Object type */ -}; - -struct endpoint { - string uaddr<>; - string family<>; /* Transport family (INET, OSI, etc) */ - string proto<>; /* Protocol (TCP, UDP, CLNP, etc) */ -}; - -/* - * Note: pkey is a netobj which is limited to 1024 bytes which limits the - * keysize to 8192 bits. This is consider to be a reasonable limit for - * the expected lifetime of this service. - */ -struct nis_server { - nis_name name; /* Principal name of the server */ - endpoint ep<>; /* Universal addr(s) for server */ - uint32_t key_type; /* Public key type */ - netobj pkey; /* server's public key */ -}; - -struct directory_obj { - nis_name do_name; /* Name of the directory being served */ - nstype do_type; /* one of NIS, DNS, IVY, YP, or X.500 */ - nis_server do_servers<>; /* <0> == Primary name server */ - uint32_t do_ttl; /* Time To Live (for caches) */ - oar_mask do_armask<>; /* Create/Destroy rights by object type */ -}; - -/* - * ENTRY - This is one row of data from an information base. - * The type value is used by the client library to convert the entry to - * it's internal structure representation. The Table name is a back pointer - * to the table where the entry is stored. This allows the client library - * to determine where to send a request if the client wishes to change this - * entry but got to it through a LINK rather than directly. - * If the entry is a "standalone" entry then this field is void. - */ -const EN_BINARY = 1; /* Indicates value is binary data */ -const EN_CRYPT = 2; /* Indicates the value is encrypted */ -const EN_XDR = 4; /* Indicates the value is XDR encoded */ -const EN_MODIFIED = 8; /* Indicates entry is modified. */ -const EN_ASN1 = 64; /* Means contents use ASN.1 encoding */ - -struct entry_col { - uint32_t ec_flags; /* Flags for this value */ - opaque ec_value<>; /* It's textual value */ -}; - -struct entry_obj { - string en_type<>; /* Type of entry such as "passwd" */ - entry_col en_cols<>; /* Value for the entry */ -}; - -/* - * GROUP - The group object contains a list of NIS principal names. Groups - * are used to authorize principals. Each object has a set of access rights - * for members of its group. Principal names in groups are in the form - * name.directory and recursive groups are expressed as @groupname.directory - */ -struct group_obj { - uint32_t gr_flags; /* Flags controlling group */ - nis_name gr_members<>; /* List of names in group */ -}; - -/* - * LINK - This is the LINK object. It is quite similar to a symbolic link - * in the UNIX filesystem. The attributes in the main object structure are - * relative to the LINK data and not what it points to (like the file system) - * "modify" privleges here indicate the right to modify what the link points - * at and not to modify that actual object pointed to by the link. - */ -struct link_obj { - zotypes li_rtype; /* Real type of the object */ - nis_attr li_attrs<>; /* Attribute/Values for tables */ - nis_name li_name; /* The object's real NIS name */ -}; - -/* - * TABLE - This is the table object. It implements a simple - * data base that applications and use for configuration or - * administration purposes. The role of the table is to group together - * a set of related entries. Tables are the simple database component - * of NIS. Like many databases, tables are logically divided into columns - * and rows. The columns are labeled with indexes and each ENTRY makes - * up a row. Rows may be addressed within the table by selecting one - * or more indexes, and values for those indexes. Each row which has - * a value for the given index that matches the desired value is returned. - * Within the definition of each column there is a flags variable, this - * variable contains flags which determine whether or not the column is - * searchable, contains binary data, and access rights for the entry objects - * column value. - */ - -const TA_BINARY = 1; /* Means table data is binary */ -const TA_CRYPT = 2; /* Means value should be encrypted */ -const TA_XDR = 4; /* Means value is XDR encoded */ -const TA_SEARCHABLE = 8; /* Means this column is searchable */ -const TA_CASE = 16; /* Means this column is Case Sensitive */ -const TA_MODIFIED = 32; /* Means this columns attrs are modified*/ -const TA_ASN1 = 64; /* Means contents use ASN.1 encoding */ - -struct table_col { - string tc_name<64>; /* Column Name */ - uint32_t tc_flags; /* control flags */ - uint32_t tc_rights; /* Access rights mask */ -}; - -struct table_obj { - string ta_type<64>; /* Table type such as "passwd" */ - int ta_maxcol; /* Total number of columns */ - u_char ta_sep; /* Separator character */ - table_col ta_cols<>; /* The number of table indexes */ - string ta_path<>; /* A search path for this table */ -}; - -/* - * This union joins together all of the currently known objects. - */ -union objdata switch (zotypes zo_type) { - case NIS_DIRECTORY_OBJ : - struct directory_obj di_data; - case NIS_GROUP_OBJ : - struct group_obj gr_data; - case NIS_TABLE_OBJ : - struct table_obj ta_data; - case NIS_ENTRY_OBJ: - struct entry_obj en_data; - case NIS_LINK_OBJ : - struct link_obj li_data; - case NIS_PRIVATE_OBJ : - opaque po_data<>; - case NIS_NO_OBJ : - void; - case NIS_BOGUS_OBJ : - void; - default : - void; -}; - -/* - * This is the basic NIS object data type. It consists of a generic part - * which all objects contain, and a specialized part which varies depending - * on the type of the object. All of the specialized sections have been - * described above. You might have wondered why they all start with an - * integer size, followed by the useful data. The answer is, when the - * server doesn't recognize the type returned it treats it as opaque data. - * And the definition for opaque data is {int size; char *data;}. In this - * way, servers and utility routines that do not understand a given type - * may still pass it around. One has to be careful in setting - * this variable accurately, it must take into account such things as - * XDR padding of structures etc. The best way to set it is to note one's - * position in the XDR encoding stream, encode the structure, look at the - * new position and calculate the size. - */ -struct nis_oid { - uint32_t ctime; /* Time of objects creation */ - uint32_t mtime; /* Time of objects modification */ -}; - -struct nis_object { - nis_oid zo_oid; /* object identity verifier. */ - nis_name zo_name; /* The NIS name for this object */ - nis_name zo_owner; /* NIS name of object owner. */ - nis_name zo_group; /* NIS name of access group. */ - nis_name zo_domain; /* The administrator for the object */ - uint32_t zo_access; /* Access rights (owner, group, world) */ - uint32_t zo_ttl; /* Object's time to live in seconds. */ - objdata zo_data; /* Data structure for this type */ -}; -#if RPC_HDR -% -%#endif /* if __nis_object_h */ -% -#endif diff --git a/nis/rpcsvc/yp.x b/nis/rpcsvc/yp.x deleted file mode 100644 index 269ae6f606..0000000000 --- a/nis/rpcsvc/yp.x +++ /dev/null @@ -1,311 +0,0 @@ -/* @(#)yp.x 2.1 88/08/01 4.0 RPCSRC */ - -/* - * Copyright (c) 2010, Oracle America, Inc. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions are - * met: - * - * * Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * * Redistributions in binary form must reproduce the above - * copyright notice, this list of conditions and the following - * disclaimer in the documentation and/or other materials - * provided with the distribution. - * * Neither the name of the "Oracle America, Inc." nor the names of its - * contributors may be used to endorse or promote products derived - * from this software without specific prior written permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS - * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE - * COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, - * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL - * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS - * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, - * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING - * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - */ - -/* - * Protocol description file for the Yellow Pages Service - */ - -const YPMAXRECORD = 1024; -const YPMAXDOMAIN = 64; -const YPMAXMAP = 64; -const YPMAXPEER = 64; - - -enum ypstat { - YP_TRUE = 1, - YP_NOMORE = 2, - YP_FALSE = 0, - YP_NOMAP = -1, - YP_NODOM = -2, - YP_NOKEY = -3, - YP_BADOP = -4, - YP_BADDB = -5, - YP_YPERR = -6, - YP_BADARGS = -7, - YP_VERS = -8 -}; - - -enum ypxfrstat { - YPXFR_SUCC = 1, - YPXFR_AGE = 2, - YPXFR_NOMAP = -1, - YPXFR_NODOM = -2, - YPXFR_RSRC = -3, - YPXFR_RPC = -4, - YPXFR_MADDR = -5, - YPXFR_YPERR = -6, - YPXFR_BADARGS = -7, - YPXFR_DBM = -8, - YPXFR_FILE = -9, - YPXFR_SKEW = -10, - YPXFR_CLEAR = -11, - YPXFR_FORCE = -12, - YPXFR_XFRERR = -13, - YPXFR_REFUSED = -14 -}; - - -typedef string domainname<YPMAXDOMAIN>; -typedef string mapname<YPMAXMAP>; -typedef string peername<YPMAXPEER>; -typedef opaque keydat<YPMAXRECORD>; -typedef opaque valdat<YPMAXRECORD>; - - -struct ypmap_parms { - domainname domain; - mapname map; - unsigned int ordernum; - peername peer; -}; - -struct ypreq_key { - domainname domain; - mapname map; - keydat key; -}; - -struct ypreq_nokey { - domainname domain; - mapname map; -}; - -struct ypreq_xfr { - ypmap_parms map_parms; - unsigned int transid; - unsigned int prog; - unsigned int port; -}; - - -struct ypresp_val { - ypstat stat; - valdat val; -}; - -struct ypresp_key_val { - ypstat stat; -#ifdef STUPID_SUN_BUG - /* This is the form as distributed by Sun. But even the Sun NIS - servers expect the values in the other order. So their - implementation somehow must change the order internally. We - don't want to follow this bad example since the user should be - able to use rpcgen on this file. */ - keydat key; - valdat val; -#else - valdat val; - keydat key; -#endif -}; - - -struct ypresp_master { - ypstat stat; - peername peer; -}; - -struct ypresp_order { - ypstat stat; - unsigned int ordernum; -}; - -union ypresp_all switch (bool more) { -case TRUE: - ypresp_key_val val; -case FALSE: - void; -}; - -struct ypresp_xfr { - unsigned int transid; - ypxfrstat xfrstat; -}; - -struct ypmaplist { - mapname map; - ypmaplist *next; -}; - -struct ypresp_maplist { - ypstat stat; - ypmaplist *maps; -}; - -enum yppush_status { - YPPUSH_SUCC = 1, /* Success */ - YPPUSH_AGE = 2, /* Master's version not newer */ - YPPUSH_NOMAP = -1, /* Can't find server for map */ - YPPUSH_NODOM = -2, /* Domain not supported */ - YPPUSH_RSRC = -3, /* Local resource alloc failure */ - YPPUSH_RPC = -4, /* RPC failure talking to server */ - YPPUSH_MADDR = -5, /* Can't get master address */ - YPPUSH_YPERR = -6, /* YP server/map db error */ - YPPUSH_BADARGS = -7, /* Request arguments bad */ - YPPUSH_DBM = -8, /* Local dbm operation failed */ - YPPUSH_FILE = -9, /* Local file I/O operation failed */ - YPPUSH_SKEW = -10, /* Map version skew during transfer */ - YPPUSH_CLEAR = -11, /* Can't send "Clear" req to local ypserv */ - YPPUSH_FORCE = -12, /* No local order number in map use -f flag. */ - YPPUSH_XFRERR = -13, /* ypxfr error */ - YPPUSH_REFUSED = -14 /* Transfer request refused by ypserv */ -}; - -struct yppushresp_xfr { - unsigned transid; - yppush_status status; -}; - -/* - * Response structure and overall result status codes. Success and failure - * represent two separate response message types. - */ - -enum ypbind_resptype { - YPBIND_SUCC_VAL = 1, - YPBIND_FAIL_VAL = 2 -}; - -struct ypbind_binding { - opaque ypbind_binding_addr[4]; /* In network order */ - opaque ypbind_binding_port[2]; /* In network order */ -}; - -union ypbind_resp switch (ypbind_resptype ypbind_status) { -case YPBIND_FAIL_VAL: - unsigned ypbind_error; -case YPBIND_SUCC_VAL: - ypbind_binding ypbind_bindinfo; -}; - -/* Detailed failure reason codes for response field ypbind_error*/ - -const YPBIND_ERR_ERR = 1; /* Internal error */ -const YPBIND_ERR_NOSERV = 2; /* No bound server for passed domain */ -const YPBIND_ERR_RESC = 3; /* System resource allocation failure */ - - -/* - * Request data structure for ypbind "Set domain" procedure. - */ -struct ypbind_setdom { - domainname ypsetdom_domain; - ypbind_binding ypsetdom_binding; - unsigned ypsetdom_vers; -}; - - -/* - * YP access protocol - */ -program YPPROG { - version YPVERS { - void - YPPROC_NULL(void) = 0; - - bool - YPPROC_DOMAIN(domainname) = 1; - - bool - YPPROC_DOMAIN_NONACK(domainname) = 2; - - ypresp_val - YPPROC_MATCH(ypreq_key) = 3; - - ypresp_key_val - YPPROC_FIRST(ypreq_key) = 4; - - ypresp_key_val - YPPROC_NEXT(ypreq_key) = 5; - - ypresp_xfr - YPPROC_XFR(ypreq_xfr) = 6; - - void - YPPROC_CLEAR(void) = 7; - - ypresp_all - YPPROC_ALL(ypreq_nokey) = 8; - - ypresp_master - YPPROC_MASTER(ypreq_nokey) = 9; - - ypresp_order - YPPROC_ORDER(ypreq_nokey) = 10; - - ypresp_maplist - YPPROC_MAPLIST(domainname) = 11; - } = 2; -} = 100004; - - -/* - * YPPUSHPROC_XFRRESP is the callback routine for result of YPPROC_XFR - */ -program YPPUSH_XFRRESPPROG { - version YPPUSH_XFRRESPVERS { - void - YPPUSHPROC_NULL(void) = 0; - -#ifdef STUPID_SUN_BUG - /* This is the form as distributed by Sun. But even - the Sun NIS servers expect the values in the other - order. So their implementation somehow must change - the order internally. We don't want to follow this - bad example since the user should be able to use - rpcgen on this file. */ - yppushresp_xfr - YPPUSHPROC_XFRRESP(void) = 1; -#else - void - YPPUSHPROC_XFRRESP(yppushresp_xfr) = 1; -#endif - } = 1; -} = 0x40000000; /* transient: could be anything up to 0x5fffffff */ - -/* - * YP binding protocol - */ -program YPBINDPROG { - version YPBINDVERS { - void - YPBINDPROC_NULL(void) = 0; - - ypbind_resp - YPBINDPROC_DOMAIN(domainname) = 1; - - void - YPBINDPROC_SETDOM(ypbind_setdom) = 2; - } = 2; -} = 100007; diff --git a/nis/rpcsvc/yp_prot.h b/nis/rpcsvc/yp_prot.h deleted file mode 100644 index ae0db3688e..0000000000 --- a/nis/rpcsvc/yp_prot.h +++ /dev/null @@ -1,366 +0,0 @@ -/* - * This file contains symbols and structures defining the rpc protocol - * between the NIS clients and the NIS servers. The servers - * are the NIS database servers, and the NIS binders. - */ - -#ifndef _RPCSVC_YP_PROT_H -#define _RPCSVC_YP_PROT_H - -#include <features.h> - -#include <rpc/rpc.h> -#include <rpcsvc/ypclnt.h> - -__BEGIN_DECLS - -/* - * The following procedures are supported by the protocol: - * - * YPPROC_NULL() returns () takes nothing, returns nothing. This indicates - * that the NIS server is alive. - * - * YPPROC_DOMAIN (char *) returns (bool_t) TRUE. Indicates that the - * responding NIS server does serve the named domain; FALSE indicates no - * support. - * - * YPPROC_DOMAIN_NONACK (char *) returns (TRUE) if the NIS server does serve - * the named domain, otherwise does not return. Used in the broadcast case. - * - * YPPROC_MATCH (struct ypreq_key) returns (struct ypresp_val). Returns the - * right-hand value for a passed left-hand key, within a named map and - * domain. - * - * YPPROC_FIRST (struct ypreq_nokey) returns (struct ypresp_key_val). - * Returns the first key-value pair from a named domain and map. - * - * YPPROC_NEXT (struct ypreq_key) returns (struct ypresp_key_val). Returns - * the key-value pair following a passed key-value pair within a named - * domain and map. - * - * YPPROC_XFR (struct ypreq_xfr) returns nothing. Indicates to a server that - * a map should be updated. - * - * YPPROC_CLEAR takes nothing, returns nothing. Instructs a NIS server to - * close the current map, so that old versions of the disk file don't get - * held open. - * - * YPPROC_ALL (struct ypreq_nokey), returns - * union switch (bool_t more) { - * TRUE: (struct ypresp_key_val); - * FALSE: (struct) {}; - * } - * - * YPPROC_MASTER (struct ypreq_nokey), returns (ypresp_master) - * - * YPPROC_ORDER (struct ypreq_nokey), returns (ypresp_order) - * - * YPPROC_MAPLIST (char *), returns (struct ypmaplist *) - */ - -/* Program and version symbols, magic numbers */ - -#define YPPROG 100004 -#define YPVERS 2 -#define YPVERS_ORIG 1 -#define YPMAXRECORD 1024 -#define YPMAXDOMAIN 64 /* XXX orig. yp_prot.h defines 256 */ -#define YPMAXMAP 64 -#define YPMAXPEER 64 /* XXX orig. yp_prot.h defines 256 */ - -/* byte size of a large NIS packet */ -#define YPMSGSZ 1600 - -typedef struct { - u_int keydat_len; - char *keydat_val; -} keydat_t; - -typedef struct { - u_int valdat_len; - char *valdat_val; -} valdat_t; - -struct ypmap_parms { - char *domain; /* Null string means not available */ - char *map; /* Null string means not available */ - unsigned int ordernum; /* 0 means not available */ - char *owner; /* Null string means not available */ -}; - -/* - * Request parameter structures - */ - -struct ypreq_key { - const char *domain; - const char *map; - keydat_t keydat; -}; - -struct ypreq_nokey { - char *domain; - char *map; -}; - -struct ypreq_xfr { - struct ypmap_parms map_parms; - u_int transid; - u_int proto; - u_int port; -}; - -#define ypxfr_domain map_parms.domain -#define ypxfr_map map_parms.map -#define ypxfr_ordernum map_parms.ordernum -#define ypxfr_owner map_parms.owner - -/* Return status values */ - -enum ypstat { - YP_TRUE = 1, /* General purpose success code */ -#define YP_TRUE YP_TRUE - YP_NOMORE = 2, /* No more entries in map */ -#define YP_NOMORE YP_NOMORE - YP_FALSE = 0, /* General purpose failure code */ -#define YP_FALSE YP_FALSE - YP_NOMAP = -1, /* No such map in domain */ -#define YP_NOMAP YP_NOMAP - YP_NODOM = -2, /* Domain not supported */ -#define YP_NODOM YP_NODOM - YP_NOKEY = -3, /* No such key in map */ -#define YP_NOKEY YP_NOKEY - YP_BADOP = -4, /* Invalid operation */ -#define YP_BADOP YP_BADOP - YP_BADDB = -5, /* Server data base is bad */ -#define YP_BADDB YP_BADDB - YP_YPERR = -6, /* NIS server error */ -#define YP_YPERR YP_YPERR - YP_BADARGS = -7, /* Request arguments bad */ -#define YP_BADARGS YP_BADARGS - YP_VERS = -8, /* NIS server version mismatch - server can't supply - requested service. */ -#define YP_VERS YP_VERS -}; - -/* - * Response parameter structures - */ - -typedef enum ypstat ypstat; - -struct ypresp_val { - ypstat status; - valdat_t valdat; -}; - -struct ypresp_key_val { - ypstat status; -#ifdef STUPID_SUN_BUG - /* This is the form as distributed by Sun. But even the Sun NIS - servers expect the values in the other order. So their - implementation somehow must change the order internally. We - don't want to follow this bad example since the user should be - able to use rpcgen on this file. */ - keydat_t keydat; - valdat_t valdat; -#else - valdat_t valdat; - keydat_t keydat; -#endif -}; - -struct ypresp_master { - ypstat status; - char *master; -}; - -struct ypresp_order { - ypstat status; - u_int ordernum; -}; - -struct ypmaplist { - char *map; -#define ypml_name map - struct ypmaplist *next; -#define ypml_next next -}; - -struct ypresp_maplist { - ypstat status; - struct ypmaplist *list; -}; - -/* - * Procedure symbols. YPPROC_NULL, YPPROC_DOMAIN, and YPPROC_DOMAIN_NONACK - * must keep the same values (0, 1, and 2) that they had in the first version - * of the protocol. - */ - -#define YPPROC_NULL 0 -#define YPPROC_DOMAIN 1 -#define YPPROC_DOMAIN_NONACK 2 -#define YPPROC_MATCH 3 -#define YPPROC_FIRST 4 -#define YPPROC_NEXT 5 -#define YPPROC_XFR 6 -#define YPPROC_CLEAR 7 -#define YPPROC_ALL 8 -#define YPPROC_MASTER 9 -#define YPPROC_ORDER 10 -#define YPPROC_MAPLIST 11 -#define YPPROC_NEWXFR 12 - -/* - * Protocol between clients and NIS binder servers - */ - -/* - * The following procedures are supported by the protocol: - * - * YPBINDPROC_NULL() returns () - * takes nothing, returns nothing - * - * YPBINDPROC_DOMAIN takes (char *) returns (struct ypbind_resp) - * - * YPBINDPROC_SETDOM takes (struct ypbind_setdom) returns nothing - */ - -/* Program and version symbols, magic numbers */ - -#define YPBINDPROG 100007 -#define YPBINDVERS 2 -#define YPBINDVERS_ORIG 1 - -/* Procedure symbols */ - -#define YPBINDPROC_NULL 0 -#define YPBINDPROC_DOMAIN 1 -#define YPBINDPROC_SETDOM 2 -/* - * Response structure and overall result status codes. Success and failure - * represent two separate response message types. - */ - -enum ypbind_resptype {YPBIND_SUCC_VAL = 1, YPBIND_FAIL_VAL = 2}; - -struct ypbind_binding { - struct in_addr ypbind_binding_addr; /* In network order */ - unsigned short int ypbind_binding_port; /* In network order */ -}; - -struct ypbind_resp { - enum ypbind_resptype ypbind_status; - union { - u_int ypbind_error; - struct ypbind_binding ypbind_bindinfo; - } ypbind_respbody; -}; - - -/* Detailed failure reason codes for response field ypbind_error*/ - -#define YPBIND_ERR_ERR 1 /* Internal error */ -#define YPBIND_ERR_NOSERV 2 /* No bound server for passed domain */ -#define YPBIND_ERR_RESC 3 /* System resource allocation failure */ - -/* - * Request data structure for ypbind "Set domain" procedure. - */ -struct ypbind_setdom { - char *ypsetdom_domain; - struct ypbind_binding ypsetdom_binding; - u_int ypsetdom_vers; -}; -#define ypsetdom_addr ypsetdom_binding.ypbind_binding_addr -#define ypsetdom_port ypsetdom_binding.ypbind_binding_port - -/* - * Protocol between clients (ypxfr, only) and yppush - * yppush speaks a protocol in the transient range, which - * is supplied to ypxfr as a command-line parameter when it - * is activated by ypserv. - */ -#define YPPUSHVERS 1 -#define YPPUSHVERS_ORIG 1 - -/* Procedure symbols */ - -#define YPPUSHPROC_NULL 0 -#define YPPUSHPROC_XFRRESP 1 - -/* Status values for yppushresp_xfr.status */ - -enum yppush_status { - YPPUSH_SUCC = 1, /* Success */ -#define YPPUSH_SUCC YPPUSH_SUCC - YPPUSH_AGE = 2, /* Master's version not newer */ -#define YPPUSH_AGE YPPUSH_AGE - YPPUSH_NOMAP = -1, /* Can't find server for map */ -#define YPPUSH_NOMAP YPPUSH_NOMAP - YPPUSH_NODOM = -2, /* Domain not supported */ -#define YPPUSH_NODOM YPPUSH_NODOM - YPPUSH_RSRC = -3, /* Local resouce alloc failure */ -#define YPPUSH_RSRC YPPUSH_RSRC - YPPUSH_RPC = -4, /* RPC failure talking to server */ -#define YPPUSH_RPC YPPUSH_RPC - YPPUSH_MADDR = -5, /* Can't get master address */ -#define YPPUSH_MADDR YPPUSH_MADDR - YPPUSH_YPERR = -6, /* NIS server/map db error */ -#define YPPUSH_YPERR YPPUSH_YPERR - YPPUSH_BADARGS = -7, /* Request arguments bad */ -#define YPPUSH_BADARGS YPPUSH_BADARGS - YPPUSH_DBM = -8, /* Local dbm operation failed */ -#define YPPUSH_DBM YPPUSH_DBM - YPPUSH_FILE = -9, /* Local file I/O operation failed */ -#define YPPUSH_FILE YPPUSH_FILE - YPPUSH_SKEW = -10, /* Map version skew during transfer */ -#define YPPUSH_SKEW YPPUSH_SKEW - YPPUSH_CLEAR = -11, /* Can't send "Clear" req to local ypserv */ -#define YPPUSH_CLEAR YPPUSH_CLEAR - YPPUSH_FORCE = -12, /* No local order number in map - use -f flag*/ -#define YPPUSH_FORCE YPPUSH_FORCE - YPPUSH_XFRERR = -13, /* ypxfr error */ -#define YPPUSH_XFRERR YPPUSH_XFRERR - YPPUSH_REFUSED = -14, /* Transfer request refused by ypserv */ -#define YPPUSH_REFUSED YPPUSH_REFUSED - YPPUSH_NOALIAS = -15 /* Alias not found for map or domain */ -#define YPPUSH_NOALIAS YPPUSH_NOALIAS -}; -typedef enum yppush_status yppush_status; - -struct yppushresp_xfr { - u_int transid; - yppush_status status; -}; - -struct ypresp_all { - bool_t more; - union { - struct ypresp_key_val val; - } ypresp_all_u; -}; - -extern bool_t xdr_ypreq_key (XDR *__xdrs, struct ypreq_key * __objp); -extern bool_t xdr_ypreq_nokey (XDR *__xdrs, struct ypreq_nokey * __objp); -extern bool_t xdr_ypreq_xfr (XDR *__xdrs, struct ypreq_xfr * __objp); -extern bool_t xdr_ypresp_val (XDR *__xdrs, struct ypresp_val * __objp); -extern bool_t xdr_ypresp_key_val (XDR *__xdrs, struct ypresp_key_val * __objp); -extern bool_t xdr_ypbind_resp (XDR *__xdrs, struct ypbind_resp * __objp); -extern bool_t xdr_ypbind_setdom (XDR *__xdrs, struct ypbind_setdom * __objp); -extern bool_t xdr_ypmap_parms (XDR *__xdrs, struct ypmap_parms * __objp); -extern bool_t xdr_yppushresp_xfr (XDR *__xdrs, struct yppushresp_xfr * __objp); -extern bool_t xdr_ypresp_order (XDR *__xdrs, struct ypresp_order * __objp); -extern bool_t xdr_ypresp_master (XDR *__xdrs, struct ypresp_master * __objp); -extern bool_t xdr_ypall (XDR *__xdrs, struct ypall_callback * __objp); -extern bool_t xdr_ypresp_maplist (XDR *__xdrs, struct ypresp_maplist * __objp); -extern bool_t xdr_ypbind_binding (XDR *__xdrs, struct ypbind_binding * __objp); -extern bool_t xdr_ypbind_resptype (XDR *__xdrs, enum ypbind_resptype * __objp); -extern bool_t xdr_ypstat (XDR *__xdrs, enum ypbind_resptype * __objp); -extern bool_t xdr_ypresp_all (XDR *__xdrs, struct ypresp_all * __objp); -extern bool_t xdr_domainname (XDR *__xdrs, char ** __objp); - -__END_DECLS - -#endif /* _RPCSVC_YP_PROT_H */ |