hjl / source-git / glibc

Forked from source-git/glibc 3 years ago
Clone

Blame sunrpc/rpcsvc/bootparam_prot.x

Packit 6c4009
/* @(#)bootparam_prot.x	2.1 88/08/01 4.0 RPCSRC */
Packit 6c4009
Packit 6c4009
/*
Packit 6c4009
 * Copyright (c) 2010, Oracle America, Inc.
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
/*
Packit 6c4009
 * RPC for bootparms service.
Packit 6c4009
 * There are two procedures:
Packit 6c4009
 *   WHOAMI takes a net address and returns a client name and also a
Packit 6c4009
 *	likely net address for routing
Packit 6c4009
 *   GETFILE takes a client name and file identifier and returns the
Packit 6c4009
 *	server name, server net address and pathname for the file.
Packit 6c4009
 *   file identifiers typically include root, swap, pub and dump
Packit 6c4009
 */
Packit 6c4009
Packit 6c4009
#ifdef RPC_HDR
Packit 6c4009
%#include <rpc/types.h>
Packit 6c4009
%#include <sys/time.h>
Packit 6c4009
%#include <sys/errno.h>
Packit 6c4009
%#include <nfs/nfs.h>
Packit 6c4009
#endif
Packit 6c4009
Packit 6c4009
const MAX_MACHINE_NAME  = 255;
Packit 6c4009
const MAX_PATH_LEN	= 1024;
Packit 6c4009
const MAX_FILEID	= 32;
Packit 6c4009
const IP_ADDR_TYPE	= 1;
Packit 6c4009
Packit 6c4009
typedef	string	bp_machine_name_t<MAX_MACHINE_NAME>;
Packit 6c4009
typedef	string	bp_path_t<MAX_PATH_LEN>;
Packit 6c4009
typedef	string	bp_fileid_t<MAX_FILEID>;
Packit 6c4009
Packit 6c4009
struct	ip_addr_t {
Packit 6c4009
	char	net;
Packit 6c4009
	char	host;
Packit 6c4009
	char	lh;
Packit 6c4009
	char	impno;
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
union bp_address switch (int address_type) {
Packit 6c4009
	case IP_ADDR_TYPE:
Packit 6c4009
		ip_addr_t	ip_addr;
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
struct bp_whoami_arg {
Packit 6c4009
	bp_address		client_address;
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
struct bp_whoami_res {
Packit 6c4009
	bp_machine_name_t	client_name;
Packit 6c4009
	bp_machine_name_t	domain_name;
Packit 6c4009
	bp_address		router_address;
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
struct bp_getfile_arg {
Packit 6c4009
	bp_machine_name_t	client_name;
Packit 6c4009
	bp_fileid_t		file_id;
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
struct bp_getfile_res {
Packit 6c4009
	bp_machine_name_t	server_name;
Packit 6c4009
	bp_address		server_address;
Packit 6c4009
	bp_path_t		server_path;
Packit 6c4009
};
Packit 6c4009
Packit 6c4009
program BOOTPARAMPROG {
Packit 6c4009
	version BOOTPARAMVERS {
Packit 6c4009
		bp_whoami_res	BOOTPARAMPROC_WHOAMI(bp_whoami_arg) = 1;
Packit 6c4009
		bp_getfile_res	BOOTPARAMPROC_GETFILE(bp_getfile_arg) = 2;
Packit 6c4009
	} = 1;
Packit 6c4009
} = 100026;