]> git.saurik.com Git - apple/network_cmds.git/blob - bootparams/bootparams/bootparam_prot.x
30ec3c803ba8fd7f18c841eac4a7d9bc517cdb8c
[apple/network_cmds.git] / bootparams / bootparams / bootparam_prot.x
1 /*
2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * This file contains Original Code and/or Modifications of Original Code
7 * as defined in and that are subject to the Apple Public Source License
8 * Version 2.0 (the 'License'). You may not use this file except in
9 * compliance with the License. Please obtain a copy of the License at
10 * http://www.opensource.apple.com/apsl/ and read it before using this
11 * file.
12 *
13 * The Original Code and all software distributed under the License are
14 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
15 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
16 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
17 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
18 * Please see the License for the specific language governing rights and
19 * limitations under the License.
20 *
21 * @APPLE_LICENSE_HEADER_END@
22 */
23 /* @(#)bootparam_prot.x 2.1 88/08/01 4.0 RPCSRC */
24 /* @(#)bootparam_prot.x 1.2 87/06/24 Copyr 1987 Sun Micro */
25
26 /*
27 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
28 * unrestricted use provided that this legend is included on all tape
29 * media and as a part of the software program in whole or part. Users
30 * may copy or modify Sun RPC without charge, but are not authorized
31 * to license or distribute it to anyone else except as part of a product or
32 * program developed by the user.
33 *
34 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
35 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
36 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
37 *
38 * Sun RPC is provided with no support and without any obligation on the
39 * part of Sun Microsystems, Inc. to assist in its use, correction,
40 * modification or enhancement.
41 *
42 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
43 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
44 * OR ANY PART THEREOF.
45 *
46 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
47 * or profits or other special, indirect and consequential damages, even if
48 * Sun has been advised of the possibility of such damages.
49 *
50 * Sun Microsystems, Inc.
51 * 2550 Garcia Avenue
52 * Mountain View, California 94043
53 */
54
55 /*
56 * RPC for bootparms service.
57 * There are two procedures:
58 * WHOAMI takes a net address and returns a client name and also a
59 * likely net address for routing
60 * GETFILE takes a client name and file identifier and returns the
61 * server name, server net address and pathname for the file.
62 * file identifiers typically include root, swap, pub and dump
63 */
64
65 #ifdef RPC_HDR
66 %#include <rpc/types.h>
67 %#include <sys/time.h>
68 %#include <sys/errno.h>
69 #endif
70
71 const MAX_MACHINE_NAME = 255;
72 const MAX_PATH_LEN = 1024;
73 const MAX_FILEID = 32;
74 const IP_ADDR_TYPE = 1;
75
76 typedef string bp_machine_name_t<MAX_MACHINE_NAME>;
77 typedef string bp_path_t<MAX_PATH_LEN>;
78 typedef string bp_fileid_t<MAX_FILEID>;
79
80 struct ip_addr_t {
81 char net;
82 char host;
83 char lh;
84 char impno;
85 };
86
87 union bp_address switch (int address_type) {
88 case IP_ADDR_TYPE:
89 ip_addr_t ip_addr;
90 };
91
92 struct bp_whoami_arg {
93 bp_address client_address;
94 };
95
96 struct bp_whoami_res {
97 bp_machine_name_t client_name;
98 bp_machine_name_t domain_name;
99 bp_address router_address;
100 };
101
102 struct bp_getfile_arg {
103 bp_machine_name_t client_name;
104 bp_fileid_t file_id;
105 };
106
107 struct bp_getfile_res {
108 bp_machine_name_t server_name;
109 bp_address server_address;
110 bp_path_t server_path;
111 };
112
113 program BOOTPARAMPROG {
114 version BOOTPARAMVERS {
115 bp_whoami_res BOOTPARAMPROC_WHOAMI(bp_whoami_arg) = 1;
116 bp_getfile_res BOOTPARAMPROC_GETFILE(bp_getfile_arg) = 2;
117 } = 1;
118 } = 100026;