1958e765fSjtc /* 2958e765fSjtc * Sun RPC is a product of Sun Microsystems, Inc. and is provided for 3958e765fSjtc * unrestricted use provided that this legend is included on all tape 4958e765fSjtc * media and as a part of the software program in whole or part. Users 5958e765fSjtc * may copy or modify Sun RPC without charge, but are not authorized 6958e765fSjtc * to license or distribute it to anyone else except as part of a product or 7958e765fSjtc * program developed by the user. 8958e765fSjtc * 9958e765fSjtc * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE 10958e765fSjtc * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR 11958e765fSjtc * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. 12958e765fSjtc * 13958e765fSjtc * Sun RPC is provided with no support and without any obligation on the 14958e765fSjtc * part of Sun Microsystems, Inc. to assist in its use, correction, 15958e765fSjtc * modification or enhancement. 16958e765fSjtc * 17958e765fSjtc * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE 18958e765fSjtc * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC 19958e765fSjtc * OR ANY PART THEREOF. 20958e765fSjtc * 21958e765fSjtc * In no event will Sun Microsystems, Inc. be liable for any lost revenue 22958e765fSjtc * or profits or other special, indirect and consequential damages, even if 23958e765fSjtc * Sun has been advised of the possibility of such damages. 24958e765fSjtc * 25958e765fSjtc * Sun Microsystems, Inc. 26958e765fSjtc * 2550 Garcia Avenue 27958e765fSjtc * Mountain View, California 94043 28958e765fSjtc */ 29958e765fSjtc 30958e765fSjtc /* 31c594b298Swiz * RPC for bootparams service. 32958e765fSjtc * There are two procedures: 33958e765fSjtc * WHOAMI takes a net address and returns a client name and also a 34958e765fSjtc * likely net address for routing 35958e765fSjtc * GETFILE takes a client name and file identifier and returns the 36958e765fSjtc * server name, server net address and pathname for the file. 37958e765fSjtc * file identifiers typically include root, swap, pub and dump 38958e765fSjtc */ 39958e765fSjtc 40958e765fSjtc #ifdef RPC_HDR 41958e765fSjtc %#include <sys/param.h> 42958e765fSjtc %#include <rpc/types.h> 43958e765fSjtc %#include <sys/time.h> 44958e765fSjtc %#include <sys/errno.h> 45958e765fSjtc %#include <sys/ucred.h> 46958e765fSjtc #else 476112a51eSlukem %#include <sys/cdefs.h> 48*d93fc4c1Skleink %#ifndef __lint__ 49958e765fSjtc %/*static char sccsid[] = "from: @(#)bootparam_prot.x 1.2 87/06/24 Copyr 1987 Sun Micro";*/ 50958e765fSjtc %/*static char sccsid[] = "from: @(#)bootparam_prot.x 2.1 88/08/01 4.0 RPCSRC";*/ 51*d93fc4c1Skleink %__RCSID("$NetBSD: bootparam_prot.x,v 1.7 2004/07/01 22:52:34 kleink Exp $"); 52*d93fc4c1Skleink %#endif /* not __lint__ */ 53958e765fSjtc #endif 54958e765fSjtc 55958e765fSjtc const MAX_MACHINE_NAME = 255; 56958e765fSjtc const MAX_PATH_LEN = 1024; 57958e765fSjtc const MAX_FILEID = 32; 58958e765fSjtc const IP_ADDR_TYPE = 1; 59958e765fSjtc 60958e765fSjtc typedef string bp_machine_name_t<MAX_MACHINE_NAME>; 61958e765fSjtc typedef string bp_path_t<MAX_PATH_LEN>; 62958e765fSjtc typedef string bp_fileid_t<MAX_FILEID>; 63958e765fSjtc 64958e765fSjtc struct ip_addr_t { 65958e765fSjtc char net; 66958e765fSjtc char host; 67958e765fSjtc char lh; 68958e765fSjtc char impno; 69958e765fSjtc }; 70958e765fSjtc 71958e765fSjtc union bp_address switch (int address_type) { 72958e765fSjtc case IP_ADDR_TYPE: 73958e765fSjtc ip_addr_t ip_addr; 74958e765fSjtc }; 75958e765fSjtc 76958e765fSjtc struct bp_whoami_arg { 77958e765fSjtc bp_address client_address; 78958e765fSjtc }; 79958e765fSjtc 80958e765fSjtc struct bp_whoami_res { 81958e765fSjtc bp_machine_name_t client_name; 82958e765fSjtc bp_machine_name_t domain_name; 83958e765fSjtc bp_address router_address; 84958e765fSjtc }; 85958e765fSjtc 86958e765fSjtc struct bp_getfile_arg { 87958e765fSjtc bp_machine_name_t client_name; 88958e765fSjtc bp_fileid_t file_id; 89958e765fSjtc }; 90958e765fSjtc 91958e765fSjtc struct bp_getfile_res { 92958e765fSjtc bp_machine_name_t server_name; 93958e765fSjtc bp_address server_address; 94958e765fSjtc bp_path_t server_path; 95958e765fSjtc }; 96958e765fSjtc 97958e765fSjtc program BOOTPARAMPROG { 98958e765fSjtc version BOOTPARAMVERS { 99958e765fSjtc bp_whoami_res BOOTPARAMPROC_WHOAMI(bp_whoami_arg) = 1; 100958e765fSjtc bp_getfile_res BOOTPARAMPROC_GETFILE(bp_getfile_arg) = 2; 101958e765fSjtc } = 1; 102958e765fSjtc } = 100026; 103