xref: /titanic_50/usr/src/head/rpcsvc/bootparam_prot.x (revision b86efd96f8acd85ddaa930a2f0c1d664237e4aaf)
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 2004 Sun Microsystems, Inc.  All rights reserved.
24 % * Use is subject to license terms.
25 % */
26 
27 %/* from bootparam_prot.x */
28 
29 #ifdef RPC_HDR
30 %
31 %#pragma ident	"%Z%%M%	%I%	%E% SMI"
32 %
33 #endif
34 
35 /*
36  * RPC for bootparms service.
37  * There are two procedures:
38  *   WHOAMI takes a net address and returns a client name and also a
39  *	likely net address for routing
40  *   GETFILE takes a client name and file identifier and returns the
41  *	server name, server net address and pathname for the file.
42  *   file identifiers typically include root, swap, pub and dump
43  */
44 const MAX_MACHINE_NAME  = 255;
45 const MAX_PATH_LEN	= 1024;
46 const MAX_FILEID	= 32;
47 const IP_ADDR_TYPE	= 1;
48 
49 typedef	string	bp_machine_name_t<MAX_MACHINE_NAME>;
50 typedef	string	bp_path_t<MAX_PATH_LEN>;
51 typedef	string	bp_fileid_t<MAX_FILEID>;
52 
53 struct	ip_addr_t {
54 	char	net;
55 	char	host;
56 	char	lh;
57 	char	impno;
58 };
59 
60 union bp_address switch (int address_type) {
61 	case IP_ADDR_TYPE:
62 		ip_addr_t	ip_addr;
63 };
64 
65 struct bp_whoami_arg {
66 	bp_address		client_address;
67 };
68 
69 struct bp_whoami_res {
70 	bp_machine_name_t	client_name;
71 	bp_machine_name_t	domain_name;
72 	bp_address		router_address;
73 };
74 
75 struct bp_getfile_arg {
76 	bp_machine_name_t	client_name;
77 	bp_fileid_t		file_id;
78 };
79 
80 struct bp_getfile_res {
81 	bp_machine_name_t	server_name;
82 	bp_address		server_address;
83 	bp_path_t		server_path;
84 };
85 
86 program BOOTPARAMPROG {
87 	version BOOTPARAMVERS {
88 		bp_whoami_res	BOOTPARAMPROC_WHOAMI(bp_whoami_arg) = 1;
89 		bp_getfile_res	BOOTPARAMPROC_GETFILE(bp_getfile_arg) = 2;
90 	} = 1;
91 } = 100026;
92