2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
4 * @APPLE_LICENSE_HEADER_START@
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
8 * This file contains Original Code and/or Modifications of Original Code
9 * as defined in and that are subject to the Apple Public Source License
10 * Version 2.0 (the 'License'). You may not use this file except in
11 * compliance with the License. Please obtain a copy of the License at
12 * http://www.opensource.apple.com/apsl/ and read it before using this
15 * The Original Code and all software distributed under the License are
16 * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER
17 * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES,
18 * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY,
19 * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT.
20 * Please see the License for the specific language governing rights and
21 * limitations under the License.
23 * @APPLE_LICENSE_HEADER_END@
26 * NetInfo protocol specification
27 * Copyright (C) 1989 by NeXT, Inc.
30 /* Preamble appearing on all generated output */
33 % * Output of the RPC protocol compiler: DO NOT EDIT
34 % * Copyright (C) 1989 by NeXT, Inc.
42 const NI_NAME_MAXLEN = 65535;
43 const NI_NAMELIST_MAXLEN = 65535;
44 const NI_PROPLIST_MAXLEN = 65535;
45 const NI_IDLIST_MAXLEN = 1048576;
48 * Every object has a unique ID. One part of the ID identifies the object
49 * itself. The other identifies the instance of the object. Every time
50 * an object is written or an object is destroyed and then reallocated,
51 * its instance is incremented.
53 * All read operations ignore the instance field. All write operations
54 * refuse to operate on the object if there is an instance mismatch.
58 * Don't go through unnecessary overhead for xdr_ni_index using typedef
59 * rpcgen needs an optimizer so we don't have to do this!
62 %typedef unsigned long ni_index;
64 #define ni_index unsigned long
68 ni_index nii_instance;
73 * Names are assumed to contain human-readable ASCII characters.
75 typedef string ni_name<NI_NAME_MAXLEN>;
78 typedef ni_name ni_namelist<NI_NAMELIST_MAXLEN>;
89 * A list of properties
91 typedef ni_property ni_proplist<NI_PROPLIST_MAXLEN>;
94 * A list of IDs (yet another variable-length array)
96 typedef ni_index ni_idlist<NI_IDLIST_MAXLEN>;
104 ni_proplist nio_props;
106 ni_idlist nio_children;
111 * All operations return a status indicating either that the requested
112 * operation succeeded or why it failed.
115 NI_OK, /* Operation succeeded */
116 NI_BADID, /* ID is invalid */
117 NI_STALE, /* Write attempted on stale version of object */
118 NI_NOSPACE, /* No space available for write operation */
119 NI_PERM, /* Permission denied */
120 NI_NODIR, /* No such directory */
121 NI_NOPROP, /* No such property */
122 NI_NONAME, /* No such name */
123 NI_NOTEMPTY, /* Cannot delete name object with children */
124 NI_UNRELATED, /* Object is not child of parent: cannot destroy */
125 NI_SERIAL, /* Serialization error */
126 NI_NETROOT, /* Hit network root domain */
127 NI_NORESPONSE, /* No response from remote parent */
128 NI_RDONLY, /* No writes allowed: all objects are read-only */
129 NI_SYSTEMERR, /* generic remote error */
130 NI_ALIVE, /* Can't regenerate: already in use */
131 NI_NOTMASTER, /* Operation makes no sense on clone */
132 NI_CANTFINDADDRESS, /* Can't find address of server */
133 NI_DUPTAG, /* Duplicate domain tag: can't serve it */
134 NI_NOTAG, /* No such tag */
135 NI_AUTHERROR, /* Authentication error */
136 NI_NOUSER, /* No such user */
137 NI_MASTERBUSY, /* Master server is busy */
138 NI_INVALIDDOMAIN, /* Invalid Domain */
139 NI_BADOP, /* Invalid operation on master */
140 NI_FAILED = 9999 /* generic local error */
144 * Wrappers needed to handle arguments and results
146 union ni_id_res switch (ni_status status) {
153 struct ni_parent_stuff {
158 union ni_parent_res switch (ni_status status) {
160 struct ni_parent_stuff stuff;
165 struct ni_children_stuff {
170 union ni_children_res switch (ni_status status) {
172 ni_children_stuff stuff;
182 typedef ni_entry ni_entrylist<NI_IDLIST_MAXLEN>;
184 struct ni_list_stuff {
185 ni_entrylist entries;
189 union ni_list_res switch (ni_status status) {
196 struct ni_proplist_stuff {
201 struct ni_create_args {
208 union ni_proplist_res switch (ni_status status) {
210 ni_proplist_stuff stuff;
215 struct ni_create_stuff {
220 union ni_create_res switch (ni_status status) {
222 ni_create_stuff stuff;
227 struct ni_destroy_args {
232 struct ni_lookup_args {
238 struct ni_lookup_stuff {
243 union ni_lookup_res switch (ni_status status) {
245 ni_lookup_stuff stuff;
251 struct ni_name_args {
256 struct ni_createprop_args {
262 struct ni_writeprop_args {
268 struct ni_prop_args {
273 struct ni_namelist_stuff {
278 union ni_namelist_res switch (ni_status status) {
280 ni_namelist_stuff stuff;
285 struct ni_propname_args {
291 struct ni_createname_args {
298 struct ni_nameindex_args {
304 struct ni_writename_args {
311 struct ni_readname_stuff {
316 union ni_readname_res switch (ni_status status) {
318 ni_readname_stuff stuff;
328 union ni_rparent_res switch (ni_status status) {
335 typedef struct ni_object_node *ni_object_list;
336 struct ni_object_node {
341 struct ni_readall_stuff {
347 union ni_readall_res switch (ni_status status) {
349 ni_readall_stuff stuff;
354 typedef ni_proplist ni_proplist_list<NI_IDLIST_MAXLEN>;
356 struct ni_listall_stuff {
358 ni_proplist_list entries;
361 union ni_listall_res switch (ni_status status) {
363 ni_listall_stuff stuff;
374 * Get various server statistics
377 _NI_STATISTICS(void) = 1;
380 * Procedures dealing with nodes
389 _NI_PARENT(ni_id) = 4;
392 _NI_CREATE(ni_create_args) = 5;
395 _NI_DESTROY(ni_destroy_args) = 6;
401 _NI_WRITE(ni_proplist_stuff) = 8;
404 _NI_CHILDREN(ni_id) = 9;
407 _NI_LOOKUP(ni_lookup_args) = 10;
410 _NI_LIST(ni_name_args) = 11;
413 * Procedures dealing with properties
416 _NI_CREATEPROP(ni_createprop_args) = 12;
419 _NI_DESTROYPROP(ni_prop_args) = 13;
422 _NI_READPROP(ni_prop_args) = 14;
425 _NI_WRITEPROP(ni_writeprop_args) = 15;
428 _NI_RENAMEPROP(ni_propname_args) = 16;
431 _NI_LISTPROPS(ni_id) = 17;
434 * Procedures dealing with names
437 _NI_CREATENAME(ni_createname_args) = 18;
440 _NI_DESTROYNAME(ni_nameindex_args) = 19;
443 _NI_READNAME(ni_nameindex_args) = 20;
446 _NI_WRITENAME(ni_writename_args) = 21;
449 * Returns the address of this domain's remote parent
452 _NI_RPARENT(void) = 22;
455 * List all properties of each subdirectory, not just
456 * just a single named property.
458 * WARNING: this routine is dangerous and may be
459 * removed from future implementations of the protocol.
460 * While it is good the the network in that there is
461 * less data on it because a lot is done in a single call,
462 * it is bad for the server because it ties it up and locks
466 _NI_LISTALL(ni_id) = 23;
469 * Answers only if the given binding is served
472 _NI_BIND(ni_binding) = 24;
475 * Read the entire database if the checksum is different
476 * Implemented by master only.
479 _NI_READALL(unsigned) = 25;
482 * Informs server that master has crashed. Hands out
486 _NI_CRASHED(unsigned) = 26;
489 * If master, force clones to resync.
490 * If clone, resync with master.
493 _NI_RESYNC(void) = 27;
497 * Extra procedure added for performance
498 * Terminates on first hit, returns proplist
501 _NI_LOOKUPREAD(ni_lookup_args) = 28;