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