bootparam_prot.x revision 6747
11832Swollman/*
21832Swollman * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
31832Swollman * unrestricted use provided that this legend is included on all tape
41832Swollman * media and as a part of the software program in whole or part.  Users
51832Swollman * may copy or modify Sun RPC without charge, but are not authorized
61832Swollman * to license or distribute it to anyone else except as part of a product or
71832Swollman * program developed by the user.
81832Swollman *
91832Swollman * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
101832Swollman * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
111832Swollman * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
121832Swollman *
131832Swollman * Sun RPC is provided with no support and without any obligation on the
141832Swollman * part of Sun Microsystems, Inc. to assist in its use, correction,
151832Swollman * modification or enhancement.
161832Swollman *
171832Swollman * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
181832Swollman * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
191832Swollman * OR ANY PART THEREOF.
201832Swollman *
211832Swollman * In no event will Sun Microsystems, Inc. be liable for any lost revenue
221832Swollman * or profits or other special, indirect and consequential damages, even if
231832Swollman * Sun has been advised of the possibility of such damages.
241832Swollman *
251832Swollman * Sun Microsystems, Inc.
261832Swollman * 2550 Garcia Avenue
271832Swollman * Mountain View, California  94043
281832Swollman */
291832Swollman
301832Swollman/*
311832Swollman * RPC for bootparms service.
321832Swollman * There are two procedures:
331832Swollman *   WHOAMI takes a net address and returns a client name and also a
341832Swollman *	likely net address for routing
351832Swollman *   GETFILE takes a client name and file identifier and returns the
361832Swollman *	server name, server net address and pathname for the file.
371832Swollman *   file identifiers typically include root, swap, pub and dump
381832Swollman */
391832Swollman
401832Swollman#ifdef RPC_HDR
411832Swollman%#include <rpc/types.h>
421832Swollman%#include <sys/time.h>
431832Swollman%#include <sys/errno.h>
446747Swpaul%#include <sys/param.h>
456747Swpaul%#include <sys/syslimits.h>
466747Swpaul%#include <sys/ucred.h>
476747Swpaul%#include <nfs/nfsv2.h>
481832Swollman%#include <nfs/nfs.h>
491832Swollman#else
501832Swollman%#ifndef lint
511832Swollman%/*static char sccsid[] = "from: @(#)bootparam_prot.x 1.2 87/06/24 Copyr 1987 Sun Micro";*/
521832Swollman%/*static char sccsid[] = "from: @(#)bootparam_prot.x	2.1 88/08/01 4.0 RPCSRC";*/
536747Swpaul%static char rcsid[] = "bootparam_prot.x,v 1.1 1994/08/04 19:01:44 wollman Exp";
541832Swollman%#endif /* not lint */
551832Swollman#endif
561832Swollman
571832Swollmanconst MAX_MACHINE_NAME  = 255;
581832Swollmanconst MAX_PATH_LEN	= 1024;
591832Swollmanconst MAX_FILEID	= 32;
601832Swollmanconst IP_ADDR_TYPE	= 1;
611832Swollman
621832Swollmantypedef	string	bp_machine_name_t<MAX_MACHINE_NAME>;
631832Swollmantypedef	string	bp_path_t<MAX_PATH_LEN>;
641832Swollmantypedef	string	bp_fileid_t<MAX_FILEID>;
651832Swollman
661832Swollmanstruct	ip_addr_t {
671832Swollman	char	net;
681832Swollman	char	host;
691832Swollman	char	lh;
701832Swollman	char	impno;
711832Swollman};
721832Swollman
731832Swollmanunion bp_address switch (int address_type) {
741832Swollman	case IP_ADDR_TYPE:
751832Swollman		ip_addr_t	ip_addr;
761832Swollman};
771832Swollman
781832Swollmanstruct bp_whoami_arg {
791832Swollman	bp_address		client_address;
801832Swollman};
811832Swollman
821832Swollmanstruct bp_whoami_res {
831832Swollman	bp_machine_name_t	client_name;
841832Swollman	bp_machine_name_t	domain_name;
851832Swollman	bp_address		router_address;
861832Swollman};
871832Swollman
881832Swollmanstruct bp_getfile_arg {
891832Swollman	bp_machine_name_t	client_name;
901832Swollman	bp_fileid_t		file_id;
911832Swollman};
921832Swollman
931832Swollmanstruct bp_getfile_res {
941832Swollman	bp_machine_name_t	server_name;
951832Swollman	bp_address		server_address;
961832Swollman	bp_path_t		server_path;
971832Swollman};
981832Swollman
991832Swollmanprogram BOOTPARAMPROG {
1001832Swollman	version BOOTPARAMVERS {
1011832Swollman		bp_whoami_res	BOOTPARAMPROC_WHOAMI(bp_whoami_arg) = 1;
1021832Swollman		bp_getfile_res	BOOTPARAMPROC_GETFILE(bp_getfile_arg) = 2;
1031832Swollman	} = 1;
1041832Swollman} = 100026;
105