2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
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.1 (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
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
22 * @APPLE_LICENSE_HEADER_END@
25 * NetInfo protocol specification
26 * Copyright (C) 1989 by NeXT, Inc.
29 /* Preamble appearing on all generated output */
32 % * Output of the RPC protocol compiler: DO NOT EDIT
33 % * Copyright (C) 1989 by NeXT, Inc.
41 const NI_NAME_MAXLEN = 65535;
42 const NI_NAMELIST_MAXLEN = 65535;
43 const NI_PROPLIST_MAXLEN = 65535;
44 const NI_IDLIST_MAXLEN = 1048576;
47 * Every object has a unique ID. One part of the ID identifies the object
48 * itself. The other identifies the instance of the object. Every time
49 * an object is written or an object is destroyed and then reallocated,
50 * its instance is incremented.
52 * All read operations ignore the instance field. All write operations
53 * refuse to operate on the object if there is an instance mismatch.
57 * Don't go through unnecessary overhead for xdr_ni_index using typedef
58 * rpcgen needs an optimizer so we don't have to do this!
61 %typedef unsigned long ni_index;
63 #define ni_index unsigned long
67 ni_index nii_instance;
72 * Names are assumed to contain human-readable ASCII characters.
74 typedef string ni_name<NI_NAME_MAXLEN>;
77 typedef ni_name ni_namelist<NI_NAMELIST_MAXLEN>;
88 * A list of properties
90 typedef ni_property ni_proplist<NI_PROPLIST_MAXLEN>;
93 * A list of IDs (yet another variable-length array)
95 typedef ni_index ni_idlist<NI_IDLIST_MAXLEN>;
103 ni_proplist nio_props;
105 ni_idlist nio_children;
110 * All operations return a status indicating either that the requested
111 * operation succeeded or why it failed.
114 NI_OK, /* Operation succeeded */
115 NI_BADID, /* ID is invalid */
116 NI_STALE, /* Write attempted on stale version of object */
117 NI_NOSPACE, /* No space available for write operation */
118 NI_PERM, /* Permission denied */
119 NI_NODIR, /* No such directory */
120 NI_NOPROP, /* No such property */
121 NI_NONAME, /* No such name */
122 NI_NOTEMPTY, /* Cannot delete name object with children */
123 NI_UNRELATED, /* Object is not child of parent: cannot destroy */
124 NI_SERIAL, /* Serialization error */
125 NI_NETROOT, /* Hit network root domain */
126 NI_NORESPONSE, /* No response from remote parent */
127 NI_RDONLY, /* No writes allowed: all objects are read-only */
128 NI_SYSTEMERR, /* generic remote error */
129 NI_ALIVE, /* Can't regenerate: already in use */
130 NI_NOTMASTER, /* Operation makes no sense on clone */
131 NI_CANTFINDADDRESS, /* Can't find address of server */
132 NI_DUPTAG, /* Duplicate domain tag: can't serve it */
133 NI_NOTAG, /* No such tag */
134 NI_AUTHERROR, /* Authentication error */
135 NI_NOUSER, /* No such user */
136 NI_MASTERBUSY, /* Master server is busy */
137 NI_INVALIDDOMAIN, /* Invalid Domain */
138 NI_BADOP, /* Invalid operation on master */
139 NI_FAILED = 9999 /* generic local error */
143 * Wrappers needed to handle arguments and results
145 union ni_id_res switch (ni_status status) {
152 struct ni_parent_stuff {
157 union ni_parent_res switch (ni_status status) {
159 struct ni_parent_stuff stuff;
164 struct ni_children_stuff {
169 union ni_children_res switch (ni_status status) {
171 ni_children_stuff stuff;
181 typedef ni_entry ni_entrylist<NI_IDLIST_MAXLEN>;
183 struct ni_list_stuff {
184 ni_entrylist entries;
188 union ni_list_res switch (ni_status status) {
195 struct ni_proplist_stuff {
200 struct ni_create_args {
207 union ni_proplist_res switch (ni_status status) {
209 ni_proplist_stuff stuff;
214 struct ni_create_stuff {
219 union ni_create_res switch (ni_status status) {
221 ni_create_stuff stuff;
226 struct ni_destroy_args {
231 struct ni_lookup_args {
237 struct ni_lookup_stuff {
242 union ni_lookup_res switch (ni_status status) {
244 ni_lookup_stuff stuff;
250 struct ni_name_args {
255 struct ni_createprop_args {
261 struct ni_writeprop_args {
267 struct ni_prop_args {
272 struct ni_namelist_stuff {
277 union ni_namelist_res switch (ni_status status) {
279 ni_namelist_stuff stuff;
284 struct ni_propname_args {
290 struct ni_createname_args {
297 struct ni_nameindex_args {
303 struct ni_writename_args {
310 struct ni_readname_stuff {
315 union ni_readname_res switch (ni_status status) {
317 ni_readname_stuff stuff;
327 union ni_rparent_res switch (ni_status status) {
334 typedef struct ni_object_node *ni_object_list;
335 struct ni_object_node {
340 struct ni_readall_stuff {
346 union ni_readall_res switch (ni_status status) {
348 ni_readall_stuff stuff;
353 typedef ni_proplist ni_proplist_list<NI_IDLIST_MAXLEN>;
355 struct ni_listall_stuff {
357 ni_proplist_list entries;
360 union ni_listall_res switch (ni_status status) {
362 ni_listall_stuff stuff;
373 * Get various server statistics
376 _NI_STATISTICS(void) = 1;
379 * Procedures dealing with nodes
388 _NI_PARENT(ni_id) = 4;
391 _NI_CREATE(ni_create_args) = 5;
394 _NI_DESTROY(ni_destroy_args) = 6;
400 _NI_WRITE(ni_proplist_stuff) = 8;
403 _NI_CHILDREN(ni_id) = 9;
406 _NI_LOOKUP(ni_lookup_args) = 10;
409 _NI_LIST(ni_name_args) = 11;
412 * Procedures dealing with properties
415 _NI_CREATEPROP(ni_createprop_args) = 12;
418 _NI_DESTROYPROP(ni_prop_args) = 13;
421 _NI_READPROP(ni_prop_args) = 14;
424 _NI_WRITEPROP(ni_writeprop_args) = 15;
427 _NI_RENAMEPROP(ni_propname_args) = 16;
430 _NI_LISTPROPS(ni_id) = 17;
433 * Procedures dealing with names
436 _NI_CREATENAME(ni_createname_args) = 18;
439 _NI_DESTROYNAME(ni_nameindex_args) = 19;
442 _NI_READNAME(ni_nameindex_args) = 20;
445 _NI_WRITENAME(ni_writename_args) = 21;
448 * Returns the address of this domain's remote parent
451 _NI_RPARENT(void) = 22;
454 * List all properties of each subdirectory, not just
455 * just a single named property.
457 * WARNING: this routine is dangerous and may be
458 * removed from future implementations of the protocol.
459 * While it is good the the network in that there is
460 * less data on it because a lot is done in a single call,
461 * it is bad for the server because it ties it up and locks
465 _NI_LISTALL(ni_id) = 23;
468 * Answers only if the given binding is served
471 _NI_BIND(ni_binding) = 24;
474 * Read the entire database if the checksum is different
475 * Implemented by master only.
478 _NI_READALL(unsigned) = 25;
481 * Informs server that master has crashed. Hands out
485 _NI_CRASHED(unsigned) = 26;
488 * If master, force clones to resync.
489 * If clone, resync with master.
492 _NI_RESYNC(void) = 27;
496 * Extra procedure added for performance
497 * Terminates on first hit, returns proplist
500 _NI_LOOKUPREAD(ni_lookup_args) = 28;