1 1.1 jtc /* 2 1.1 jtc * Sun RPC is a product of Sun Microsystems, Inc. and is provided for 3 1.1 jtc * unrestricted use provided that this legend is included on all tape 4 1.1 jtc * media and as a part of the software program in whole or part. Users 5 1.1 jtc * may copy or modify Sun RPC without charge, but are not authorized 6 1.1 jtc * to license or distribute it to anyone else except as part of a product or 7 1.1 jtc * program developed by the user. 8 1.5 simonb * 9 1.1 jtc * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE 10 1.1 jtc * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR 11 1.1 jtc * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE. 12 1.5 simonb * 13 1.1 jtc * Sun RPC is provided with no support and without any obligation on the 14 1.1 jtc * part of Sun Microsystems, Inc. to assist in its use, correction, 15 1.1 jtc * modification or enhancement. 16 1.5 simonb * 17 1.1 jtc * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE 18 1.1 jtc * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC 19 1.1 jtc * OR ANY PART THEREOF. 20 1.5 simonb * 21 1.1 jtc * In no event will Sun Microsystems, Inc. be liable for any lost revenue 22 1.1 jtc * or profits or other special, indirect and consequential damages, even if 23 1.1 jtc * Sun has been advised of the possibility of such damages. 24 1.5 simonb * 25 1.1 jtc * Sun Microsystems, Inc. 26 1.1 jtc * 2550 Garcia Avenue 27 1.1 jtc * Mountain View, California 94043 28 1.1 jtc */ 29 1.1 jtc 30 1.1 jtc /* 31 1.6 wiz * RPC for bootparams service. 32 1.1 jtc * There are two procedures: 33 1.1 jtc * WHOAMI takes a net address and returns a client name and also a 34 1.1 jtc * likely net address for routing 35 1.1 jtc * GETFILE takes a client name and file identifier and returns the 36 1.1 jtc * server name, server net address and pathname for the file. 37 1.1 jtc * file identifiers typically include root, swap, pub and dump 38 1.1 jtc */ 39 1.1 jtc 40 1.1 jtc #ifdef RPC_HDR 41 1.1 jtc %#include <sys/param.h> 42 1.1 jtc %#include <rpc/types.h> 43 1.1 jtc %#include <sys/time.h> 44 1.1 jtc %#include <sys/errno.h> 45 1.1 jtc %#include <sys/ucred.h> 46 1.1 jtc #else 47 1.4 lukem %#include <sys/cdefs.h> 48 1.7 kleink %#ifndef __lint__ 49 1.1 jtc %/*static char sccsid[] = "from: @(#)bootparam_prot.x 1.2 87/06/24 Copyr 1987 Sun Micro";*/ 50 1.1 jtc %/*static char sccsid[] = "from: @(#)bootparam_prot.x 2.1 88/08/01 4.0 RPCSRC";*/ 51 1.7 kleink %__RCSID("$NetBSD: bootparam_prot.x,v 1.7 2004/07/01 22:52:34 kleink Exp $"); 52 1.7 kleink %#endif /* not __lint__ */ 53 1.1 jtc #endif 54 1.1 jtc 55 1.1 jtc const MAX_MACHINE_NAME = 255; 56 1.1 jtc const MAX_PATH_LEN = 1024; 57 1.1 jtc const MAX_FILEID = 32; 58 1.1 jtc const IP_ADDR_TYPE = 1; 59 1.1 jtc 60 1.1 jtc typedef string bp_machine_name_t<MAX_MACHINE_NAME>; 61 1.1 jtc typedef string bp_path_t<MAX_PATH_LEN>; 62 1.1 jtc typedef string bp_fileid_t<MAX_FILEID>; 63 1.1 jtc 64 1.1 jtc struct ip_addr_t { 65 1.1 jtc char net; 66 1.1 jtc char host; 67 1.1 jtc char lh; 68 1.1 jtc char impno; 69 1.1 jtc }; 70 1.1 jtc 71 1.1 jtc union bp_address switch (int address_type) { 72 1.1 jtc case IP_ADDR_TYPE: 73 1.1 jtc ip_addr_t ip_addr; 74 1.1 jtc }; 75 1.1 jtc 76 1.1 jtc struct bp_whoami_arg { 77 1.1 jtc bp_address client_address; 78 1.1 jtc }; 79 1.1 jtc 80 1.1 jtc struct bp_whoami_res { 81 1.1 jtc bp_machine_name_t client_name; 82 1.1 jtc bp_machine_name_t domain_name; 83 1.1 jtc bp_address router_address; 84 1.1 jtc }; 85 1.1 jtc 86 1.1 jtc struct bp_getfile_arg { 87 1.1 jtc bp_machine_name_t client_name; 88 1.1 jtc bp_fileid_t file_id; 89 1.1 jtc }; 90 1.5 simonb 91 1.1 jtc struct bp_getfile_res { 92 1.1 jtc bp_machine_name_t server_name; 93 1.1 jtc bp_address server_address; 94 1.1 jtc bp_path_t server_path; 95 1.1 jtc }; 96 1.1 jtc 97 1.1 jtc program BOOTPARAMPROG { 98 1.1 jtc version BOOTPARAMVERS { 99 1.1 jtc bp_whoami_res BOOTPARAMPROC_WHOAMI(bp_whoami_arg) = 1; 100 1.1 jtc bp_getfile_res BOOTPARAMPROC_GETFILE(bp_getfile_arg) = 2; 101 1.1 jtc } = 1; 102 1.1 jtc } = 100026; 103