Back to home page

EIC code displayed by LXR

 
 

    


Warning, /include/rpcsvc/yp.x is written in an unsupported language. File is not indexed.

0001 /* @(#)yp.x     2.1 88/08/01 4.0 RPCSRC */
0002 
0003 /*
0004  * Copyright (c) 2010 Oracle America, Inc.
0005  *
0006  * Redistribution and use in source and binary forms, with or without
0007  * modification, are permitted provided that the following conditions are
0008  * met:
0009  *
0010  *     * Redistributions of source code must retain the above copyright
0011  *       notice, this list of conditions and the following disclaimer.
0012  *     * Redistributions in binary form must reproduce the above
0013  *       copyright notice, this list of conditions and the following
0014  *       disclaimer in the documentation and/or other materials
0015  *       provided with the distribution.
0016  *     * Neither the name of the "Oracle America, Inc." nor the names of its
0017  *       contributors may be used to endorse or promote products derived
0018  *       from this software without specific prior written permission.
0019  *
0020  *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
0021  *   "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
0022  *   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
0023  *   FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
0024  *   COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
0025  *   INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
0026  *   DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
0027  *   GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
0028  *   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
0029  *   WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
0030  *   NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
0031  *   OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
0032  */
0033 
0034 /*
0035  * Protocol description file for the Yellow Pages Service
0036  */
0037 
0038 const YPMAXRECORD = 1024;
0039 const YPMAXDOMAIN = 256;
0040 const YPMAXMAP = 64;
0041 const YPMAXPEER = 64;
0042 
0043 
0044 enum ypstat {
0045         YP_TRUE         =  1,
0046         YP_NOMORE       =  2,
0047         YP_FALSE        =  0,
0048         YP_NOMAP        = -1,
0049         YP_NODOM        = -2,
0050         YP_NOKEY        = -3,
0051         YP_BADOP        = -4,
0052         YP_BADDB        = -5,
0053         YP_YPERR        = -6,
0054         YP_BADARGS      = -7,
0055         YP_VERS         = -8
0056 };
0057 
0058 
0059 enum ypxfrstat {
0060         YPXFR_SUCC      =  1,
0061         YPXFR_AGE       =  2,
0062         YPXFR_NOMAP     = -1,
0063         YPXFR_NODOM     = -2,
0064         YPXFR_RSRC      = -3,
0065         YPXFR_RPC       = -4,
0066         YPXFR_MADDR     = -5,
0067         YPXFR_YPERR     = -6,
0068         YPXFR_BADARGS   = -7,
0069         YPXFR_DBM       = -8,
0070         YPXFR_FILE      = -9,
0071         YPXFR_SKEW      = -10,
0072         YPXFR_CLEAR     = -11,
0073         YPXFR_FORCE     = -12,
0074         YPXFR_XFRERR    = -13,
0075         YPXFR_REFUSED   = -14
0076 };
0077 
0078 
0079 typedef string domainname<YPMAXDOMAIN>;
0080 typedef string mapname<YPMAXMAP>;
0081 typedef string peername<YPMAXPEER>;
0082 typedef opaque keydat<YPMAXRECORD>;
0083 typedef opaque valdat<YPMAXRECORD>;
0084 
0085 
0086 struct ypmap_parms {
0087         domainname domain;
0088         mapname map;
0089         unsigned int ordernum;
0090         peername peer;
0091 };
0092 
0093 struct ypreq_key {
0094         domainname domain;
0095         mapname map;
0096         keydat key;
0097 };
0098 
0099 struct ypreq_nokey {
0100         domainname domain;
0101         mapname map;
0102 };
0103 
0104 struct ypreq_xfr {
0105         ypmap_parms map_parms;
0106         unsigned int transid;
0107         unsigned int prog;
0108         unsigned int port;
0109 };
0110 
0111 
0112 struct ypresp_val {
0113         ypstat stat;
0114         valdat val;
0115 };
0116 
0117 struct ypresp_key_val {
0118         ypstat stat;
0119 #ifdef STUPID_SUN_BUG
0120         /* This is the form as distributed by Sun.  But even the Sun NIS
0121            servers expect the values in the other order.  So their
0122            implementation somehow must change the order internally.  We
0123            don't want to follow this bad example since the user should be
0124            able to use rpcgen on this file.  */
0125         keydat key;
0126         valdat val;
0127 #else
0128         valdat val;
0129         keydat key;
0130 #endif
0131 };
0132 
0133 
0134 struct ypresp_master {
0135         ypstat stat;
0136         peername peer;
0137 };
0138 
0139 struct ypresp_order {
0140         ypstat stat;
0141         unsigned int ordernum;
0142 };
0143 
0144 union ypresp_all switch (bool more) {
0145 case TRUE:
0146         ypresp_key_val val;
0147 case FALSE:
0148         void;
0149 };
0150 
0151 struct ypresp_xfr {
0152         unsigned int transid;
0153         ypxfrstat xfrstat;
0154 };
0155 
0156 struct ypmaplist {
0157         mapname map;
0158         ypmaplist *next;
0159 };
0160 
0161 struct ypresp_maplist {
0162         ypstat stat;
0163         ypmaplist *maps;
0164 };
0165 
0166 enum yppush_status {
0167         YPPUSH_SUCC     =  1,   /* Success */
0168         YPPUSH_AGE      =  2,   /* Master's version not newer */
0169         YPPUSH_NOMAP    = -1,   /* Can't find server for map */
0170         YPPUSH_NODOM    = -2,   /* Domain not supported */
0171         YPPUSH_RSRC     = -3,   /* Local resource alloc failure */
0172         YPPUSH_RPC      = -4,   /* RPC failure talking to server */
0173         YPPUSH_MADDR    = -5,   /* Can't get master address */
0174         YPPUSH_YPERR    = -6,   /* YP server/map db error */
0175         YPPUSH_BADARGS  = -7,   /* Request arguments bad */
0176         YPPUSH_DBM      = -8,   /* Local dbm operation failed */
0177         YPPUSH_FILE     = -9,   /* Local file I/O operation failed */
0178         YPPUSH_SKEW     = -10,  /* Map version skew during transfer */
0179         YPPUSH_CLEAR    = -11,  /* Can't send "Clear" req to local ypserv */
0180         YPPUSH_FORCE    = -12,  /* No local order number in map  use -f flag. */
0181         YPPUSH_XFRERR   = -13,  /* ypxfr error */
0182         YPPUSH_REFUSED  = -14   /* Transfer request refused by ypserv */
0183 };
0184 
0185 struct yppushresp_xfr {
0186         unsigned transid;
0187         yppush_status status;
0188 };
0189 
0190 /*
0191  * Response structure and overall result status codes.  Success and failure
0192  * represent two separate response message types.
0193  */
0194 
0195 enum ypbind_resptype {
0196         YPBIND_SUCC_VAL = 1,
0197         YPBIND_FAIL_VAL = 2
0198 };
0199 
0200 struct ypbind_binding {
0201     opaque ypbind_binding_addr[4]; /* In network order */
0202     opaque ypbind_binding_port[2]; /* In network order */
0203 };
0204 
0205 union ypbind_resp switch (ypbind_resptype ypbind_status) {
0206 case YPBIND_FAIL_VAL:
0207         unsigned ypbind_error;
0208 case YPBIND_SUCC_VAL:
0209         ypbind_binding ypbind_bindinfo;
0210 };
0211 
0212 /* Detailed failure reason codes for response field ypbind_error*/
0213 
0214 const YPBIND_ERR_ERR    = 1;    /* Internal error */
0215 const YPBIND_ERR_NOSERV = 2;    /* No bound server for passed domain */
0216 const YPBIND_ERR_RESC   = 3;    /* System resource allocation failure */
0217 
0218 
0219 /*
0220  * Request data structure for ypbind "Set domain" procedure.
0221  */
0222 struct ypbind_setdom {
0223         domainname ypsetdom_domain;
0224         ypbind_binding ypsetdom_binding;
0225         unsigned ypsetdom_vers;
0226 };
0227 
0228 
0229 /*
0230  * YP access protocol
0231  */
0232 program YPPROG {
0233         version YPVERS {
0234                 void
0235                 YPPROC_NULL(void) = 0;
0236 
0237                 bool
0238                 YPPROC_DOMAIN(domainname) = 1;
0239 
0240                 bool
0241                 YPPROC_DOMAIN_NONACK(domainname) = 2;
0242 
0243                 ypresp_val
0244                 YPPROC_MATCH(ypreq_key) = 3;
0245 
0246                 ypresp_key_val
0247                 YPPROC_FIRST(ypreq_key) = 4;
0248 
0249                 ypresp_key_val
0250                 YPPROC_NEXT(ypreq_key) = 5;
0251 
0252                 ypresp_xfr
0253                 YPPROC_XFR(ypreq_xfr) = 6;
0254 
0255                 void
0256                 YPPROC_CLEAR(void) = 7;
0257 
0258                 ypresp_all
0259                 YPPROC_ALL(ypreq_nokey) = 8;
0260 
0261                 ypresp_master
0262                 YPPROC_MASTER(ypreq_nokey) = 9;
0263 
0264                 ypresp_order
0265                 YPPROC_ORDER(ypreq_nokey) = 10;
0266 
0267                 ypresp_maplist
0268                 YPPROC_MAPLIST(domainname) = 11;
0269         } = 2;
0270 } = 100004;
0271 
0272 
0273 /*
0274  * YPPUSHPROC_XFRRESP is the callback routine for result of YPPROC_XFR
0275  */
0276 program YPPUSH_XFRRESPPROG {
0277         version YPPUSH_XFRRESPVERS {
0278                 void
0279                 YPPUSHPROC_NULL(void) = 0;
0280 
0281 #ifdef STUPID_SUN_BUG
0282                 /* This is the form as distributed by Sun.
0283                    But this is not what the programs use. */
0284                 yppushresp_xfr
0285                 YPPUSHPROC_XFRRESP(void) = 1;
0286 #else
0287                 void
0288                 YPPUSHPROC_XFRRESP(yppushresp_xfr) = 1;
0289 #endif
0290         } = 1;
0291 } = 0x40000000; /* transient: could be anything up to 0x5fffffff */
0292 
0293 /*
0294  * YP binding protocol
0295  */
0296 program YPBINDPROG {
0297         version YPBINDVERS {
0298                 void
0299                 YPBINDPROC_NULL(void) = 0;
0300 
0301                 ypbind_resp
0302                 YPBINDPROC_DOMAIN(domainname) = 1;
0303 
0304                 void
0305                 YPBINDPROC_SETDOM(ypbind_setdom) = 2;
0306         } = 2;
0307 } = 100007;