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 * Lookup server protocol - Internal to NeXT
26 * Copyright (C) 1989 by NeXT, Inc.
28 * This server uses a protocol based upon XDR layered on top of
29 * a mach rpc call. There are three procedures defined in the "lookup.defs"
30 * file. A "lookup_link" operation takes a procedure string name and returns a
31 * number to be used in the other two calls. "lookup_all" takes a procedure
32 * number and XDR'd arguments and returns XDR'd results. It returns the
33 * entire list of entries. "lookup_one" has a similar calling convention,
34 * but returns only a single entry.
36 * The syntax of calls described here in comments looks like this:
38 * result_type procedure_name(arg_type1 arg1, arg_type2 arg2, ...)
40 * The arguments are assumed to be XDR'd in sequence and a single XDR'd
43 const _LU_MAXLUSTRLEN = 256;
45 const _LU_MAXGRP = 1024;
46 const _LU_MAXHNAMES = 32;
47 const _LU_MAXADDRS = 32;
48 const _LU_MAXNNAMES = 32;
49 const _LU_MAXPNAMES = 32;
50 const _LU_MAXSNAMES = 32;
51 const _LU_MAXRNAMES = 32;
52 const _LU_MAXPRNAMES = 32;
53 const _LU_MAXPRPROPS = 1024;
54 const _LU_MAX_BOOTPARAMS_KV = 32;
55 const _LU_MAXALIASMEMBERS = 4096;
58 typedef string _lu_string<_LU_MAXLUSTRLEN>;
63 * int putpwpasswd(_lu_string long, _lu_string old, _lu_string new)
64 * _lu_passwd * getpwuid(int uid)
65 * _lu_passwd * getpwnam(_lu_string name)
66 * _lu_passwd<> getpwent(void)
80 typedef _lu_passwd *_lu_passwd_ptr;
85 * _lu_group * getgrgid(int gid)
86 * _lu_group * getgrnam(_lu_string name)
87 * _lu_group<> getgrent(void)
93 _lu_string gr_mem<_LU_MAXGRP>;
95 typedef _lu_group *_lu_group_ptr;
99 * _lu_hostent * gethostbyaddr(unsigned long addr) -- IP only
100 * _lu_hostent * gethostbyname(_lu_string name)
101 * _lu_hostent<> gethostent(void)
104 _lu_string h_names<_LU_MAXHNAMES>;
105 unsigned long h_addrs<_LU_MAXADDRS>; /* IP only */
107 typedef _lu_hostent *_lu_hostent_ptr;
111 * _lu_netent * getnetbyaddr(unsigned long addr) --IP only
112 * _lu_netent * getnetbyname(_lu_string name)
113 * _lu_netent<> getnetent(void)
116 _lu_string n_names<_LU_MAXNNAMES>;
117 unsigned long n_net; /* IP only */
119 typedef _lu_netent *_lu_netent_ptr;
124 * _lu_servent * getservbyport(int port, _lu_string proto)
125 * _lu_servent * getservbyname(_lu_string name, _lu_string proto)
126 * _lu_servent<> getservent(void)
129 _lu_string s_names<_LU_MAXSNAMES>;
133 typedef _lu_servent *_lu_servent_ptr;
137 * _lu_protoent * getprotobynumber(int number)
138 * _lu_protoent * getprotobyname(_lu_string name)
139 * _lu_protoent<> getprotoent(void)
141 struct _lu_protoent {
142 _lu_string p_names<_LU_MAXPNAMES>;
145 typedef _lu_protoent *_lu_protoent_ptr;
150 * _lu_rpcent * getrpcbynumber(int number)
151 * _lu_rpcent * getrpcbyname(_lu_string name)
152 * _lu_rpcent<> getrpcent(void)
155 _lu_string r_names<_LU_MAXRNAMES>;
158 typedef _lu_rpcent *_lu_rpcent_ptr;
162 * _lu_fsent<> getfsent(void)
163 * _lu_fsent * getfsbyname(_lu_string name)
168 _lu_string fs_vfstype;
169 _lu_string fs_mntops;
174 typedef _lu_fsent *_lu_fsent_ptr;
178 * _lu_prdb_ent * prdb_getbyname
179 * _lu_prdb_ent<> prdb_get(void)
181 struct _lu_prdb_property {
186 struct _lu_prdb_ent {
187 _lu_string pe_names<_LU_MAXPRNAMES>;
188 _lu_prdb_property pe_props<_LU_MAXPRPROPS>;
190 typedef _lu_prdb_ent *_lu_prdb_ent_ptr;
195 * _lu_bootp_ent * bootp_getbyip(unsigned long addr)
196 * _lu_bootp_ent * bootp_getbyether(opaque bootp_enaddr[6])
198 struct _lu_bootp_ent {
199 _lu_string bootp_name;
200 _lu_string bootp_bootfile;
201 unsigned long bootp_ipaddr;
202 opaque bootp_enaddr[6];
204 typedef _lu_bootp_ent *_lu_bootp_ent_ptr;
208 * _lu_bootparams_ent * bootparams_getbyname(_lu_string name)
209 * _lu_bootparams_ent<> bootparams_getent(void)
211 struct _lu_bootparams_ent {
212 _lu_string bootparams_name;
213 _lu_string bootparams_keyvalues<_LU_MAX_BOOTPARAMS_KV>;
215 typedef _lu_bootparams_ent *_lu_bootparams_ent_ptr;
220 * _lu_aliasent * alias_getbyname(_lu_string name)
221 * _lu_aliasent<> alias_getent(void)
223 struct _lu_aliasent {
224 _lu_string alias_name;
225 _lu_string alias_members<_LU_MAXALIASMEMBERS>;
228 typedef _lu_aliasent *_lu_aliasent_ptr;
232 * int innetgr(_lu_innetgr_args args)
233 * _lu_netgrent<> getnetgrent(_lu_string group)
235 struct _lu_innetgr_args {
245 _lu_string ng_domain;