yp_prot.h revision 7c478bd95313f5f23a4c958a745db2134aa03244
/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License, Version 1.0 only
* (the "License"). You may not use this file except in compliance
* with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 1997 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* 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.
*/
/*
* 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 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 *)
*/
#ifndef BOOL_DEFINED
typedef unsigned int bool;
#define BOOL_DEFINED
#endif
extern bool xdr_datum();
extern bool xdr_ypdomain_wrap_string();
extern bool xdr_ypmap_wrap_string();
extern bool xdr_ypreq_key();
extern bool xdr_ypreq_nokey();
extern bool xdr_ypreq_xfr();
extern bool xdr_ypresp_val();
extern bool xdr_ypresp_key_val();
extern bool xdr_ypbind_resp();
extern bool xdr_ypbind_setdom();
extern bool xdr_yp_inaddr();
extern bool xdr_ypmap_parms();
extern bool xdr_ypowner_wrap_string();
extern bool xdr_yppushresp_xfr();
extern bool xdr_ypresp_order();
extern bool xdr_ypresp_master();
extern bool xdr_ypall();
extern bool xdr_ypresp_maplist();
/* Program and version symbols, magic numbers */
/* byte size of a large NIS packet */
#define YPMSGSZ 1600
#ifndef DATUM
typedef struct {
char *dptr;
int dsize;
} datum;
#define DATUM
#endif
struct ypmap_parms {
char *domain; /* Null string means not available */
char *map; /* Null string means not available */
unsigned long int ordernum; /* 0 means not available */
char *owner; /* Null string means not available */
};
/*
* Request parameter structures
*/
struct ypreq_key {
char *domain;
char *map;
};
struct ypreq_nokey {
char *domain;
char *map;
};
struct ypreq_xfr {
struct ypmap_parms map_parms;
unsigned long transid;
unsigned long proto;
unsigned short port;
};
/*
* Response parameter structures
*/
struct ypresp_val {
long unsigned status;
};
struct ypresp_key_val {
long unsigned status;
};
struct ypresp_master {
long unsigned status;
char *master;
};
struct ypresp_order {
long unsigned status;
unsigned long int ordernum;
};
struct ypmaplist {
};
struct ypresp_maplist {
long unsigned status;
};
/*
* 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 ((u_long)0)
/* Return status values */
#define YP_FALSE ((long)0) /* General purpose failure code */
* can't supply requested service. */
/*
* Domain binding data structure, used by ypclnt package and ypserv modules.
* Users of the ypclnt package (or of this protocol) don't HAVE to know about
* it, but it must be available to users because _yp_dobind is a public
* interface.
*/
struct dom_binding {
struct dom_binding *dom_pnext;
struct sockaddr_in dom_server_addr;
unsigned short int dom_server_port;
int dom_socket;
unsigned short int dom_local_port;
long int dom_vers;
};
/*
* 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 */
/* Procedure symbols */
#define YPBINDPROC_NULL ((u_long)0)
/*
* Response structure and overall result status codes. Success and failure
* represent two separate response message types.
*/
struct ypbind_binding {
unsigned short int ypbind_binding_port; /* In network order */
};
struct ypbind_resp {
enum ypbind_resptype ypbind_status;
union {
unsigned long ypbind_error;
struct ypbind_binding ypbind_bindinfo;
};
/* Detailed failure reason codes for response field ypbind_error*/
/*
* Request data structure for ypbind "Set domain" procedure.
*/
struct ypbind_setdom {
struct ypbind_binding ypsetdom_binding;
unsigned short ypsetdom_vers;
};
/*
* 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.
*/
/* Procedure symbols */
#define YPPUSHPROC_NULL ((u_long)0)
struct yppushresp_xfr {
unsigned long transid;
unsigned long status;
};
/* Status values for yppushresp_xfr.status */
* ypserv */
* use -f flag. */