xref: /illumos-gate/usr/src/uts/common/rpc/bootparam.h (revision e3ae4b35c024af1196582063ecee3ab79367227d)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright (C) 1984, Sun Microsystems, Inc.
24  */
25 
26 #ifndef	_RPC_BOOTPARAM_H
27 #define	_RPC_BOOTPARAM_H
28 
29 #ifndef _KERNEL
30 #include <rpc/types.h>
31 #include <sys/time.h>
32 #include <sys/errno.h>
33 #include <nfs/nfs.h>
34 #endif
35 
36 #ifdef	__cplusplus
37 extern "C" {
38 #endif
39 
40 #define	MAX_MACHINE_NAME 255
41 #define	MAX_PATH_LEN	1024
42 #define	MAX_FILEID	32
43 #define	IP_ADDR_TYPE	1
44 
45 typedef char *bp_machine_name_t;
46 typedef char *bp_path_t;
47 typedef char *bp_fileid_t;
48 
49 struct ip_addr_t {
50 	char net;
51 	char host;
52 	char lh;
53 	char impno;
54 };
55 typedef struct ip_addr_t ip_addr_t;
56 
57 struct bp_address {
58 	int address_type;
59 	union {
60 		ip_addr_t ip_addr;
61 	} bp_address;
62 };
63 typedef struct bp_address bp_address;
64 
65 
66 struct bp_whoami_arg {
67 	bp_address client_address;
68 };
69 typedef struct bp_whoami_arg bp_whoami_arg;
70 
71 
72 struct bp_whoami_res {
73 	bp_machine_name_t client_name;
74 	bp_machine_name_t domain_name;
75 	bp_address router_address;
76 };
77 typedef struct bp_whoami_res bp_whoami_res;
78 
79 
80 struct bp_getfile_arg {
81 	bp_machine_name_t client_name;
82 	bp_fileid_t file_id;
83 };
84 typedef struct bp_getfile_arg bp_getfile_arg;
85 
86 
87 struct bp_getfile_res {
88 	bp_machine_name_t server_name;
89 	bp_address server_address;
90 	bp_path_t server_path;
91 };
92 typedef struct bp_getfile_res bp_getfile_res;
93 
94 
95 #define	BOOTPARAMPROG 100026
96 #define	BOOTPARAMVERS 1
97 #define	BOOTPARAMPROC_WHOAMI 1
98 #define	BOOTPARAMPROC_GETFILE 2
99 
100 bool_t xdr_bp_machine_name_t();
101 bool_t xdr_bp_path_t();
102 bool_t xdr_bp_fileid_t();
103 bool_t xdr_ip_addr_t();
104 bool_t xdr_bp_address();
105 bool_t xdr_bp_whoami_arg();
106 bool_t xdr_bp_whoami_res();
107 bool_t xdr_bp_getfile_arg();
108 bool_t xdr_bp_getfile_res();
109 
110 #ifdef	__cplusplus
111 }
112 #endif
113 
114 #endif	/* !_RPC_BOOTPARAM_H */
115