xref: /illumos-gate/usr/src/head/rpcsvc/bootparam_prot.x (revision a89c0811c892ec231725fe10817ef95dda813c06)
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 /*
30  * RPC for bootparms service.
31  * There are two procedures:
32  *   WHOAMI takes a net address and returns a client name and also a
33  *	likely net address for routing
34  *   GETFILE takes a client name and file identifier and returns the
35  *	server name, server net address and pathname for the file.
36  *   file identifiers typically include root, swap, pub and dump
37  */
38 const MAX_MACHINE_NAME  = 255;
39 const MAX_PATH_LEN	= 1024;
40 const MAX_FILEID	= 32;
41 const IP_ADDR_TYPE	= 1;
42 
43 typedef	string	bp_machine_name_t<MAX_MACHINE_NAME>;
44 typedef	string	bp_path_t<MAX_PATH_LEN>;
45 typedef	string	bp_fileid_t<MAX_FILEID>;
46 
47 struct	ip_addr_t {
48 	char	net;
49 	char	host;
50 	char	lh;
51 	char	impno;
52 };
53 
54 union bp_address switch (int address_type) {
55 	case IP_ADDR_TYPE:
56 		ip_addr_t	ip_addr;
57 };
58 
59 struct bp_whoami_arg {
60 	bp_address		client_address;
61 };
62 
63 struct bp_whoami_res {
64 	bp_machine_name_t	client_name;
65 	bp_machine_name_t	domain_name;
66 	bp_address		router_address;
67 };
68 
69 struct bp_getfile_arg {
70 	bp_machine_name_t	client_name;
71 	bp_fileid_t		file_id;
72 };
73 
74 struct bp_getfile_res {
75 	bp_machine_name_t	server_name;
76 	bp_address		server_address;
77 	bp_path_t		server_path;
78 };
79 
80 program BOOTPARAMPROG {
81 	version BOOTPARAMVERS {
82 		bp_whoami_res	BOOTPARAMPROC_WHOAMI(bp_whoami_arg) = 1;
83 		bp_getfile_res	BOOTPARAMPROC_GETFILE(bp_getfile_arg) = 2;
84 	} = 1;
85 } = 100026;
86