xref: /titanic_50/usr/src/lib/libbc/libc/yp/ypv1_prot.h (revision 9acbbeaf2a1ffe5c14b244867d427714fab43c5c)
1 /*
2  * CDDL HEADER START
3  *
4  * The contents of this file are subject to the terms of the
5  * Common Development and Distribution License, Version 1.0 only
6  * (the "License").  You may not use this file except in compliance
7  * with the License.
8  *
9  * You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
10  * or http://www.opensolaris.org/os/licensing.
11  * See the License for the specific language governing permissions
12  * and limitations under the License.
13  *
14  * When distributing Covered Code, include this CDDL HEADER in each
15  * file and include the License file at usr/src/OPENSOLARIS.LICENSE.
16  * If applicable, add the following below this CDDL HEADER, with the
17  * fields enclosed by brackets "[]" replaced with your own identifying
18  * information: Portions Copyright [yyyy] [name of copyright owner]
19  *
20  * CDDL HEADER END
21  */
22 /*
23  * Copyright 1990 Sun Microsystems, Inc.  All rights reserved.
24  * Use is subject to license terms.
25  */
26 
27 #pragma ident	"%Z%%M%	%I%	%E% SMI"
28 
29 /*
30  * This contains symbol and structure definitions used in supporting the old
31  * "v1" protocol.  They were previously defined in yp_prot.h.
32  *
33  * This file exists so that the NIS system can provide backward compatibility.
34  * Normal NIS client processes should not use this interface:  the old
35  * protocol will not be supported in the next release.
36  */
37 #define YPOLDVERS		(YPVERS - 1)
38 #define YPOLDPROC_NULL		((u_long)0)
39 #define YPOLDPROC_DOMAIN	((u_long)1)
40 #define YPOLDPROC_DOMAIN_NONACK	((u_long)2)
41 #define YPOLDPROC_MATCH		((u_long)3)
42 #define YPOLDPROC_FIRST		((u_long)4)
43 #define YPOLDPROC_NEXT		((u_long)5)
44 #define YPOLDPROC_POLL		((u_long)6)
45 #define YPOLDPROC_PUSH		((u_long)7)
46 #define YPOLDPROC_PULL		((u_long)8)
47 #define YPOLDPROC_GET		((u_long)9)
48 
49 enum ypreqtype {YPREQ_KEY = 1, YPREQ_NOKEY = 2, YPREQ_MAP_PARMS = 3};
50 struct yprequest {
51 	enum ypreqtype yp_reqtype;
52 	union {
53 		struct ypreq_key yp_req_keytype;
54 		struct ypreq_nokey yp_req_nokeytype;
55 		struct ypmap_parms yp_req_map_parmstype;
56 	}yp_reqbody;
57 };
58 
59 #define YPMATCH_REQTYPE YPREQ_KEY
60 #define ypmatch_req_domain yp_reqbody.yp_req_keytype.domain
61 #define ypmatch_req_map yp_reqbody.yp_req_keytype.map
62 #define ypmatch_req_keydat yp_reqbody.yp_req_keytype.keydat
63 #define ypmatch_req_keyptr yp_reqbody.yp_req_keytype.keydat.dptr
64 #define ypmatch_req_keysize yp_reqbody.yp_req_keytype.keydat.dsize
65 
66 #define YPFIRST_REQTYPE YPREQ_NOKEY
67 #define ypfirst_req_domain yp_reqbody.yp_req_nokeytype.domain
68 #define ypfirst_req_map yp_reqbody.yp_req_nokeytype.map
69 
70 #define YPNEXT_REQTYPE YPREQ_KEY
71 #define ypnext_req_domain yp_reqbody.yp_req_keytype.domain
72 #define ypnext_req_map yp_reqbody.yp_req_keytype.map
73 #define ypnext_req_keydat yp_reqbody.yp_req_keytype.keydat
74 #define ypnext_req_keyptr yp_reqbody.yp_req_keytype.keydat.dptr
75 #define ypnext_req_keysize yp_reqbody.yp_req_keytype.keydat.dsize
76 
77 #define YPPUSH_REQTYPE YPREQ_NOKEY
78 #define yppush_req_domain yp_reqbody.yp_req_nokeytype.domain
79 #define yppush_req_map yp_reqbody.yp_req_nokeytype.map
80 
81 #define YPPULL_REQTYPE YPREQ_NOKEY
82 #define yppull_req_domain yp_reqbody.yp_req_nokeytype.domain
83 #define yppull_req_map yp_reqbody.yp_req_nokeytype.map
84 
85 #define YPPOLL_REQTYPE YPREQ_NOKEY
86 #define yppoll_req_domain yp_reqbody.yp_req_nokeytype.domain
87 #define yppoll_req_map yp_reqbody.yp_req_nokeytype.map
88 
89 #define YPGET_REQTYPE YPREQ_MAP_PARMS
90 #define ypget_req_domain yp_reqbody.yp_req_map_parmstype.domain
91 #define ypget_req_map yp_reqbody.yp_req_map_parmstype.map
92 #define ypget_req_ordernum yp_reqbody.yp_req_map_parmstype.ordernum
93 #define ypget_req_owner yp_reqbody.yp_req_map_parmstype.owner
94 
95 enum ypresptype {YPRESP_VAL = 1, YPRESP_KEY_VAL = 2, YPRESP_MAP_PARMS = 3};
96 struct ypresponse {
97 	enum ypresptype yp_resptype;
98 	union {
99 		struct ypresp_val yp_resp_valtype;
100 		struct ypresp_key_val yp_resp_key_valtype;
101 		struct ypmap_parms yp_resp_map_parmstype;
102 	} yp_respbody;
103 };
104 
105 #define YPMATCH_RESPTYPE YPRESP_VAL
106 #define ypmatch_resp_status yp_respbody.yp_resp_valtype.status
107 #define ypmatch_resp_valdat yp_respbody.yp_resp_valtype.valdat
108 #define ypmatch_resp_valptr yp_respbody.yp_resp_valtype.valdat.dptr
109 #define ypmatch_resp_valsize yp_respbody.yp_resp_valtype.valdat.dsize
110 
111 #define YPFIRST_RESPTYPE YPRESP_KEY_VAL
112 #define ypfirst_resp_status yp_respbody.yp_resp_key_valtype.status
113 #define ypfirst_resp_keydat yp_respbody.yp_resp_key_valtype.keydat
114 #define ypfirst_resp_keyptr yp_respbody.yp_resp_key_valtype.keydat.dptr
115 #define ypfirst_resp_keysize yp_respbody.yp_resp_key_valtype.keydat.dsize
116 #define ypfirst_resp_valdat yp_respbody.yp_resp_key_valtype.valdat
117 #define ypfirst_resp_valptr yp_respbody.yp_resp_key_valtype.valdat.dptr
118 #define ypfirst_resp_valsize yp_respbody.yp_resp_key_valtype.valdat.dsize
119 
120 #define YPNEXT_RESPTYPE YPRESP_KEY_VAL
121 #define ypnext_resp_status yp_respbody.yp_resp_key_valtype.status
122 #define ypnext_resp_keydat yp_respbody.yp_resp_key_valtype.keydat
123 #define ypnext_resp_keyptr yp_respbody.yp_resp_key_valtype.keydat.dptr
124 #define ypnext_resp_keysize yp_respbody.yp_resp_key_valtype.keydat.dsize
125 #define ypnext_resp_valdat yp_respbody.yp_resp_key_valtype.valdat
126 #define ypnext_resp_valptr yp_respbody.yp_resp_key_valtype.valdat.dptr
127 #define ypnext_resp_valsize yp_respbody.yp_resp_key_valtype.valdat.dsize
128 
129 #define YPPOLL_RESPTYPE YPRESP_MAP_PARMS
130 #define yppoll_resp_domain yp_respbody.yp_resp_map_parmstype.domain
131 #define yppoll_resp_map yp_respbody.yp_resp_map_parmstype.map
132 #define yppoll_resp_ordernum yp_respbody.yp_resp_map_parmstype.ordernum
133 #define yppoll_resp_owner yp_respbody.yp_resp_map_parmstype.owner
134 
135 
136 extern bool _xdr_yprequest();
137 extern bool _xdr_ypresponse();
138 
139 #define YPBINDOLDVERS 		(YPBINDVERS - 1)
140 struct ypbind_oldsetdom {
141 	char ypoldsetdom_domain[YPMAXDOMAIN + 1];
142 	struct ypbind_binding ypoldsetdom_binding;
143 };
144 #define ypoldsetdom_addr ypoldsetdom_binding.ypbind_binding_addr
145 #define ypoldsetdom_port ypoldsetdom_binding.ypbind_binding_port
146 
147 extern bool _xdr_ypbind_oldsetdom();
148