Libinfo-173.tar.gz
[apple/libinfo.git] / rpc.subproj / pmap_prot.h
1 /*
2 * Copyright (c) 1999 Apple Computer, Inc. All rights reserved.
3 *
4 * @APPLE_LICENSE_HEADER_START@
5 *
6 * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved.
7 *
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
13 * file.
14 *
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.
22 *
23 * @APPLE_LICENSE_HEADER_END@
24 */
25 /*
26 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
27 * unrestricted use provided that this legend is included on all tape
28 * media and as a part of the software program in whole or part. Users
29 * may copy or modify Sun RPC without charge, but are not authorized
30 * to license or distribute it to anyone else except as part of a product or
31 * program developed by the user.
32 *
33 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
34 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
35 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
36 *
37 * Sun RPC is provided with no support and without any obligation on the
38 * part of Sun Microsystems, Inc. to assist in its use, correction,
39 * modification or enhancement.
40 *
41 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
42 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
43 * OR ANY PART THEREOF.
44 *
45 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
46 * or profits or other special, indirect and consequential damages, even if
47 * Sun has been advised of the possibility of such damages.
48 *
49 * Sun Microsystems, Inc.
50 * 2550 Garcia Avenue
51 * Mountain View, California 94043
52 *
53 * from: @(#)pmap_prot.h 1.14 88/02/08 SMI
54 * from: @(#)pmap_prot.h 2.1 88/07/29 4.0 RPCSRC
55 * $Id: pmap_prot.h,v 1.2 1999/10/14 21:56:53 wsanchez Exp $
56 */
57
58 /*
59 * pmap_prot.h
60 * Protocol for the local binder service, or pmap.
61 *
62 * Copyright (C) 1984, Sun Microsystems, Inc.
63 *
64 * The following procedures are supported by the protocol:
65 *
66 * PMAPPROC_NULL() returns ()
67 * takes nothing, returns nothing
68 *
69 * PMAPPROC_SET(struct pmap) returns (bool_t)
70 * TRUE is success, FALSE is failure. Registers the tuple
71 * [prog, vers, prot, port].
72 *
73 * PMAPPROC_UNSET(struct pmap) returns (bool_t)
74 * TRUE is success, FALSE is failure. Un-registers pair
75 * [prog, vers]. prot and port are ignored.
76 *
77 * PMAPPROC_GETPORT(struct pmap) returns (long unsigned).
78 * 0 is failure. Otherwise returns the port number where the pair
79 * [prog, vers] is registered. It may lie!
80 *
81 * PMAPPROC_DUMP() RETURNS (struct pmaplist *)
82 *
83 * PMAPPROC_CALLIT(unsigned, unsigned, unsigned, string<>)
84 * RETURNS (port, string<>);
85 * usage: encapsulatedresults = PMAPPROC_CALLIT(prog, vers, proc, encapsulatedargs);
86 * Calls the procedure on the local machine. If it is not registered,
87 * this procedure is quite; ie it does not return error information!!!
88 * This procedure only is supported on rpc/udp and calls via
89 * rpc/udp. This routine only passes null authentication parameters.
90 * This file has no interface to xdr routines for PMAPPROC_CALLIT.
91 *
92 * The service supports remote procedure calls on udp/ip or tcp/ip socket 111.
93 */
94
95 #ifndef _RPC_PMAPPROT_H
96 #define _RPC_PMAPPROT_H
97 #include <sys/cdefs.h>
98
99 #define PMAPPORT ((u_short)111)
100 #define PMAPPROG ((u_long)100000)
101 #define PMAPVERS ((u_long)2)
102 #define PMAPVERS_PROTO ((u_long)2)
103 #define PMAPVERS_ORIG ((u_long)1)
104 #define PMAPPROC_NULL ((u_long)0)
105 #define PMAPPROC_SET ((u_long)1)
106 #define PMAPPROC_UNSET ((u_long)2)
107 #define PMAPPROC_GETPORT ((u_long)3)
108 #define PMAPPROC_DUMP ((u_long)4)
109 #define PMAPPROC_CALLIT ((u_long)5)
110
111 struct pmap {
112 long unsigned pm_prog;
113 long unsigned pm_vers;
114 long unsigned pm_prot;
115 long unsigned pm_port;
116 };
117
118 struct pmaplist {
119 struct pmap pml_map;
120 struct pmaplist *pml_next;
121 };
122
123 __BEGIN_DECLS
124 extern bool_t xdr_pmap __P((XDR *, struct pmap *));
125 extern bool_t xdr_pmaplist __P((XDR *, struct pmaplist **));
126 __END_DECLS
127
128 #endif /* !_RPC_PMAPPROT_H */