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 * Lookup server protocol - Internal to NeXT
27 * Copyright (C) 1989 by NeXT, Inc.
29 * This server uses a protocol based upon XDR layered on top of
30 * a mach rpc call. There are three procedures defined in the "lookup.defs"
31 * file. A "lookup_link" operation takes a procedure string name and returns a
32 * number to be used in the other two calls. "lookup_all" takes a procedure
33 * number and XDR'd arguments and returns XDR'd results. It returns the
34 * entire list of entries. "lookup_one" has a similar calling convention,
35 * but returns only a single entry.
37 * The syntax of calls described here in comments looks like this:
39 * result_type procedure_name(arg_type1 arg1, arg_type2 arg2, ...)
41 * The arguments are assumed to be XDR'd in sequence and a single XDR'd
44 const _LU_MAXLUSTRLEN = 256;
46 const _LU_MAXGRP = 1024;
47 const _LU_MAXHNAMES = 32;
48 const _LU_MAXADDRS = 32;
49 const _LU_MAXNNAMES = 32;
50 const _LU_MAXPNAMES = 32;
51 const _LU_MAXSNAMES = 32;
52 const _LU_MAXRNAMES = 32;
53 const _LU_MAXPRNAMES = 32;
54 const _LU_MAXPRPROPS = 1024;
55 const _LU_MAX_BOOTPARAMS_KV = 32;
56 const _LU_MAXALIASMEMBERS = 4096;
59 typedef string _lu_string<_LU_MAXLUSTRLEN>;
64 * int putpwpasswd(_lu_string long, _lu_string old, _lu_string new)
65 * _lu_passwd * getpwuid(int uid)
66 * _lu_passwd * getpwnam(_lu_string name)
67 * _lu_passwd<> getpwent(void)
81 typedef _lu_passwd *_lu_passwd_ptr;
86 * _lu_group * getgrgid(int gid)
87 * _lu_group * getgrnam(_lu_string name)
88 * _lu_group<> getgrent(void)
94 _lu_string gr_mem<_LU_MAXGRP>;
96 typedef _lu_group *_lu_group_ptr;
100 * _lu_hostent * gethostbyaddr(unsigned long addr) -- IP only
101 * _lu_hostent * gethostbyname(_lu_string name)
102 * _lu_hostent<> gethostent(void)
105 _lu_string h_names<_LU_MAXHNAMES>;
106 unsigned long h_addrs<_LU_MAXADDRS>; /* IP only */
108 typedef _lu_hostent *_lu_hostent_ptr;
112 * _lu_netent * getnetbyaddr(unsigned long addr) --IP only
113 * _lu_netent * getnetbyname(_lu_string name)
114 * _lu_netent<> getnetent(void)
117 _lu_string n_names<_LU_MAXNNAMES>;
118 unsigned long n_net; /* IP only */
120 typedef _lu_netent *_lu_netent_ptr;
125 * _lu_servent * getservbyport(int port, _lu_string proto)
126 * _lu_servent * getservbyname(_lu_string name, _lu_string proto)
127 * _lu_servent<> getservent(void)
130 _lu_string s_names<_LU_MAXSNAMES>;
134 typedef _lu_servent *_lu_servent_ptr;
138 * _lu_protoent * getprotobynumber(int number)
139 * _lu_protoent * getprotobyname(_lu_string name)
140 * _lu_protoent<> getprotoent(void)
142 struct _lu_protoent {
143 _lu_string p_names<_LU_MAXPNAMES>;
146 typedef _lu_protoent *_lu_protoent_ptr;
151 * _lu_rpcent * getrpcbynumber(int number)
152 * _lu_rpcent * getrpcbyname(_lu_string name)
153 * _lu_rpcent<> getrpcent(void)
156 _lu_string r_names<_LU_MAXRNAMES>;
159 typedef _lu_rpcent *_lu_rpcent_ptr;
163 * _lu_fsent<> getfsent(void)
164 * _lu_fsent * getfsbyname(_lu_string name)
169 _lu_string fs_vfstype;
170 _lu_string fs_mntops;
175 typedef _lu_fsent *_lu_fsent_ptr;
179 * _lu_prdb_ent * prdb_getbyname
180 * _lu_prdb_ent<> prdb_get(void)
182 struct _lu_prdb_property {
187 struct _lu_prdb_ent {
188 _lu_string pe_names<_LU_MAXPRNAMES>;
189 _lu_prdb_property pe_props<_LU_MAXPRPROPS>;
191 typedef _lu_prdb_ent *_lu_prdb_ent_ptr;
196 * _lu_bootp_ent * bootp_getbyip(unsigned long addr)
197 * _lu_bootp_ent * bootp_getbyether(opaque bootp_enaddr[6])
199 struct _lu_bootp_ent {
200 _lu_string bootp_name;
201 _lu_string bootp_bootfile;
202 unsigned long bootp_ipaddr;
203 opaque bootp_enaddr[6];
205 typedef _lu_bootp_ent *_lu_bootp_ent_ptr;
209 * _lu_bootparams_ent * bootparams_getbyname(_lu_string name)
210 * _lu_bootparams_ent<> bootparams_getent(void)
212 struct _lu_bootparams_ent {
213 _lu_string bootparams_name;
214 _lu_string bootparams_keyvalues<_LU_MAX_BOOTPARAMS_KV>;
216 typedef _lu_bootparams_ent *_lu_bootparams_ent_ptr;
221 * _lu_aliasent * alias_getbyname(_lu_string name)
222 * _lu_aliasent<> alias_getent(void)
224 struct _lu_aliasent {
225 _lu_string alias_name;
226 _lu_string alias_members<_LU_MAXALIASMEMBERS>;
229 typedef _lu_aliasent *_lu_aliasent_ptr;
233 * int innetgr(_lu_innetgr_args args)
234 * _lu_netgrent<> getnetgrent(_lu_string group)
236 struct _lu_innetgr_args {
246 _lu_string ng_domain;