/*
* 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 2014 Garrett D'Amore <garrett@damore.org>
*
* Copyright 2004 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/* Copyright (c) 1983, 1984, 1985, 1986, 1987, 1988, 1989 AT&T */
/* All Rights Reserved */
/*
* Portions of this source code were derived from Berkeley 4.3 BSD
* under license from the Regents of the University of California.
*/
#ifndef _RPCSVC_YP_PROT_H
#define _RPCSVC_YP_PROT_H
#include <ndbm.h>
#ifdef __cplusplus
extern "C" {
#endif
/*
* This file contains symbols and structures defining the rpc protocol
* between the YP clients and the YP servers. The servers are the YP
* database servers, and the YP.
*/
/*
* The following procedures are supported by the protocol:
*
* YPPROC_NULL() returns () takes nothing, returns nothing. This indicates
* that the yp server is alive.
*
* YPPROC_DOMAIN (char *) returns (bool_t) TRUE. Indicates that the
* responding yp server does serve the named domain; FALSE indicates no
* support.
*
* YPPROC_DOMAIN_NONACK (char *) returns (TRUE) if the yp 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_NEWXFR (struct ypreq_newxfr) returns nothing. Indicates to a server
* that a map should be updated. Uses protocol independent request struct.
*
* YPPROC_CLEAR takes nothing, returns nothing. Instructs a yp 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 *)
*/
/* 'bool' is a built-in type for g++ */
#ifndef BOOL_DEFINED
typedef unsigned int bool;
#define BOOL_DEFINED
#endif
#endif
/* Program and version symbols, magic numbers */
/* byte size of a large yp packet */
struct ypmap_parms {
};
/*
* Request parameter structures
*/
struct ypreq_key {
char *domain;
char *map;
};
struct ypreq_nokey {
char *domain;
char *map;
};
struct ypreq_xfr {
unsigned int transid;
unsigned int proto;
unsigned short port;
};
struct ypreq_newxfr {
unsigned int transid;
unsigned int proto;
char *name;
};
/*
* Response parameter structures
*/
struct ypresp_val {
unsigned int status;
};
struct ypresp_key_val {
unsigned int status;
};
struct ypresp_master {
unsigned int status;
char *master;
};
struct ypresp_order {
unsigned int status;
unsigned int ordernum;
};
struct ypmaplist {
};
struct ypresp_maplist {
unsigned int 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.
*/
/* Return status values */
/* can't supply requested service. */
struct yprequest {
union {
};
struct ypresponse {
union {
} yp_respbody;
};
extern bool _xdr_yprequest();
extern bool _xdr_ypresponse();
/*
* 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 */
struct yppushresp_xfr {
unsigned int transid;
unsigned int status;
};
/* Status values for yppushresp_xfr.status */
/* ypserv */
/* use -f flag. */
extern bool xdr_ypdomain_wrap_string(XDR *, char **);
extern bool xdr_ypmap_wrap_string(XDR *, char **);
extern bool xdr_ypowner_wrap_string(XDR *, char **);
#ifdef __cplusplus
}
#endif
#endif /* _RPCSVC_YP_PROT_H */