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