Back to index

glibc  2.9
yp.h
Go to the documentation of this file.
00001 /*
00002  * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
00003  * unrestricted use provided that this legend is included on all tape
00004  * media and as a part of the software program in whole or part.  Users
00005  * may copy or modify Sun RPC without charge, but are not authorized
00006  * to license or distribute it to anyone else except as part of a product or
00007  * program developed by the user.
00008  *
00009  * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
00010  * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
00011  * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
00012  *
00013  * Sun RPC is provided with no support and without any obligation on the
00014  * part of Sun Microsystems, Inc. to assist in its use, correction,
00015  * modification or enhancement.
00016  *
00017  * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
00018  * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
00019  * OR ANY PART THEREOF.
00020  *
00021  * In no event will Sun Microsystems, Inc. be liable for any lost revenue
00022  * or profits or other special, indirect and consequential damages, even if
00023  * Sun has been advised of the possibility of such damages.
00024  *
00025  * Sun Microsystems, Inc.
00026  * 2550 Garcia Avenue
00027  * Mountain View, California  94043
00028  */
00029 
00030 #ifndef __RPCSVC_YP_H__
00031 #define __RPCSVC_YP_H__
00032 
00033 #include <features.h>
00034 #include <rpc/rpc.h>
00035 
00036 #define YPMAXRECORD 1024
00037 #define YPMAXDOMAIN 64
00038 #define YPMAXMAP 64
00039 #define YPMAXPEER 64
00040 
00041 enum ypstat {
00042        YP_TRUE = 1,
00043        YP_NOMORE = 2,
00044        YP_FALSE = 0,
00045        YP_NOMAP = -1,
00046        YP_NODOM = -2,
00047        YP_NOKEY = -3,
00048        YP_BADOP = -4,
00049        YP_BADDB = -5,
00050        YP_YPERR = -6,
00051        YP_BADARGS = -7,
00052        YP_VERS = -8,
00053 };
00054 typedef enum ypstat ypstat;
00055 
00056 enum ypxfrstat {
00057        YPXFR_SUCC = 1,
00058        YPXFR_AGE = 2,
00059        YPXFR_NOMAP = -1,
00060        YPXFR_NODOM = -2,
00061        YPXFR_RSRC = -3,
00062        YPXFR_RPC = -4,
00063        YPXFR_MADDR = -5,
00064        YPXFR_YPERR = -6,
00065        YPXFR_BADARGS = -7,
00066        YPXFR_DBM = -8,
00067        YPXFR_FILE = -9,
00068        YPXFR_SKEW = -10,
00069        YPXFR_CLEAR = -11,
00070        YPXFR_FORCE = -12,
00071        YPXFR_XFRERR = -13,
00072        YPXFR_REFUSED = -14,
00073 };
00074 typedef enum ypxfrstat ypxfrstat;
00075 
00076 typedef char *domainname;
00077 typedef char *mapname;
00078 typedef char *peername;
00079 
00080 typedef struct {
00081   u_int keydat_len;
00082   char *keydat_val;
00083 } keydat;
00084 
00085 typedef struct {
00086   u_int valdat_len;
00087   char *valdat_val;
00088 } valdat;
00089 
00090 struct ypmap_parms {
00091   domainname domain;
00092   mapname map;
00093   u_int ordernum;
00094   peername peer;
00095 };
00096 typedef struct ypmap_parms ypmap_parms;
00097 
00098 struct ypreq_key {
00099   domainname domain;
00100   mapname map;
00101   keydat key;
00102 };
00103 typedef struct ypreq_key ypreq_key;
00104 
00105 struct ypreq_nokey {
00106   domainname domain;
00107   mapname map;
00108 };
00109 typedef struct ypreq_nokey ypreq_nokey;
00110 
00111 struct ypreq_xfr {
00112   ypmap_parms map_parms;
00113   u_int transid;
00114   u_int prog;
00115   u_int port;
00116 };
00117 typedef struct ypreq_xfr ypreq_xfr;
00118 
00119 struct ypresp_val {
00120   ypstat stat;
00121   valdat val;
00122 };
00123 typedef struct ypresp_val ypresp_val;
00124 
00125 struct ypresp_key_val {
00126   ypstat stat;
00127 #ifdef STUPID_SUN_BUG
00128   /* This is the form as distributed by Sun.  But even the Sun NIS
00129      servers expect the values in the other order.  So their
00130      implementation somehow must change the order internally.  We
00131      don't want to follow this bad example since the user should be
00132      able to use rpcgen on this file.  */
00133   keydat key;
00134   valdat val;
00135 #else
00136   valdat val;
00137   keydat key;
00138 #endif
00139 };
00140 typedef struct ypresp_key_val ypresp_key_val;
00141 
00142 struct ypresp_master {
00143   ypstat stat;
00144   peername peer;
00145 };
00146 typedef struct ypresp_master ypresp_master;
00147 
00148 struct ypresp_order {
00149   ypstat stat;
00150   u_int ordernum;
00151 };
00152 typedef struct ypresp_order ypresp_order;
00153 
00154 struct ypresp_all {
00155   bool_t more;
00156   union {
00157     ypresp_key_val val;
00158   } ypresp_all_u;
00159 };
00160 typedef struct ypresp_all ypresp_all;
00161 
00162 struct ypresp_xfr {
00163   u_int transid;
00164   ypxfrstat xfrstat;
00165 };
00166 typedef struct ypresp_xfr ypresp_xfr;
00167 
00168 struct ypmaplist {
00169   mapname map;
00170   struct ypmaplist *next;
00171 };
00172 typedef struct ypmaplist ypmaplist;
00173 
00174 struct ypresp_maplist {
00175   ypstat stat;
00176   ypmaplist *maps;
00177 };
00178 typedef struct ypresp_maplist ypresp_maplist;
00179 
00180 enum yppush_status {
00181   YPPUSH_SUCC = 1,
00182   YPPUSH_AGE = 2,
00183   YPPUSH_NOMAP = -1,
00184   YPPUSH_NODOM = -2,
00185   YPPUSH_RSRC = -3,
00186   YPPUSH_RPC = -4,
00187   YPPUSH_MADDR = -5,
00188   YPPUSH_YPERR = -6,
00189   YPPUSH_BADARGS = -7,
00190   YPPUSH_DBM = -8,
00191   YPPUSH_FILE = -9,
00192   YPPUSH_SKEW = -10,
00193   YPPUSH_CLEAR = -11,
00194   YPPUSH_FORCE = -12,
00195   YPPUSH_XFRERR = -13,
00196   YPPUSH_REFUSED = -14,
00197 };
00198 typedef enum yppush_status yppush_status;
00199 
00200 struct yppushresp_xfr {
00201   u_int transid;
00202   yppush_status status;
00203 };
00204 typedef struct yppushresp_xfr yppushresp_xfr;
00205 
00206 enum ypbind_resptype {
00207   YPBIND_SUCC_VAL = 1,
00208   YPBIND_FAIL_VAL = 2,
00209 };
00210 typedef enum ypbind_resptype ypbind_resptype;
00211 
00212 struct ypbind_binding {
00213   char ypbind_binding_addr[4];
00214   char ypbind_binding_port[2];
00215 };
00216 typedef struct ypbind_binding ypbind_binding;
00217 
00218 struct ypbind_resp {
00219   ypbind_resptype ypbind_status;
00220   union {
00221     u_int ypbind_error;
00222     ypbind_binding ypbind_bindinfo;
00223   } ypbind_resp_u;
00224 };
00225 typedef struct ypbind_resp ypbind_resp;
00226 
00227 #define YPBIND_ERR_ERR 1
00228 #define YPBIND_ERR_NOSERV 2
00229 #define YPBIND_ERR_RESC 3
00230 
00231 struct ypbind_setdom {
00232   domainname ypsetdom_domain;
00233   ypbind_binding ypsetdom_binding;
00234   u_int ypsetdom_vers;
00235 };
00236 typedef struct ypbind_setdom ypbind_setdom;
00237 
00238 __BEGIN_DECLS
00239 
00240 #define YPPROG 100004
00241 #define YPVERS 2
00242 
00243 #define YPPROC_NULL 0
00244 extern  void *ypproc_null_2 (void *, CLIENT *);
00245 extern  void *ypproc_null_2_svc (void *, struct svc_req *);
00246 #define YPPROC_DOMAIN 1
00247 extern  bool_t *ypproc_domain_2 (domainname *, CLIENT *);
00248 extern  bool_t *ypproc_domain_2_svc (domainname *, struct svc_req *);
00249 #define YPPROC_DOMAIN_NONACK 2
00250 extern  bool_t *ypproc_domain_nonack_2 (domainname *, CLIENT *);
00251 extern  bool_t *ypproc_domain_nonack_2_svc (domainname *, struct svc_req *);
00252 #define YPPROC_MATCH 3
00253 extern  ypresp_val *ypproc_match_2 (ypreq_key *, CLIENT *);
00254 extern  ypresp_val *ypproc_match_2_svc (ypreq_key *, struct svc_req *);
00255 #define YPPROC_FIRST 4
00256 extern  ypresp_key_val *ypproc_first_2 (ypreq_key *, CLIENT *);
00257 extern  ypresp_key_val *ypproc_first_2_svc (ypreq_key *, struct svc_req *);
00258 #define YPPROC_NEXT 5
00259 extern  ypresp_key_val *ypproc_next_2 (ypreq_key *, CLIENT *);
00260 extern  ypresp_key_val *ypproc_next_2_svc (ypreq_key *, struct svc_req *);
00261 #define YPPROC_XFR 6
00262 extern  ypresp_xfr *ypproc_xfr_2 (ypreq_xfr *, CLIENT *);
00263 extern  ypresp_xfr *ypproc_xfr_2_svc (ypreq_xfr *, struct svc_req *);
00264 #define YPPROC_CLEAR 7
00265 extern  void *ypproc_clear_2 (void *, CLIENT *);
00266 extern  void *ypproc_clear_2_svc (void *, struct svc_req *);
00267 #define YPPROC_ALL 8
00268 extern  ypresp_all *ypproc_all_2 (ypreq_nokey *, CLIENT *);
00269 extern  ypresp_all *ypproc_all_2_svc (ypreq_nokey *, struct svc_req *);
00270 #define YPPROC_MASTER 9
00271 extern  ypresp_master *ypproc_master_2 (ypreq_nokey *, CLIENT *);
00272 extern  ypresp_master *ypproc_master_2_svc (ypreq_nokey *, struct svc_req *);
00273 #define YPPROC_ORDER 10
00274 extern  ypresp_order *ypproc_order_2 (ypreq_nokey *, CLIENT *);
00275 extern  ypresp_order *ypproc_order_2_svc (ypreq_nokey *, struct svc_req *);
00276 #define YPPROC_MAPLIST 11
00277 extern  ypresp_maplist *ypproc_maplist_2 (domainname *, CLIENT *);
00278 extern  ypresp_maplist *ypproc_maplist_2_svc (domainname *, struct svc_req *);
00279 extern int ypprog_2_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
00280 
00281 
00282 #define YPPUSH_XFRRESPPROG (0x40000000)
00283 #define YPPUSH_XFRRESPVERS 1
00284 
00285 #define YPPUSHPROC_NULL 0
00286 extern  void *yppushproc_null_1 (void *, CLIENT *);
00287 extern  void *yppushproc_null_1_svc (void *, struct svc_req *);
00288 #define YPPUSHPROC_XFRRESP 1
00289 extern  void *yppushproc_xfrresp_1 (yppushresp_xfr *, CLIENT *);
00290 extern  void *yppushproc_xfrresp_1_svc (yppushresp_xfr *, struct svc_req *);
00291 extern int yppush_xfrrespprog_1_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
00292 
00293 
00294 #define YPBINDPROG 100007
00295 #define YPBINDVERS 2
00296 
00297 #define YPBINDPROC_NULL 0
00298 extern  void *ypbindproc_null_2 (void *, CLIENT *);
00299 extern  void *ypbindproc_null_2_svc (void *, struct svc_req *);
00300 #define YPBINDPROC_DOMAIN 1
00301 extern  ypbind_resp *ypbindproc_domain_2 (domainname *, CLIENT *);
00302 extern  ypbind_resp *ypbindproc_domain_2_svc (domainname *, struct svc_req *);
00303 #define YPBINDPROC_SETDOM 2
00304 extern  void *ypbindproc_setdom_2 (ypbind_setdom *, CLIENT *);
00305 extern  void *ypbindproc_setdom_2_svc (ypbind_setdom *, struct svc_req *);
00306 extern int ypbindprog_2_freeresult (SVCXPRT *, xdrproc_t, caddr_t);
00307 
00308 
00309 extern  bool_t xdr_ypstat (XDR *, ypstat*);
00310 extern  bool_t xdr_ypxfrstat (XDR *, ypxfrstat*);
00311 extern  bool_t xdr_domainname (XDR *, domainname*);
00312 extern  bool_t xdr_mapname (XDR *, mapname*);
00313 extern  bool_t xdr_peername (XDR *, peername*);
00314 extern  bool_t xdr_keydat (XDR *, keydat*);
00315 extern  bool_t xdr_valdat (XDR *, valdat*);
00316 extern  bool_t xdr_ypmap_parms (XDR *, ypmap_parms*);
00317 extern  bool_t xdr_ypreq_key (XDR *, ypreq_key*);
00318 extern  bool_t xdr_ypreq_nokey (XDR *, ypreq_nokey*);
00319 extern  bool_t xdr_ypreq_xfr (XDR *, ypreq_xfr*);
00320 extern  bool_t xdr_ypresp_val (XDR *, ypresp_val*);
00321 extern  bool_t xdr_ypresp_key_val (XDR *, ypresp_key_val*);
00322 extern  bool_t xdr_ypresp_master (XDR *, ypresp_master*);
00323 extern  bool_t xdr_ypresp_order (XDR *, ypresp_order*);
00324 extern  bool_t xdr_ypresp_all (XDR *, ypresp_all*);
00325 extern  bool_t xdr_ypresp_xfr (XDR *, ypresp_xfr*);
00326 extern  bool_t xdr_ypmaplist (XDR *, ypmaplist*);
00327 extern  bool_t xdr_ypresp_maplist (XDR *, ypresp_maplist*);
00328 extern  bool_t xdr_yppush_status (XDR *, yppush_status*);
00329 extern  bool_t xdr_yppushresp_xfr (XDR *, yppushresp_xfr*);
00330 extern  bool_t xdr_ypbind_resptype (XDR *, ypbind_resptype*);
00331 extern  bool_t xdr_ypbind_binding (XDR *, ypbind_binding*);
00332 extern  bool_t xdr_ypbind_resp (XDR *, ypbind_resp*);
00333 extern  bool_t xdr_ypbind_setdom (XDR *, ypbind_setdom*);
00334 
00335 __END_DECLS
00336 
00337 #endif /* !__RPCSVC_YP_H__ */