Changeset df49c60 in rtems for cpukit/librpc/include/rpcsvc


Ignore:
Timestamp:
Jun 12, 2000, 3:00:15 PM (21 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Branches:
4.10, 4.11, 4.8, 4.9, 5, master
Children:
edeed26
Parents:
0ab65474
Message:

Merged from 4.5.0-beta3a

Location:
cpukit/librpc/include/rpcsvc
Files:
30 edited

Legend:

Unmodified
Added
Removed
  • cpukit/librpc/include/rpcsvc/.cvsignore

    r0ab65474 rdf49c60  
     1Makefile
     2Makefile.in
  • cpukit/librpc/include/rpcsvc/Makefile.am

    r0ab65474 rdf49c60  
     1## $Id$
     2
     3AUTOMAKE_OPTIONS = foreign 1.4
     4
     5## Currently unused
     6
     7EXTRA_DIST = bootparam_prot.x crypt.x key_prot.x klm_prot.x mount.x \
     8    nfs_prot.x nis.x nis_cache.x nis_callback.x nis_db.h nis_object.x \
     9    nis_tags.h nislib.h nlm_prot.x pmap_prot.x rex.x rnusers.x rquota.x \
     10    rstat.x rwall.x sm_inter.x spray.x yp.x yp_prot.h ypclnt.h yppasswd.x \
     11    ypupdate_prot.x ypxfrd.x
     12
     13include $(top_srcdir)/../../../automake/local.am
  • cpukit/librpc/include/rpcsvc/bootparam_prot.x

    r0ab65474 rdf49c60  
     1/*
     2 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
     3 * unrestricted use provided that this legend is included on all tape
     4 * media and as a part of the software program in whole or part.  Users
     5 * may copy or modify Sun RPC without charge, but are not authorized
     6 * to license or distribute it to anyone else except as part of a product or
     7 * program developed by the user.
     8 *
     9 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
     10 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
     11 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
     12 *
     13 * Sun RPC is provided with no support and without any obligation on the
     14 * part of Sun Microsystems, Inc. to assist in its use, correction,
     15 * modification or enhancement.
     16 *
     17 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
     18 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
     19 * OR ANY PART THEREOF.
     20 *
     21 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
     22 * or profits or other special, indirect and consequential damages, even if
     23 * Sun has been advised of the possibility of such damages.
     24 *
     25 * Sun Microsystems, Inc.
     26 * 2550 Garcia Avenue
     27 * Mountain View, California  94043
     28 */
     29
     30/*
     31 * RPC for bootparms service.
     32 * There are two procedures:
     33 *   WHOAMI takes a net address and returns a client name and also a
     34 *      likely net address for routing
     35 *   GETFILE takes a client name and file identifier and returns the
     36 *      server name, server net address and pathname for the file.
     37 *   file identifiers typically include root, swap, pub and dump
     38 */
     39
     40#ifdef RPC_HDR
     41%#include <rpc/types.h>
     42%#include <sys/time.h>
     43%#include <sys/errno.h>
     44%#include <sys/param.h>
     45%#include <sys/syslimits.h>
     46%#include <sys/ucred.h>
     47#else
     48%#ifndef lint
     49%/*static char sccsid[] = "from: @(#)bootparam_prot.x 1.2 87/06/24 Copyr 1987 Sun Micro";*/
     50%/*static char sccsid[] = "from: @(#)bootparam_prot.x   2.1 88/08/01 4.0 RPCSRC";*/
     51%static const char rcsid[] =
     52%  "$FreeBSD: src/include/rpcsvc/bootparam_prot.x,v 1.5 1999/08/27 23:45:07 peter Exp $";
     53%#endif /* not lint */
     54#endif
     55
     56const MAX_MACHINE_NAME  = 255;
     57const MAX_PATH_LEN      = 1024;
     58const MAX_FILEID        = 32;
     59const IP_ADDR_TYPE      = 1;
     60
     61typedef string  bp_machine_name_t<MAX_MACHINE_NAME>;
     62typedef string  bp_path_t<MAX_PATH_LEN>;
     63typedef string  bp_fileid_t<MAX_FILEID>;
     64
     65struct  ip_addr_t {
     66        char    net;
     67        char    host;
     68        char    lh;
     69        char    impno;
     70};
     71
     72union bp_address switch (int address_type) {
     73        case IP_ADDR_TYPE:
     74                ip_addr_t       ip_addr;
     75};
     76
     77struct bp_whoami_arg {
     78        bp_address              client_address;
     79};
     80
     81struct bp_whoami_res {
     82        bp_machine_name_t       client_name;
     83        bp_machine_name_t       domain_name;
     84        bp_address              router_address;
     85};
     86
     87struct bp_getfile_arg {
     88        bp_machine_name_t       client_name;
     89        bp_fileid_t             file_id;
     90};
     91       
     92struct bp_getfile_res {
     93        bp_machine_name_t       server_name;
     94        bp_address              server_address;
     95        bp_path_t               server_path;
     96};
     97
     98program BOOTPARAMPROG {
     99        version BOOTPARAMVERS {
     100                bp_whoami_res   BOOTPARAMPROC_WHOAMI(bp_whoami_arg) = 1;
     101                bp_getfile_res  BOOTPARAMPROC_GETFILE(bp_getfile_arg) = 2;
     102        } = 1;
     103} = 100026;
  • cpukit/librpc/include/rpcsvc/crypt.x

    r0ab65474 rdf49c60  
     1/*
     2 * Copyright (c) 1996
     3 *      Bill Paul <wpaul@ctr.columbia.edu>.  All rights reserved.
     4 *
     5 * Redistribution and use in source and binary forms, with or without
     6 * modification, are permitted provided that the following conditions
     7 * are met:
     8 * 1. Redistributions of source code must retain the above copyright
     9 *    notice, this list of conditions and the following disclaimer.
     10 * 2. Redistributions in binary form must reproduce the above copyright
     11 *    notice, this list of conditions and the following disclaimer in the
     12 *    documentation and/or other materials provided with the distribution.
     13 * 3. All advertising materials mentioning features or use of this software
     14 *    must display the following acknowledgement:
     15 *      This product includes software developed by Bill Paul.
     16 * 4. Neither the name of the author nor the names of any co-contributors
     17 *    may be used to endorse or promote products derived from this software
     18 *    without specific prior written permission.
     19 *
     20 * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
     21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     23 * ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul OR CONTRIBUTORS BE LIABLE
     24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     30 * SUCH DAMAGE.
     31 *
     32 * $FreeBSD: src/include/rpcsvc/crypt.x,v 1.3 1999/08/27 23:45:08 peter Exp $
     33 */
     34
     35#ifndef RPC_HDR
     36%#ifndef lint
     37%static const char rcsid[] =
     38%  "$FreeBSD: src/include/rpcsvc/crypt.x,v 1.3 1999/08/27 23:45:08 peter Exp $";
     39%#endif
     40#endif
     41
     42/*
     43 * This protocol definition exists because of the U.S. government and
     44 * its stupid export laws. We can't export DES code from the United
     45 * States to other countries (even though the code already exists
     46 * outside the U.S. -- go figure that one out) but we need to make
     47 * Secure RPC work. The normal way around this is to break the DES
     48 * code out into a shared library; we can then provide a dummy lib
     49 * in the base OS and provide the real lib in the secure dist, which
     50 * the user can install later. But we need Secure RPC for NIS+, and
     51 * there are several system programs that use NIS+ which are statically
     52 * linked. We would have to provide replacements for these programs
     53 * in the secure dist, but there are a lot, and this is a pain. The
     54 * shared lib trick won't work for these programs, and we can't change
     55 * them once they're compiled.
     56 *
     57 * One solution for this problem is to do the DES encryption as a system
     58 * call; no programs need to be changed and we can even supply the DES
     59 * support as an LKM. But this bloats the kernel. Maybe if we have
     60 * Secure NFS one day this will be worth it, but for now we should keep
     61 * this mess in user space.
     62 *
     63 * So we have this second solution: we provide a server that does the
     64 * DES encryption for us. In this case, the server is keyserv (we need
     65 * it to make Secure RPC work anyway) and we use this protocol to ship
     66 * the data back and forth between keyserv and the application.
     67 */
     68
     69enum des_dir { ENCRYPT_DES, DECRYPT_DES };
     70enum des_mode { CBC_DES, ECB_DES };
     71
     72struct desargs {
     73        u_char des_key[8];      /* key (with low bit parity) */
     74        des_dir des_dir;        /* direction */
     75        des_mode des_mode;      /* mode */
     76        u_char des_ivec[8];     /* input vector */
     77        opaque desbuf<>;
     78};
     79
     80struct desresp {
     81        opaque desbuf<>;
     82        u_char des_ivec[8];
     83        int stat;
     84};
     85
     86program CRYPT_PROG {
     87        version CRYPT_VERS {
     88                desresp
     89                DES_CRYPT(desargs) = 1;
     90        } = 1;
     91} = 600100029;
  • cpukit/librpc/include/rpcsvc/key_prot.x

    r0ab65474 rdf49c60  
     1%/*
     2% * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
     3% * unrestricted use provided that this legend is included on all tape
     4% * media and as a part of the software program in whole or part.  Users
     5% * may copy or modify Sun RPC without charge, but are not authorized
     6% * to license or distribute it to anyone else except as part of a product or
     7% * program developed by the user.
     8% *
     9% * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
     10% * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
     11% * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
     12% *
     13% * Sun RPC is provided with no support and without any obligation on the
     14% * part of Sun Microsystems, Inc. to assist in its use, correction,
     15% * modification or enhancement.
     16% *
     17% * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
     18% * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
     19% * OR ANY PART THEREOF.
     20% *
     21% * In no event will Sun Microsystems, Inc. be liable for any lost revenue
     22% * or profits or other special, indirect and consequential damages, even if
     23% * Sun has been advised of the possibility of such damages.
     24% *
     25% * Sun Microsystems, Inc.
     26% * 2550 Garcia Avenue
     27% * Mountain View, California  94043
     28% */
     29/*
     30 * Key server protocol definition
     31 * Copyright (C) 1990, 1991 Sun Microsystems, Inc.
     32 *
     33 * The keyserver is a public key storage/encryption/decryption service
     34 * The encryption method used is based on the Diffie-Hellman exponential
     35 * key exchange technology.
     36 *
     37 * The key server is local to each machine, akin to the portmapper.
     38 * Under TI-RPC, communication with the keyserver is through the
     39 * loopback transport.
     40 *
     41 * NOTE: This .x file generates the USER level headers for the keyserver.
     42 * the KERNEL level headers are created by hand as they kernel has special
     43 * requirements.
     44 */
     45
     46%/* From: #pragma ident "@(#)key_prot.x 1.7     94/04/29 SMI" */
     47%
     48%/* Copyright (c)  1990, 1991 Sun Microsystems, Inc. */
     49%
     50%/*
     51% * Compiled from key_prot.x using rpcgen.
     52% * DO NOT EDIT THIS FILE!
     53% * This is NOT source code!
     54% */
     55
     56/*
     57 * PROOT and MODULUS define the way the Diffie-Hellman key is generated.
     58 *
     59 * MODULUS should be chosen as a prime of the form: MODULUS == 2*p + 1,
     60 * where p is also prime.
     61 *
     62 * PROOT satisfies the following two conditions:
     63 * (1) (PROOT ** 2) % MODULUS != 1
     64 * (2) (PROOT ** p) % MODULUS != 1
     65 *
     66 */
     67
     68const PROOT = 3;
     69const HEXMODULUS = "d4a0ba0250b6fd2ec626e7efd637df76c716e22d0944b88b";
     70
     71const HEXKEYBYTES = 48;         /* HEXKEYBYTES == strlen(HEXMODULUS) */
     72const KEYSIZE = 192;            /* KEYSIZE == bit length of key */
     73const KEYBYTES = 24;            /* byte length of key */
     74
     75/*
     76 * The first 16 hex digits of the encrypted secret key are used as
     77 * a checksum in the database.
     78 */
     79const KEYCHECKSUMSIZE = 16;
     80
     81/*
     82 * status of operation
     83 */
     84enum keystatus {
     85        KEY_SUCCESS,    /* no problems */
     86        KEY_NOSECRET,   /* no secret key stored */
     87        KEY_UNKNOWN,    /* unknown netname */
     88        KEY_SYSTEMERR   /* system error (out of memory, encryption failure) */
     89};
     90
     91typedef opaque keybuf[HEXKEYBYTES];     /* store key in hex */
     92
     93typedef string netnamestr<MAXNETNAMELEN>;
     94
     95/*
     96 * Argument to ENCRYPT or DECRYPT
     97 */
     98struct cryptkeyarg {
     99        netnamestr remotename;
     100        des_block deskey;
     101};
     102
     103/*
     104 * Argument to ENCRYPT_PK or DECRYPT_PK
     105 */
     106struct cryptkeyarg2 {
     107        netnamestr remotename;
     108        netobj  remotekey;      /* Contains a length up to 1024 bytes */
     109        des_block deskey;
     110};
     111
     112
     113/*
     114 * Result of ENCRYPT, DECRYPT, ENCRYPT_PK, and DECRYPT_PK
     115 */
     116union cryptkeyres switch (keystatus status) {
     117case KEY_SUCCESS:
     118        des_block deskey;
     119default:
     120        void;
     121};
     122
     123const MAXGIDS  = 16;    /* max number of gids in gid list */
     124
     125/*
     126 * Unix credential
     127 */     
     128struct unixcred {
     129        u_int uid;
     130        u_int gid;
     131        u_int gids<MAXGIDS>;   
     132};
     133
     134/*
     135 * Result returned from GETCRED
     136 */
     137union getcredres switch (keystatus status) {
     138case KEY_SUCCESS:
     139        unixcred cred;
     140default:
     141        void;
     142};
     143/*
     144 * key_netstarg;
     145 */
     146
     147struct key_netstarg {
     148        keybuf st_priv_key;
     149        keybuf st_pub_key;
     150        netnamestr st_netname;
     151};
     152
     153union key_netstres switch (keystatus status){
     154case KEY_SUCCESS:
     155        key_netstarg knet;
     156default:
     157        void;
     158};     
     159
     160#ifdef RPC_HDR
     161%
     162%#ifndef opaque
     163%#define opaque char
     164%#endif
     165%
     166#endif
     167program KEY_PROG {
     168        version KEY_VERS {
     169
     170                /*
     171                 * This is my secret key.
     172                 * Store it for me.
     173                 */
     174                keystatus
     175                KEY_SET(keybuf) = 1;   
     176       
     177                /*
     178                 * I want to talk to X.
     179                 * Encrypt a conversation key for me.
     180                 */
     181                cryptkeyres
     182                KEY_ENCRYPT(cryptkeyarg) = 2;   
     183
     184                /*
     185                 * X just sent me a message.
     186                 * Decrypt the conversation key for me.
     187                 */
     188                cryptkeyres
     189                KEY_DECRYPT(cryptkeyarg) = 3;
     190
     191                /*
     192                 * Generate a secure conversation key for me
     193                 */
     194                des_block
     195                KEY_GEN(void) = 4;
     196
     197                /*
     198                 * Get me the uid, gid and group-access-list associated
     199                 * with this netname (for kernel which cannot use NIS)
     200                 */
     201                getcredres
     202                KEY_GETCRED(netnamestr) = 5;
     203        } = 1;
     204        version KEY_VERS2 {
     205
     206                /*
     207                 * #######
     208                 * Procedures 1-5 are identical to version 1
     209                 * #######
     210                 */
     211
     212                /*
     213                 * This is my secret key.
     214                 * Store it for me.
     215                 */
     216                keystatus
     217                KEY_SET(keybuf) = 1;   
     218       
     219                /*
     220                 * I want to talk to X.
     221                 * Encrypt a conversation key for me.
     222                 */
     223                cryptkeyres
     224                KEY_ENCRYPT(cryptkeyarg) = 2;   
     225
     226                /*
     227                 * X just sent me a message.
     228                 * Decrypt the conversation key for me.
     229                 */
     230                cryptkeyres
     231                KEY_DECRYPT(cryptkeyarg) = 3;
     232
     233                /*
     234                 * Generate a secure conversation key for me
     235                 */
     236                des_block
     237                KEY_GEN(void) = 4;
     238
     239                /*
     240                 * Get me the uid, gid and group-access-list associated
     241                 * with this netname (for kernel which cannot use NIS)
     242                 */
     243                getcredres
     244                KEY_GETCRED(netnamestr) = 5;
     245               
     246                /*
     247                 * I want to talk to X. and I know X's public key
     248                 * Encrypt a conversation key for me.
     249                 */
     250                cryptkeyres
     251                KEY_ENCRYPT_PK(cryptkeyarg2) = 6;       
     252
     253                /*
     254                 * X just sent me a message. and I know X's public key
     255                 * Decrypt the conversation key for me.
     256                 */
     257                cryptkeyres
     258                KEY_DECRYPT_PK(cryptkeyarg2) = 7;
     259               
     260                /*
     261                 * Store my public key, netname and private key.
     262                 */
     263                keystatus
     264                KEY_NET_PUT(key_netstarg) = 8;
     265               
     266                /*
     267                 * Retrieve my public key, netname and private key.
     268                 */
     269                key_netstres
     270                KEY_NET_GET(void) = 9;
     271               
     272                /*
     273                 * Return me the conversation key that is constructed
     274                 * from my secret key and this publickey.
     275                 */
     276
     277                cryptkeyres
     278                KEY_GET_CONV(keybuf) = 10;
     279
     280               
     281        } = 2;
     282} = 100029;
     283
     284
  • cpukit/librpc/include/rpcsvc/klm_prot.x

    r0ab65474 rdf49c60  
     1/*
     2 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
     3 * unrestricted use provided that this legend is included on all tape
     4 * media and as a part of the software program in whole or part.  Users
     5 * may copy or modify Sun RPC without charge, but are not authorized
     6 * to license or distribute it to anyone else except as part of a product or
     7 * program developed by the user.
     8 *
     9 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
     10 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
     11 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
     12 *
     13 * Sun RPC is provided with no support and without any obligation on the
     14 * part of Sun Microsystems, Inc. to assist in its use, correction,
     15 * modification or enhancement.
     16 *
     17 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
     18 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
     19 * OR ANY PART THEREOF.
     20 *
     21 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
     22 * or profits or other special, indirect and consequential damages, even if
     23 * Sun has been advised of the possibility of such damages.
     24 *
     25 * Sun Microsystems, Inc.
     26 * 2550 Garcia Avenue
     27 * Mountain View, California  94043
     28 */
     29
     30/*
     31 * Kernel/lock manager protocol definition
     32 * Copyright (C) 1986 Sun Microsystems, Inc.
     33 *
     34 * protocol used between the UNIX kernel (the "client") and the
     35 * local lock manager.  The local lock manager is a deamon running
     36 * above the kernel.
     37 */
     38
     39#ifndef RPC_HDR
     40%#ifndef lint
     41%/*static char sccsid[] = "from: @(#)klm_prot.x 1.7 87/07/08 Copyr 1987 Sun Micro";*/
     42%/*static char sccsid[] = "from: @(#)klm_prot.x 2.1 88/08/01 4.0 RPCSRC";*/
     43%static const char rcsid[] =
     44%  "$FreeBSD: src/include/rpcsvc/klm_prot.x,v 1.6 1999/08/27 23:45:08 peter Exp $";
     45%#endif /* not lint */
     46#endif
     47
     48const   LM_MAXSTRLEN = 1024;
     49
     50/*
     51 * lock manager status returns
     52 */
     53enum klm_stats {
     54        klm_granted = 0,        /* lock is granted */
     55        klm_denied = 1,         /* lock is denied */
     56        klm_denied_nolocks = 2, /* no lock entry available */
     57        klm_working = 3         /* lock is being processed */
     58};
     59
     60/*
     61 * lock manager lock identifier
     62 */
     63struct klm_lock {
     64        string server_name<LM_MAXSTRLEN>;
     65        netobj fh;              /* a counted file handle */
     66        int pid;                /* holder of the lock */
     67        unsigned l_offset;      /* beginning offset of the lock */
     68        unsigned l_len;         /* byte length of the lock;
     69                                 * zero means through end of file */
     70};
     71
     72/*
     73 * lock holder identifier
     74 */
     75struct klm_holder {
     76        bool exclusive;         /* FALSE if shared lock */
     77        int svid;               /* holder of the lock (pid) */
     78        unsigned l_offset;      /* beginning offset of the lock */
     79        unsigned l_len;         /* byte length of the lock;
     80                                 * zero means through end of file */
     81};
     82
     83/*
     84 * reply to KLM_LOCK / KLM_UNLOCK / KLM_CANCEL
     85 */
     86struct klm_stat {
     87        klm_stats stat;
     88};
     89
     90/*
     91 * reply to a KLM_TEST call
     92 */
     93union klm_testrply switch (klm_stats stat) {
     94        case klm_denied:
     95                struct klm_holder holder;
     96        default: /* All other cases return no arguments */
     97                void;
     98};
     99
     100
     101/*
     102 * arguments to KLM_LOCK
     103 */
     104struct klm_lockargs {
     105        bool block;
     106        bool exclusive;
     107        struct klm_lock alock;
     108};
     109
     110/*
     111 * arguments to KLM_TEST
     112 */
     113struct klm_testargs {
     114        bool exclusive;
     115        struct klm_lock alock;
     116};
     117
     118/*
     119 * arguments to KLM_UNLOCK
     120 */
     121struct klm_unlockargs {
     122        struct klm_lock alock;
     123};
     124
     125program KLM_PROG {
     126        version KLM_VERS {
     127
     128                klm_testrply    KLM_TEST (struct klm_testargs) =        1;
     129
     130                klm_stat        KLM_LOCK (struct klm_lockargs) =        2;
     131
     132                klm_stat        KLM_CANCEL (struct klm_lockargs) =      3;
     133                /* klm_granted=> the cancel request fails due to lock is already granted */
     134                /* klm_denied=> the cancel request successfully aborts
     135lock request  */
     136
     137                klm_stat        KLM_UNLOCK (struct klm_unlockargs) =    4;
     138        } = 1;
     139} = 100020;
  • cpukit/librpc/include/rpcsvc/mount.x

    r0ab65474 rdf49c60  
     1/*
     2 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
     3 * unrestricted use provided that this legend is included on all tape
     4 * media and as a part of the software program in whole or part.  Users
     5 * may copy or modify Sun RPC without charge, but are not authorized
     6 * to license or distribute it to anyone else except as part of a product or
     7 * program developed by the user.
     8 *
     9 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
     10 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
     11 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
     12 *
     13 * Sun RPC is provided with no support and without any obligation on the
     14 * part of Sun Microsystems, Inc. to assist in its use, correction,
     15 * modification or enhancement.
     16 *
     17 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
     18 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
     19 * OR ANY PART THEREOF.
     20 *
     21 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
     22 * or profits or other special, indirect and consequential damages, even if
     23 * Sun has been advised of the possibility of such damages.
     24 *
     25 * Sun Microsystems, Inc.
     26 * 2550 Garcia Avenue
     27 * Mountain View, California  94043
     28 */
     29
     30/*
     31 * Protocol description for the mount program
     32 */
     33
     34#ifndef RPC_HDR
     35%#ifndef lint
     36%/*static char sccsid[] = "from: @(#)mount.x 1.2 87/09/18 Copyr 1987 Sun Micro";*/
     37%/*static char sccsid[] = "from: @(#)mount.x    2.1 88/08/01 4.0 RPCSRC";*/
     38%static const char rcsid[] =
     39%  "$FreeBSD: src/include/rpcsvc/mount.x,v 1.6 1999/08/27 23:45:08 peter Exp $";
     40%#endif /* not lint */
     41#endif
     42
     43const MNTPATHLEN = 1024;        /* maximum bytes in a pathname argument */
     44const MNTNAMLEN = 255;          /* maximum bytes in a name argument */
     45const FHSIZE = 32;              /* size in bytes of a file handle */
     46#ifdef WANT_NFS3
     47const FHSIZE3 = 64;             /* size in bytes of a file handle (v3) */
     48#endif
     49
     50/*
     51 * The fhandle is the file handle that the server passes to the client.
     52 * All file operations are done using the file handles to refer to a file
     53 * or a directory. The file handle can contain whatever information the
     54 * server needs to distinguish an individual file.
     55 */
     56typedef opaque fhandle[FHSIZE];
     57#ifdef WANT_NFS3
     58typedef opaque fhandle3<FHSIZE3>;
     59#endif
     60
     61/*
     62 * If a status of zero is returned, the call completed successfully, and
     63 * a file handle for the directory follows. A non-zero status indicates
     64 * some sort of error. The status corresponds with UNIX error numbers.
     65 */
     66union fhstatus switch (unsigned fhs_status) {
     67case 0:
     68        fhandle fhs_fhandle;
     69default:
     70        void;
     71};
     72
     73#ifdef WANT_NFS3
     74/*
     75 * Status codes returned by the version 3 mount call.
     76 */
     77enum mountstat3 {
     78        MNT3_OK = 0,                 /* no error */
     79        MNT3ERR_PERM = 1,            /* Not owner */
     80        MNT3ERR_NOENT = 2,           /* No such file or directory */
     81        MNT3ERR_IO = 5,              /* I/O error */
     82        MNT3ERR_ACCES = 13,          /* Permission denied */
     83        MNT3ERR_NOTDIR = 20,         /* Not a directory */
     84        MNT3ERR_INVAL = 22,          /* Invalid argument */
     85        MNT3ERR_NAMETOOLONG = 63,    /* Filename too long */
     86        MNT3ERR_NOTSUPP = 10004,     /* Operation not supported */
     87        MNT3ERR_SERVERFAULT = 10006  /* A failure on the server */
     88};
     89
     90struct mountres3_ok {
     91        fhandle3        fhandle;
     92        int             auth_flavors<>;
     93};
     94
     95union mountres3 switch (mountstat3 fhs_status) {
     96case 0:
     97        mountres3_ok    mountinfo;
     98default:
     99        void;
     100};
     101#endif
     102
     103/*
     104 * The type dirpath is the pathname of a directory
     105 */
     106typedef string dirpath<MNTPATHLEN>;
     107
     108/*
     109 * The type name is used for arbitrary names (hostnames, groupnames)
     110 */
     111typedef string name<MNTNAMLEN>;
     112
     113/*
     114 * A list of who has what mounted
     115 */
     116typedef struct mountbody *mountlist;
     117struct mountbody {
     118        name ml_hostname;
     119        dirpath ml_directory;
     120        mountlist ml_next;
     121};
     122
     123/*
     124 * A list of netgroups
     125 */
     126typedef struct groupnode *groups;
     127struct groupnode {
     128        name gr_name;
     129        groups gr_next;
     130};
     131
     132/*
     133 * A list of what is exported and to whom
     134 */
     135typedef struct exportnode *exports;
     136struct exportnode {
     137        dirpath ex_dir;
     138        groups ex_groups;
     139        exports ex_next;
     140};
     141
     142program MOUNTPROG {
     143        /*
     144         * Version one of the mount protocol communicates with version two
     145         * of the NFS protocol. Version three communicates with
     146         * version three of the NFS protocol. The only connecting
     147         * point is the fhandle structure, which is the same for both
     148         * protocols.
     149         */
     150        version MOUNTVERS {
     151                /*
     152                 * Does no work. It is made available in all RPC services
     153                 * to allow server reponse testing and timing
     154                 */
     155                void
     156                MOUNTPROC_NULL(void) = 0;
     157
     158                /*     
     159                 * If fhs_status is 0, then fhs_fhandle contains the
     160                 * file handle for the directory. This file handle may
     161                 * be used in the NFS protocol. This procedure also adds
     162                 * a new entry to the mount list for this client mounting
     163                 * the directory.
     164                 * Unix authentication required.
     165                 */
     166                fhstatus
     167                MOUNTPROC_MNT(dirpath) = 1;
     168
     169                /*
     170                 * Returns the list of remotely mounted filesystems. The
     171                 * mountlist contains one entry for each hostname and
     172                 * directory pair.
     173                 */
     174                mountlist
     175                MOUNTPROC_DUMP(void) = 2;
     176
     177                /*
     178                 * Removes the mount list entry for the directory
     179                 * Unix authentication required.
     180                 */
     181                void
     182                MOUNTPROC_UMNT(dirpath) = 3;
     183
     184                /*
     185                 * Removes all of the mount list entries for this client
     186                 * Unix authentication required.
     187                 */
     188                void
     189                MOUNTPROC_UMNTALL(void) = 4;
     190
     191                /*
     192                 * Returns a list of all the exported filesystems, and which
     193                 * machines are allowed to import it.
     194                 */
     195                exports
     196                MOUNTPROC_EXPORT(void)  = 5;
     197
     198                /*
     199                 * Identical to MOUNTPROC_EXPORT above
     200                 */
     201                exports
     202                MOUNTPROC_EXPORTALL(void) = 6;
     203        } = 1;
     204#ifdef WANT_NFS3
     205        version MOUNTVERS3 {
     206                /*
     207                 * Does no work. It is made available in all RPC services
     208                 * to allow server reponse testing and timing
     209                 */
     210                void
     211                MOUNTPROC_NULL(void) = 0;
     212
     213                /*
     214                 * If mountres3.fhs_status is MNT3_OK, then
     215                 * mountres3.mountinfo contains the file handle for
     216                 * the directory and a list of acceptable
     217                 * authentication flavors.  This file handle may only
     218                 * be used in the NFS version 3 protocol.  This
     219                 * procedure also results in the server adding a new
     220                 * entry to its mount list recording that this client
     221                 * has mounted the directory. AUTH_UNIX authentication
     222                 * or better is required.
     223                 */
     224                mountres3
     225                MOUNTPROC_MNT(dirpath) = 1;
     226
     227                /*
     228                 * Returns the list of remotely mounted filesystems. The
     229                 * mountlist contains one entry for each hostname and
     230                 * directory pair.
     231                 */
     232                mountlist
     233                MOUNTPROC_DUMP(void) = 2;
     234
     235                /*
     236                 * Removes the mount list entry for the directory
     237                 * Unix authentication required.
     238                 */
     239                void
     240                MOUNTPROC_UMNT(dirpath) = 3;
     241
     242                /*
     243                 * Removes all of the mount list entries for this client
     244                 * Unix authentication required.
     245                 */
     246                void
     247                MOUNTPROC_UMNTALL(void) = 4;
     248
     249                /*
     250                 * Returns a list of all the exported filesystems, and which
     251                 * machines are allowed to import it.
     252                 */
     253                exports
     254                MOUNTPROC_EXPORT(void)  = 5;
     255        } = 3;
     256#endif
     257} = 100005;
  • cpukit/librpc/include/rpcsvc/nfs_prot.x

    r0ab65474 rdf49c60  
     1/*
     2 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
     3 * unrestricted use provided that this legend is included on all tape
     4 * media and as a part of the software program in whole or part.  Users
     5 * may copy or modify Sun RPC without charge, but are not authorized
     6 * to license or distribute it to anyone else except as part of a product or
     7 * program developed by the user.
     8 *
     9 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
     10 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
     11 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
     12 *
     13 * Sun RPC is provided with no support and without any obligation on the
     14 * part of Sun Microsystems, Inc. to assist in its use, correction,
     15 * modification or enhancement.
     16 *
     17 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
     18 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
     19 * OR ANY PART THEREOF.
     20 *
     21 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
     22 * or profits or other special, indirect and consequential damages, even if
     23 * Sun has been advised of the possibility of such damages.
     24 *
     25 * Sun Microsystems, Inc.
     26 * 2550 Garcia Avenue
     27 * Mountain View, California  94043
     28 */
     29
     30#ifndef RPC_HDR
     31%#ifndef lint
     32%/*static char sccsid[] = "from: @(#)nfs_prot.x 1.2 87/10/12 Copyr 1987 Sun Micro";*/
     33%/*static char sccsid[] = "from: @(#)nfs_prot.x 2.1 88/08/01 4.0 RPCSRC";*/
     34%static const char rcsid[] =
     35%  "$FreeBSD: src/include/rpcsvc/nfs_prot.x,v 1.7 1999/08/27 23:45:08 peter Exp $";
     36%#endif /* not lint */
     37#endif
     38
     39const NFS_PORT          = 2049;
     40const NFS_MAXDATA       = 8192;
     41const NFS_MAXPATHLEN    = 1024;
     42const NFS_MAXNAMLEN     = 255;
     43const NFS_FHSIZE        = 32;
     44const NFS_COOKIESIZE    = 4;
     45const NFS_FIFO_DEV      = -1;   /* size kludge for named pipes */
     46
     47/*
     48 * File types
     49 */
     50const NFSMODE_FMT  = 0170000;   /* type of file */
     51const NFSMODE_DIR  = 0040000;   /* directory */
     52const NFSMODE_CHR  = 0020000;   /* character special */
     53const NFSMODE_BLK  = 0060000;   /* block special */
     54const NFSMODE_REG  = 0100000;   /* regular */
     55const NFSMODE_LNK  = 0120000;   /* symbolic link */
     56const NFSMODE_SOCK = 0140000;   /* socket */
     57const NFSMODE_FIFO = 0010000;   /* fifo */
     58
     59/*
     60 * Error status
     61 */
     62enum nfsstat {
     63        NFS_OK= 0,              /* no error */
     64        NFSERR_PERM=1,          /* Not owner */
     65        NFSERR_NOENT=2,         /* No such file or directory */
     66        NFSERR_IO=5,            /* I/O error */
     67        NFSERR_NXIO=6,          /* No such device or address */
     68        NFSERR_ACCES=13,        /* Permission denied */
     69        NFSERR_EXIST=17,        /* File exists */
     70        NFSERR_NODEV=19,        /* No such device */
     71        NFSERR_NOTDIR=20,       /* Not a directory*/
     72        NFSERR_ISDIR=21,        /* Is a directory */
     73        NFSERR_FBIG=27,         /* File too large */
     74        NFSERR_NOSPC=28,        /* No space left on device */
     75        NFSERR_ROFS=30,         /* Read-only file system */
     76        NFSERR_NAMETOOLONG=63,  /* File name too long */
     77        NFSERR_NOTEMPTY=66,     /* Directory not empty */
     78        NFSERR_DQUOT=69,        /* Disc quota exceeded */
     79        NFSERR_STALE=70,        /* Stale NFS file handle */
     80        NFSERR_WFLUSH=99        /* write cache flushed */
     81};
     82
     83/*
     84 * File types
     85 */
     86enum ftype {
     87        NFNON = 0,      /* non-file */
     88        NFREG = 1,      /* regular file */
     89        NFDIR = 2,      /* directory */
     90        NFBLK = 3,      /* block special */
     91        NFCHR = 4,      /* character special */
     92        NFLNK = 5,      /* symbolic link */
     93        NFSOCK = 6,     /* unix domain sockets */
     94        NFBAD = 7,      /* unused */
     95        NFFIFO = 8      /* named pipe */
     96};
     97
     98/*
     99 * File access handle
     100 */
     101struct nfs_fh {
     102        opaque data[NFS_FHSIZE];
     103};
     104
     105/*
     106 * Timeval
     107 */
     108struct nfstime {
     109        unsigned seconds;
     110        unsigned useconds;
     111};
     112
     113
     114/*
     115 * File attributes
     116 */
     117struct fattr {
     118        ftype type;             /* file type */
     119        unsigned mode;          /* protection mode bits */
     120        unsigned nlink;         /* # hard links */
     121        unsigned uid;           /* owner user id */
     122        unsigned gid;           /* owner group id */
     123        unsigned size;          /* file size in bytes */
     124        unsigned blocksize;     /* prefered block size */
     125        unsigned rdev;          /* special device # */
     126        unsigned blocks;        /* Kb of disk used by file */
     127        unsigned fsid;          /* device # */
     128        unsigned fileid;        /* inode # */
     129        nfstime atime;          /* time of last access */
     130        nfstime mtime;          /* time of last modification */
     131        nfstime ctime;          /* time of last change */
     132};
     133
     134/*
     135 * File attributes which can be set
     136 */
     137struct sattr {
     138        unsigned mode;  /* protection mode bits */
     139        unsigned uid;   /* owner user id */
     140        unsigned gid;   /* owner group id */
     141        unsigned size;  /* file size in bytes */
     142        nfstime atime;  /* time of last access */
     143        nfstime mtime;  /* time of last modification */
     144};
     145
     146
     147typedef string filename<NFS_MAXNAMLEN>;
     148typedef string nfspath<NFS_MAXPATHLEN>;
     149
     150/*
     151 * Reply status with file attributes
     152 */
     153union attrstat switch (nfsstat status) {
     154case NFS_OK:
     155        fattr attributes;
     156default:
     157        void;
     158};
     159
     160struct sattrargs {
     161        nfs_fh file;
     162        sattr attributes;
     163};
     164
     165/*
     166 * Arguments for directory operations
     167 */
     168struct diropargs {
     169        nfs_fh  dir;    /* directory file handle */
     170        filename name;          /* name (up to NFS_MAXNAMLEN bytes) */
     171};
     172
     173struct diropokres {
     174        nfs_fh file;
     175        fattr attributes;
     176};
     177
     178/*
     179 * Results from directory operation
     180 */
     181union diropres switch (nfsstat status) {
     182case NFS_OK:
     183        diropokres diropres;
     184default:
     185        void;
     186};
     187
     188union readlinkres switch (nfsstat status) {
     189case NFS_OK:
     190        nfspath data;
     191default:
     192        void;
     193};
     194
     195/*
     196 * Arguments to remote read
     197 */
     198struct readargs {
     199        nfs_fh file;            /* handle for file */
     200        unsigned offset;        /* byte offset in file */
     201        unsigned count;         /* immediate read count */
     202        unsigned totalcount;    /* total read count (from this offset)*/
     203};
     204
     205/*
     206 * Status OK portion of remote read reply
     207 */
     208struct readokres {
     209        fattr   attributes;     /* attributes, need for pagin*/
     210        opaque data<NFS_MAXDATA>;
     211};
     212
     213union readres switch (nfsstat status) {
     214case NFS_OK:
     215        readokres reply;
     216default:
     217        void;
     218};
     219
     220/*
     221 * Arguments to remote write
     222 */
     223struct writeargs {
     224        nfs_fh  file;           /* handle for file */
     225        unsigned beginoffset;   /* beginning byte offset in file */
     226        unsigned offset;        /* current byte offset in file */
     227        unsigned totalcount;    /* total write count (to this offset)*/
     228        opaque data<NFS_MAXDATA>;
     229};
     230
     231struct createargs {
     232        diropargs where;
     233        sattr attributes;
     234};
     235
     236struct renameargs {
     237        diropargs from;
     238        diropargs to;
     239};
     240
     241struct linkargs {
     242        nfs_fh from;
     243        diropargs to;
     244};
     245
     246struct symlinkargs {
     247        diropargs from;
     248        nfspath to;
     249        sattr attributes;
     250};
     251
     252
     253typedef opaque nfscookie[NFS_COOKIESIZE];
     254
     255/*
     256 * Arguments to readdir
     257 */
     258struct readdirargs {
     259        nfs_fh dir;             /* directory handle */
     260        nfscookie cookie;
     261        unsigned count;         /* number of directory bytes to read */
     262};
     263
     264struct entry {
     265        unsigned fileid;
     266        filename name;
     267        nfscookie cookie;
     268        entry *nextentry;
     269};
     270
     271struct dirlist {
     272        entry *entries;
     273        bool eof;
     274};
     275
     276union readdirres switch (nfsstat status) {
     277case NFS_OK:
     278        dirlist reply;
     279default:
     280        void;
     281};
     282
     283struct statfsokres {
     284        unsigned tsize; /* preferred transfer size in bytes */
     285        unsigned bsize; /* fundamental file system block size */
     286        unsigned blocks;        /* total blocks in file system */
     287        unsigned bfree; /* free blocks in fs */
     288        unsigned bavail;        /* free blocks avail to non-superuser */
     289};
     290
     291union statfsres switch (nfsstat status) {
     292case NFS_OK:
     293        statfsokres reply;
     294default:
     295        void;
     296};
     297
     298#ifdef WANT_NFS3
     299
     300/*
     301 * NFSv3 constants and types
     302 */
     303const NFS3_FHSIZE       = 64;   /* maximum size in bytes of a file handle */
     304const NFS3_COOKIEVERFSIZE = 8;  /* size of a cookie verifier for READDIR */
     305const NFS3_CREATEVERFSIZE = 8;  /* size of the verifier used for CREATE */
     306const NFS3_WRITEVERFSIZE = 8;   /* size of the verifier used for WRITE */
     307
     308typedef unsigned hyper uint64;
     309typedef hyper int64;
     310typedef unsigned long uint32;
     311typedef long int32;
     312typedef string filename3<>;
     313typedef string nfspath3<>;
     314typedef uint64 fileid3;
     315typedef uint64 cookie3;
     316typedef opaque cookieverf3[NFS3_COOKIEVERFSIZE];
     317typedef opaque createverf3[NFS3_CREATEVERFSIZE];
     318typedef opaque writeverf3[NFS3_WRITEVERFSIZE];
     319typedef uint32 uid3;
     320typedef uint32 gid3;
     321typedef uint64 size3;
     322typedef uint64 offset3;
     323typedef uint32 mode3;
     324typedef uint32 count3;
     325
     326/*
     327 * Error status (v3)
     328 */
     329enum nfsstat3 {
     330        NFS3_OK = 0,
     331        NFS3ERR_PERM            = 1,
     332        NFS3ERR_NOENT           = 2,
     333        NFS3ERR_IO              = 5,
     334        NFS3ERR_NXIO            = 6,
     335        NFS3ERR_ACCES           = 13,
     336        NFS3ERR_EXIST           = 17,
     337        NFS3ERR_XDEV            = 18,
     338        NFS3ERR_NODEV           = 19,
     339        NFS3ERR_NOTDIR          = 20,
     340        NFS3ERR_ISDIR           = 21,
     341        NFS3ERR_INVAL           = 22,
     342        NFS3ERR_FBIG            = 27,
     343        NFS3ERR_NOSPC           = 28,
     344        NFS3ERR_ROFS            = 30,
     345        NFS3ERR_MLINK           = 31,
     346        NFS3ERR_NAMETOOLONG     = 63,
     347        NFS3ERR_NOTEMPTY        = 66,
     348        NFS3ERR_DQUOT           = 69,
     349        NFS3ERR_STALE           = 70,
     350        NFS3ERR_REMOTE          = 71,
     351        NFS3ERR_BADHANDLE       = 10001,
     352        NFS3ERR_NOT_SYNC        = 10002,
     353        NFS3ERR_BAD_COOKIE      = 10003,
     354        NFS3ERR_NOTSUPP         = 10004,
     355        NFS3ERR_TOOSMALL        = 10005,
     356        NFS3ERR_SERVERFAULT     = 10006,
     357        NFS3ERR_BADTYPE         = 10007,
     358        NFS3ERR_JUKEBOX         = 10008
     359};
     360
     361/*
     362 * File types (v3)
     363 */
     364enum ftype3 {
     365        NF3REG  = 1,            /* regular file */
     366        NF3DIR  = 2,            /* directory */
     367        NF3BLK  = 3,            /* block special */
     368        NF3CHR  = 4,            /* character special */
     369        NF3LNK  = 5,            /* symbolic link */
     370        NF3SOCK = 6,            /* unix domain sockets */
     371        NF3FIFO = 7             /* named pipe */
     372};
     373
     374struct specdata3 {
     375        uint32  specdata1;
     376        uint32  specdata2;
     377};
     378
     379/*
     380 * File access handle (v3)
     381 */
     382struct nfs_fh3 {
     383        opaque data<NFS3_FHSIZE>;
     384};
     385
     386/*
     387 * Timeval (v3)
     388 */
     389struct nfstime3 {
     390        uint32  seconds;
     391        uint32  nseconds;
     392};
     393
     394
     395/*
     396 * File attributes (v3)
     397 */
     398struct fattr3 {
     399        ftype3  type;           /* file type */
     400        mode3   mode;           /* protection mode bits */
     401        uint32  nlink;          /* # hard links */
     402        uid3    uid;            /* owner user id */
     403        gid3    gid;            /* owner group id */
     404        size3   size;           /* file size in bytes */
     405        size3   used;           /* prefered block size */
     406        specdata3 rdev;         /* special device # */
     407        uint64 fsid;            /* device # */
     408        fileid3 fileid;         /* inode # */
     409        nfstime3 atime;         /* time of last access */
     410        nfstime3 mtime;         /* time of last modification */
     411        nfstime3 ctime;         /* time of last change */
     412};
     413
     414union post_op_attr switch (bool attributes_follow) {
     415case TRUE:
     416        fattr3  attributes;
     417case FALSE:
     418        void;
     419};
     420
     421struct wcc_attr {
     422        size3   size;
     423        nfstime3 mtime;
     424        nfstime3 ctime;
     425};
     426
     427union pre_op_attr switch (bool attributes_follow) {
     428case TRUE:
     429        wcc_attr attributes;
     430case FALSE:
     431        void;
     432};
     433
     434struct wcc_data {
     435        pre_op_attr before;
     436        post_op_attr after;
     437};
     438
     439union post_op_fh3 switch (bool handle_follows) {
     440case TRUE:
     441        nfs_fh3 handle;
     442case FALSE:
     443        void;
     444};
     445
     446/*
     447 * File attributes which can be set (v3)
     448 */
     449enum time_how {
     450        DONT_CHANGE             = 0,
     451        SET_TO_SERVER_TIME      = 1,
     452        SET_TO_CLIENT_TIME      = 2
     453};
     454
     455union set_mode3 switch (bool set_it) {
     456case TRUE:
     457        mode3   mode;
     458default:
     459        void;
     460};
     461
     462union set_uid3 switch (bool set_it) {
     463case TRUE:
     464        uid3    uid;
     465default:
     466        void;
     467};
     468
     469union set_gid3 switch (bool set_it) {
     470case TRUE:
     471        gid3    gid;
     472default:
     473        void;
     474};
     475
     476union set_size3 switch (bool set_it) {
     477case TRUE:
     478        size3   size;
     479default:
     480        void;
     481};
     482
     483union set_atime switch (time_how set_it) {
     484case SET_TO_CLIENT_TIME:
     485        nfstime3        atime;
     486default:
     487        void;
     488};
     489
     490union set_mtime switch (time_how set_it) {
     491case SET_TO_CLIENT_TIME:
     492        nfstime3        mtime;
     493default:
     494        void;
     495};
     496
     497struct sattr3 {
     498        set_mode3       mode;
     499        set_uid3        uid;
     500        set_gid3        gid;
     501        set_size3       size;
     502        set_atime       atime;
     503        set_mtime       mtime;
     504};
     505
     506/*
     507 * Arguments for directory operations (v3)
     508 */
     509struct diropargs3 {
     510        nfs_fh3 dir;            /* directory file handle */
     511        filename3 name;         /* name (up to NFS_MAXNAMLEN bytes) */
     512};
     513
     514/*
     515 * Arguments to getattr (v3).
     516 */
     517struct GETATTR3args {
     518        nfs_fh3         object;
     519};
     520
     521struct GETATTR3resok {
     522        fattr3          obj_attributes;
     523};
     524
     525union GETATTR3res switch (nfsstat3 status) {
     526case NFS3_OK:
     527        GETATTR3resok   resok;
     528default:
     529        void;
     530};
     531
     532/*
     533 * Arguments to setattr (v3).
     534 */
     535union sattrguard3 switch (bool check) {
     536case TRUE:
     537        nfstime3        obj_ctime;
     538case FALSE:
     539        void;
     540};
     541
     542struct SETATTR3args {
     543        nfs_fh3         object;
     544        sattr3          new_attributes;
     545        sattrguard3     guard;
     546};
     547
     548struct SETATTR3resok {
     549        wcc_data        obj_wcc;
     550};
     551
     552struct SETATTR3resfail {
     553        wcc_data        obj_wcc;
     554};
     555
     556union SETATTR3res switch (nfsstat3 status) {
     557case NFS3_OK:
     558        SETATTR3resok   resok;
     559default:
     560        SETATTR3resfail resfail;
     561};
     562
     563/*
     564 * Arguments to lookup (v3).
     565 */
     566struct LOOKUP3args {
     567        diropargs3      what;
     568};
     569
     570struct LOOKUP3resok {
     571        nfs_fh3         object;
     572        post_op_attr    obj_attributes;
     573        post_op_attr    dir_attributes;
     574};
     575
     576struct LOOKUP3resfail {
     577        post_op_attr    dir_attributes;
     578};
     579
     580union LOOKUP3res switch (nfsstat3 status) {
     581case NFS3_OK:
     582        LOOKUP3resok    resok;
     583default:
     584        LOOKUP3resfail  resfail;
     585};
     586
     587/*
     588 * Arguments to access (v3).
     589 */
     590const ACCESS3_READ      = 0x0001;
     591const ACCESS3_LOOKUP    = 0x0002;
     592const ACCESS3_MODIFY    = 0x0004;
     593const ACCESS3_EXTEND    = 0x0008;
     594const ACCESS3_DELETE    = 0x0010;
     595const ACCESS3_EXECUTE   = 0x0020;
     596
     597struct ACCESS3args {
     598        nfs_fh3         object;
     599        uint32          access;
     600};
     601
     602struct ACCESS3resok {
     603        post_op_attr    obj_attributes;
     604        uint32          access;
     605};
     606
     607struct ACCESS3resfail {
     608        post_op_attr    obj_attributes;
     609};
     610
     611union ACCESS3res switch (nfsstat3 status) {
     612case NFS3_OK:
     613        ACCESS3resok    resok;
     614default:
     615        ACCESS3resfail  resfail;
     616};
     617
     618/*
     619 * Arguments to readlink (v3).
     620 */
     621struct READLINK3args {
     622        nfs_fh3         symlink;
     623};
     624
     625struct READLINK3resok {
     626        post_op_attr    symlink_attributes;
     627        nfspath3        data;
     628};
     629
     630struct READLINK3resfail {
     631        post_op_attr    symlink_attributes;
     632};
     633
     634union READLINK3res switch (nfsstat3 status) {
     635case NFS3_OK:
     636        READLINK3resok  resok;
     637default:
     638        READLINK3resfail resfail;
     639};
     640
     641/*
     642 * Arguments to read (v3).
     643 */
     644struct READ3args {
     645        nfs_fh3         file;
     646        offset3         offset;
     647        count3          count;
     648};
     649
     650struct READ3resok {
     651        post_op_attr    file_attributes;
     652        count3          count;
     653        bool            eof;
     654        opaque          data<>;
     655};
     656
     657struct READ3resfail {
     658        post_op_attr    file_attributes;
     659};
     660
     661/* XXX: solaris 2.6 uses ``nfsstat'' here */
     662union READ3res switch (nfsstat3 status) {
     663case NFS3_OK:
     664        READ3resok      resok;
     665default:
     666        READ3resfail    resfail;
     667};
     668
     669/*
     670 * Arguments to write (v3).
     671 */
     672enum stable_how {
     673        UNSTABLE        = 0,
     674        DATA_SYNC       = 1,
     675        FILE_SYNC       = 2
     676};
     677
     678struct WRITE3args {
     679        nfs_fh3         file;
     680        offset3         offset;
     681        count3          count;
     682        stable_how      stable;
     683        opaque          data<>;
     684};
     685
     686struct WRITE3resok {
     687        wcc_data        file_wcc;
     688        count3          count;
     689        stable_how      committed;
     690        writeverf3      verf;
     691};
     692
     693struct WRITE3resfail {
     694        wcc_data        file_wcc;
     695};
     696
     697union WRITE3res switch (nfsstat3 status) {
     698case NFS3_OK:
     699        WRITE3resok     resok;
     700default:
     701        WRITE3resfail   resfail;
     702};
     703
     704/*
     705 * Arguments to create (v3).
     706 */
     707enum createmode3 {
     708        UNCHECKED       = 0,
     709        GUARDED         = 1,
     710        EXCLUSIVE       = 2
     711};
     712
     713union createhow3 switch (createmode3 mode) {
     714case UNCHECKED:
     715case GUARDED:
     716        sattr3          obj_attributes;
     717case EXCLUSIVE:
     718        createverf3     verf;
     719};
     720
     721struct CREATE3args {
     722        diropargs3      where;
     723        createhow3      how;
     724};
     725
     726struct CREATE3resok {
     727        post_op_fh3     obj;
     728        post_op_attr    obj_attributes;
     729        wcc_data        dir_wcc;
     730};
     731
     732struct CREATE3resfail {
     733        wcc_data        dir_wcc;
     734};
     735
     736union CREATE3res switch (nfsstat3 status) {
     737case NFS3_OK:
     738        CREATE3resok    resok;
     739default:
     740        CREATE3resfail  resfail;
     741};
     742
     743/*
     744 * Arguments to mkdir (v3).
     745 */
     746struct MKDIR3args {
     747        diropargs3      where;
     748        sattr3          attributes;
     749};
     750
     751struct MKDIR3resok {
     752        post_op_fh3     obj;
     753        post_op_attr    obj_attributes;
     754        wcc_data        dir_wcc;
     755};
     756
     757struct MKDIR3resfail {
     758        wcc_data        dir_wcc;
     759};
     760
     761union MKDIR3res switch (nfsstat3 status) {
     762case NFS3_OK:
     763        MKDIR3resok     resok;
     764default:
     765        MKDIR3resfail   resfail;
     766};
     767
     768/*
     769 * Arguments to symlink (v3).
     770 */
     771struct symlinkdata3 {
     772        sattr3          symlink_attributes;
     773        nfspath3        symlink_data;
     774};
     775
     776struct SYMLINK3args {
     777        diropargs3      where;
     778        symlinkdata3    symlink;
     779};
     780
     781struct SYMLINK3resok {
     782        post_op_fh3     obj;
     783        post_op_attr    obj_attributes;
     784        wcc_data        dir_wcc;
     785};
     786
     787struct SYMLINK3resfail {
     788        wcc_data        dir_wcc;
     789};
     790
     791union SYMLINK3res switch (nfsstat3 status) {
     792case NFS3_OK:
     793        SYMLINK3resok   resok;
     794default:
     795        SYMLINK3resfail resfail;
     796};
     797
     798/*
     799 * Arguments to mknod (v3).
     800 */
     801struct devicedata3 {
     802        sattr3          dev_attributes;
     803        specdata3       spec;
     804};
     805
     806union mknoddata3 switch (ftype3 type) {
     807case NF3CHR:
     808case NF3BLK:
     809        devicedata3     device;
     810case NF3SOCK:
     811case NF3FIFO:
     812        sattr3          pipe_attributes;
     813default:
     814        void;
     815};
     816
     817struct MKNOD3args {
     818        diropargs3      where;
     819        mknoddata3      what;
     820};
     821
     822struct MKNOD3resok {
     823        post_op_fh3     obj;
     824        post_op_attr    obj_attributes;
     825        wcc_data        dir_wcc;
     826};
     827
     828struct MKNOD3resfail {
     829        wcc_data        dir_wcc;
     830};
     831
     832union MKNOD3res switch (nfsstat3 status) {
     833case NFS3_OK:
     834        MKNOD3resok     resok;
     835default:
     836        MKNOD3resfail   resfail;
     837};
     838
     839/*
     840 * Arguments to remove (v3).
     841 */
     842struct REMOVE3args {
     843        diropargs3      object;
     844};
     845
     846struct REMOVE3resok {
     847        wcc_data        dir_wcc;
     848};
     849
     850struct REMOVE3resfail {
     851        wcc_data        dir_wcc;
     852};
     853
     854union REMOVE3res switch (nfsstat3 status) {
     855case NFS3_OK:
     856        REMOVE3resok    resok;
     857default:
     858        REMOVE3resfail  resfail;
     859};
     860
     861/*
     862 * Arguments to rmdir (v3).
     863 */
     864struct RMDIR3args {
     865        diropargs3      object;
     866};
     867
     868struct RMDIR3resok {
     869        wcc_data        dir_wcc;
     870};
     871
     872struct RMDIR3resfail {
     873        wcc_data        dir_wcc;
     874};
     875
     876union RMDIR3res switch (nfsstat3 status) {
     877case NFS3_OK:
     878        RMDIR3resok     resok;
     879default:
     880        RMDIR3resfail   resfail;
     881};
     882
     883/*
     884 * Arguments to rename (v3).
     885 */
     886struct RENAME3args {
     887        diropargs3      from;
     888        diropargs3      to;
     889};
     890
     891struct RENAME3resok {
     892        wcc_data        fromdir_wcc;
     893        wcc_data        todir_wcc;
     894};
     895
     896struct RENAME3resfail {
     897        wcc_data        fromdir_wcc;
     898        wcc_data        todir_wcc;
     899};
     900
     901union RENAME3res switch (nfsstat3 status) {
     902case NFS3_OK:
     903        RENAME3resok    resok;
     904default:
     905        RENAME3resfail  resfail;
     906};
     907
     908/*
     909 * Arguments to link (v3).
     910 */
     911struct LINK3args {
     912        nfs_fh3         file;
     913        diropargs3      link;
     914};
     915
     916struct LINK3resok {
     917        post_op_attr    file_attributes;
     918        wcc_data        linkdir_wcc;
     919};
     920
     921struct LINK3resfail {
     922        post_op_attr    file_attributes;
     923        wcc_data        linkdir_wcc;
     924};
     925
     926union LINK3res switch (nfsstat3 status) {
     927case NFS3_OK:
     928        LINK3resok      resok;
     929default:
     930        LINK3resfail    resfail;
     931};
     932
     933/*
     934 * Arguments to readdir (v3).
     935 */
     936struct READDIR3args {
     937        nfs_fh3         dir;
     938        cookie3         cookie;
     939        cookieverf3     cookieverf;
     940        count3          count;
     941};
     942
     943struct entry3 {
     944        fileid3         fileid;
     945        filename3       name;
     946        cookie3         cookie;
     947        entry3          *nextentry;
     948};
     949
     950struct dirlist3 {
     951        entry3          *entries;
     952        bool            eof;
     953};
     954
     955struct READDIR3resok {
     956        post_op_attr    dir_attributes;
     957        cookieverf3     cookieverf;
     958        dirlist3        reply;
     959};
     960
     961struct READDIR3resfail {
     962        post_op_attr    dir_attributes;
     963};
     964
     965union READDIR3res switch (nfsstat3 status) {
     966case NFS3_OK:
     967        READDIR3resok   resok;
     968default:
     969        READDIR3resfail resfail;
     970};
     971
     972/*
     973 * Arguments to readdirplus (v3).
     974 */
     975struct READDIRPLUS3args {
     976        nfs_fh3         dir;
     977        cookie3         cookie;
     978        cookieverf3     cookieverf;
     979        count3          dircount;
     980        count3          maxcount;
     981};
     982
     983struct entryplus3 {
     984        fileid3         fileid;
     985        filename3       name;
     986        cookie3         cookie;
     987        post_op_attr    name_attributes;
     988        post_op_fh3     name_handle;
     989        entryplus3      *nextentry;
     990};
     991
     992struct dirlistplus3 {
     993        entryplus3      *entries;
     994        bool            eof;
     995};
     996
     997struct READDIRPLUS3resok {
     998        post_op_attr    dir_attributes;
     999        cookieverf3     cookieverf;
     1000        dirlistplus3    reply;
     1001};
     1002
     1003struct READDIRPLUS3resfail {
     1004        post_op_attr    dir_attributes;
     1005};
     1006
     1007union READDIRPLUS3res switch (nfsstat3 status) {
     1008case NFS3_OK:
     1009        READDIRPLUS3resok       resok;
     1010default:
     1011        READDIRPLUS3resfail     resfail;
     1012};
     1013
     1014/*
     1015 * Arguments to fsstat (v3).
     1016 */
     1017struct FSSTAT3args {
     1018        nfs_fh3         fsroot;
     1019};
     1020
     1021struct FSSTAT3resok {
     1022        post_op_attr    obj_attributes;
     1023        size3           tbytes;
     1024        size3           fbytes;
     1025        size3           abytes;
     1026        size3           tfiles;
     1027        size3           ffiles;
     1028        size3           afiles;
     1029        uint32          invarsec;
     1030};
     1031
     1032struct FSSTAT3resfail {
     1033        post_op_attr    obj_attributes;
     1034};
     1035
     1036union FSSTAT3res switch (nfsstat3 status) {
     1037case NFS3_OK:
     1038        FSSTAT3resok    resok;
     1039default:
     1040        FSSTAT3resfail  resfail;
     1041};
     1042
     1043/*
     1044 * Arguments to fsinfo (v3).
     1045 */
     1046const FSF3_LINK         = 0x0001;
     1047const FSF3_SYMLINK      = 0x0002;
     1048const FSF3_HOMOGENEOUS  = 0x0008;
     1049const FSF3_CANSETTIME   = 0x0010;
     1050
     1051struct FSINFO3args {
     1052        nfs_fh3         fsroot;
     1053};
     1054
     1055struct FSINFO3resok {
     1056        post_op_attr    obj_attributes;
     1057        uint32          rtmax;
     1058        uint32          rtpref;
     1059        uint32          rtmult;
     1060        uint32          wtmax;
     1061        uint32          wtpref;
     1062        uint32          wtmult;
     1063        uint32          dtpref;
     1064        size3           maxfilesize;
     1065        nfstime3        time_delta;
     1066        uint32          properties;
     1067};
     1068
     1069struct FSINFO3resfail {
     1070        post_op_attr    obj_attributes;
     1071};
     1072
     1073union FSINFO3res switch (nfsstat3 status) {
     1074case NFS3_OK:
     1075        FSINFO3resok    resok;
     1076default:
     1077        FSINFO3resfail  resfail;
     1078};
     1079
     1080/*
     1081 * Arguments to pathconf (v3).
     1082 */
     1083struct PATHCONF3args {
     1084        nfs_fh3         object;
     1085};
     1086
     1087struct PATHCONF3resok {
     1088        post_op_attr    obj_attributes;
     1089        uint32          linkmax;
     1090        uint32          name_max;
     1091        bool            no_trunc;
     1092        bool            chown_restricted;
     1093        bool            case_insensitive;
     1094        bool            case_preserving;
     1095};
     1096
     1097struct PATHCONF3resfail {
     1098        post_op_attr    obj_attributes;
     1099};
     1100
     1101union PATHCONF3res switch (nfsstat3 status) {
     1102case NFS3_OK:
     1103        PATHCONF3resok  resok;
     1104default:
     1105        PATHCONF3resfail        resfail;
     1106};
     1107
     1108/*
     1109 * Arguments to commit (v3).
     1110 */
     1111struct COMMIT3args {
     1112        nfs_fh3         file;
     1113        offset3         offset;
     1114        count3          count;
     1115};
     1116
     1117struct COMMIT3resok {
     1118        wcc_data        file_wcc;
     1119        writeverf3      verf;
     1120};
     1121
     1122struct COMMIT3resfail {
     1123        wcc_data        file_wcc;
     1124};
     1125
     1126union COMMIT3res switch (nfsstat3 status) {
     1127case NFS3_OK:
     1128        COMMIT3resok    resok;
     1129default:
     1130        COMMIT3resfail  resfail;
     1131};
     1132
     1133#endif /* WANT_NFS3 */
     1134
     1135/*
     1136 * Remote file service routines
     1137 */
     1138program NFS_PROGRAM {
     1139        version NFS_VERSION {
     1140                void
     1141                NFSPROC_NULL(void) = 0;
     1142
     1143                attrstat
     1144                NFSPROC_GETATTR(nfs_fh) =       1;
     1145
     1146                attrstat
     1147                NFSPROC_SETATTR(sattrargs) = 2;
     1148
     1149                void
     1150                NFSPROC_ROOT(void) = 3;
     1151
     1152                diropres
     1153                NFSPROC_LOOKUP(diropargs) = 4;
     1154
     1155                readlinkres
     1156                NFSPROC_READLINK(nfs_fh) = 5;
     1157
     1158                readres
     1159                NFSPROC_READ(readargs) = 6;
     1160
     1161                void
     1162                NFSPROC_WRITECACHE(void) = 7;
     1163
     1164                attrstat
     1165                NFSPROC_WRITE(writeargs) = 8;
     1166
     1167                diropres
     1168                NFSPROC_CREATE(createargs) = 9;
     1169
     1170                nfsstat
     1171                NFSPROC_REMOVE(diropargs) = 10;
     1172
     1173                nfsstat
     1174                NFSPROC_RENAME(renameargs) = 11;
     1175
     1176                nfsstat
     1177                NFSPROC_LINK(linkargs) = 12;
     1178
     1179                nfsstat
     1180                NFSPROC_SYMLINK(symlinkargs) = 13;
     1181
     1182                diropres
     1183                NFSPROC_MKDIR(createargs) = 14;
     1184
     1185                nfsstat
     1186                NFSPROC_RMDIR(diropargs) = 15;
     1187
     1188                readdirres
     1189                NFSPROC_READDIR(readdirargs) = 16;
     1190
     1191                statfsres
     1192                NFSPROC_STATFS(nfs_fh) = 17;
     1193        } = 2;
     1194} = 100003;
     1195#ifdef WANT_NFS3
     1196program NFS3_PROGRAM {
     1197        version NFS_V3 {
     1198                void
     1199                NFSPROC3_NULL(void)                     = 0;
     1200
     1201                GETATTR3res
     1202                NFSPROC3_GETATTR(GETATTR3args)          = 1;
     1203
     1204                SETATTR3res
     1205                NFSPROC3_SETATTR(SETATTR3args)          = 2;
     1206
     1207                LOOKUP3res
     1208                NFSPROC3_LOOKUP(LOOKUP3args)            = 3;
     1209
     1210                ACCESS3res
     1211                NFSPROC3_ACCESS(ACCESS3args)            = 4;
     1212
     1213                READLINK3res
     1214                NFSPROC3_READLINK(READLINK3args)        = 5;
     1215
     1216                READ3res
     1217                NFSPROC3_READ(READ3args)                = 6;
     1218
     1219                WRITE3res
     1220                NFSPROC3_WRITE(WRITE3args)              = 7;
     1221
     1222                CREATE3res
     1223                NFSPROC3_CREATE(CREATE3args)            = 8;
     1224
     1225                MKDIR3res
     1226                NFSPROC3_MKDIR(MKDIR3args)              = 9;
     1227
     1228                SYMLINK3res
     1229                NFSPROC3_SYMLINK(SYMLINK3args)          = 10;
     1230
     1231                MKNOD3res
     1232                NFSPROC3_MKNOD(MKNOD3args)              = 11;
     1233
     1234                REMOVE3res
     1235                NFSPROC3_REMOVE(REMOVE3args)            = 12;
     1236
     1237                RMDIR3res
     1238                NFSPROC3_RMDIR(RMDIR3args)              = 13;
     1239
     1240                RENAME3res
     1241                NFSPROC3_RENAME(RENAME3args)            = 14;
     1242
     1243                LINK3res
     1244                NFSPROC3_LINK(LINK3args)                = 15;
     1245
     1246                READDIR3res
     1247                NFSPROC3_READDIR(READDIR3args)          = 16;
     1248
     1249                READDIRPLUS3res
     1250                NFSPROC3_READDIRPLUS(READDIRPLUS3args)  = 17;
     1251
     1252                FSSTAT3res
     1253                NFSPROC3_FSSTAT(FSSTAT3args)            = 18;
     1254
     1255                FSINFO3res
     1256                NFSPROC3_FSINFO(FSINFO3args)            = 19;
     1257
     1258                PATHCONF3res
     1259                NFSPROC3_PATHCONF(PATHCONF3args)        = 20;
     1260
     1261                COMMIT3res
     1262                NFSPROC3_COMMIT(COMMIT3args)            = 21;
     1263        } = 3;
     1264} = 100003;
     1265#endif
     1266
  • cpukit/librpc/include/rpcsvc/nis.x

    r0ab65474 rdf49c60  
     1%/*
     2% * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
     3% * unrestricted use provided that this legend is included on all tape
     4% * media and as a part of the software program in whole or part.  Users
     5% * may copy or modify Sun RPC without charge, but are not authorized
     6% * to license or distribute it to anyone else except as part of a product or
     7% * program developed by the user or with the express written consent of
     8% * Sun Microsystems, Inc.
     9% *
     10% * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
     11% * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
     12% * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
     13% *
     14% * Sun RPC is provided with no support and without any obligation on the
     15% * part of Sun Microsystems, Inc. to assist in its use, correction,
     16% * modification or enhancement.
     17% *
     18% * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
     19% * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
     20% * OR ANY PART THEREOF.
     21% *
     22% * In no event will Sun Microsystems, Inc. be liable for any lost revenue
     23% * or profits or other special, indirect and consequential damages, even if
     24% * Sun has been advised of the possibility of such damages.
     25% *
     26% * Sun Microsystems, Inc.
     27% * 2550 Garcia Avenue
     28% * Mountain View, California  94043
     29% */
     30
     31#ifndef RPC_HDR
     32%#ifndef lint
     33%static const char rcsid[] =
     34%  "$FreeBSD: src/include/rpcsvc/nis.x,v 1.3 1999/08/27 23:45:09 peter Exp $";
     35%#endif /* not lint */
     36#endif
     37
     38/*
     39 * From 4.1 : @(#)nis.x 1.61 Copyright 1989 Sun Microsystems
     40 *
     41 * RPC Language Protocol description file for NIS Plus
     42 * This version : 1.61
     43 * Last Modified : 3/19/91
     44 */
     45#ifdef RPC_HDR
     46%/*
     47% *     nis.h
     48% *
     49% *     This file is the main include file for NIS clients. It contains
     50% *     both the client library function defines and the various data
     51% *     structures used by the NIS service. It includes the file nis_tags.h
     52% *     which defines the tag values. This allows the tags to change without
     53% *     having to change the nis.x file.
     54% *     
     55% *     NOTE : DO NOT EDIT THIS FILE! It is automatically generated when
     56% *            rpcgen is run on the nis.x file. Note that there is a
     57% *            simple sed script to remove some unneeded lines. (See the
     58% *            Makefile target nis.h)
     59% *
     60% */
     61%#include <rpcsvc/nis_tags.h>
     62#endif
     63
     64/* This gets stuffed into the source files. */
     65#if RPC_HDR
     66%#include <rpc/xdr.h>
     67#endif
     68/*
     69 * This is just pointless.
     70 */
     71#ifdef SUN_STUPIDITY
     72#if RPC_SVC
     73%#include "nis_svc.h"
     74#endif
     75#endif
     76
     77/* Include the RPC Language description of NIS objects */
     78#include "nis_object.x"
     79
     80/* Errors  that can be returned by the service */
     81enum nis_error {
     82        NIS_SUCCESS = 0,        /* A-ok, let's rock n roll      */
     83        NIS_S_SUCCESS = 1,      /* Name found (maybe)           */
     84        NIS_NOTFOUND = 2,       /* Name definitely not found    */
     85        NIS_S_NOTFOUND = 3,     /* Name maybe not found         */
     86        NIS_CACHEEXPIRED = 4,   /* Name exists but cache out of date */
     87        NIS_NAMEUNREACHABLE = 5, /* Can't get there from here */
     88        NIS_UNKNOWNOBJ = 6,     /* Object type is bogus */
     89        NIS_TRYAGAIN = 7,       /* I'm busy, call back */
     90        NIS_SYSTEMERROR = 8,    /* Out of band failure */
     91        NIS_CHAINBROKEN = 9,    /* First/Next warning */
     92        NIS_PERMISSION = 10,    /* Not enough permission to access */
     93        NIS_NOTOWNER = 11,      /* You don't own it, sorry */
     94        NIS_NOT_ME = 12,        /* I don't serve this name */
     95        NIS_NOMEMORY = 13,      /* Outta VM! Help! */
     96        NIS_NAMEEXISTS = 14,    /* Can't create over another name */
     97        NIS_NOTMASTER = 15,     /* I'm justa secondaray, don't ask me */
     98        NIS_INVALIDOBJ = 16,    /* Object is broken somehow */
     99        NIS_BADNAME = 17,       /* Unparsable name */
     100        NIS_NOCALLBACK = 18,    /* Couldn't talk to call back proc */
     101        NIS_CBRESULTS = 19,     /* Results being called back to you */
     102        NIS_NOSUCHNAME = 20,    /* Name unknown */
     103        NIS_NOTUNIQUE = 21,     /* Value is not uniques (entry) */
     104        NIS_IBMODERROR = 22,    /* Inf. Base. Modify error. */
     105        NIS_NOSUCHTABLE = 23,   /* Name for table was wrong */
     106        NIS_TYPEMISMATCH = 24,  /* Entry and table type mismatch */
     107        NIS_LINKNAMEERROR = 25, /* Link points to bogus name */
     108        NIS_PARTIAL = 26,       /* Partial success, found table */
     109        NIS_TOOMANYATTRS = 27,  /* Too many attributes */
     110        NIS_RPCERROR = 28,      /* RPC error encountered */
     111        NIS_BADATTRIBUTE = 29,  /* Bad or invalid attribute */
     112        NIS_NOTSEARCHABLE = 30, /* Non-searchable object searched */
     113        NIS_CBERROR = 31,       /* Error during callback (svc crash) */
     114        NIS_FOREIGNNS = 32,     /* Foreign Namespace */
     115        NIS_BADOBJECT = 33,     /* Malformed object structure */
     116        NIS_NOTSAMEOBJ = 34,    /* Object swapped during deletion */
     117        NIS_MODFAIL = 35,       /* Failure during a Modify. */
     118        NIS_BADREQUEST = 36,    /* Illegal query for table */
     119        NIS_NOTEMPTY = 37,      /* Attempt to remove a non-empty tbl */
     120        NIS_COLDSTART_ERR = 38, /* Error accesing the cold start file */
     121        NIS_RESYNC = 39,        /* Transaction log too far out of date */
     122        NIS_FAIL = 40,          /* NIS operation failed. */
     123        NIS_UNAVAIL = 41,       /* NIS+ service is unavailable (client) */
     124        NIS_RES2BIG = 42,       /* NIS+ result too big for datagram */
     125        NIS_SRVAUTH = 43,       /* NIS+ server wasn't authenticated. */
     126        NIS_CLNTAUTH = 44,      /* NIS+ Client wasn't authenticated. */
     127        NIS_NOFILESPACE = 45,   /* NIS+ server ran out of disk space */
     128        NIS_NOPROC = 46,        /* NIS+ server couldn't create new proc */
     129        NIS_DUMPLATER = 47      /* NIS+ server already has dump child */
     130};
     131
     132
     133/*
     134 * Structure definitions for the parameters and results of the actual
     135 * NIS RPC calls.
     136 *
     137 * This is the standard result (in the protocol) of most of the nis
     138 * requests.
     139 */
     140
     141struct nis_result {
     142        nis_error       status;         /* Status of the response */
     143        nis_object      objects<>;      /* objects found          */
     144        netobj          cookie;         /* Cookie Data            */
     145        u_long          zticks;         /* server ticks           */
     146        u_long          dticks;         /* DBM ticks.             */
     147        u_long          aticks;         /* Cache (accel) ticks    */
     148        u_long          cticks;         /* Client ticks           */
     149};
     150
     151/*
     152 * A Name Service request
     153 * This request is used to access the name space, ns_name is the name
     154 * of the object within the namespace and the object is it's value, for
     155 * add/modify, a copy of the original for remove.
     156 */
     157
     158struct ns_request {
     159        nis_name        ns_name;        /* Name in the NIS name space   */
     160        nis_object      ns_object<1>;   /* Optional Object (add/remove) */
     161};
     162
     163/*
     164 * An information base request
     165 * This request includes the NIS name of the table we wish to search, the
     166 * search criteria in the form of attribute/value pairs and an optional
     167 * callback program number. If the callback program number is provided
     168 * the server will send back objects one at a time, otherwise it will
     169 * return them all in the response.
     170 */
     171
     172struct ib_request {
     173        nis_name        ibr_name;       /* The name of the Table        */
     174        nis_attr        ibr_srch<>;     /* The search critereia         */
     175        u_long          ibr_flags;      /* Optional flags               */
     176        nis_object      ibr_obj<1>;     /* optional object (add/modify) */
     177        nis_server      ibr_cbhost<1>;  /* Optional callback info       */
     178        u_long          ibr_bufsize;    /* Optional first/next bufsize  */
     179        netobj          ibr_cookie;     /* The first/next cookie        */
     180};
     181
     182/*
     183 * This argument to the PING call notifies the replicas that something in
     184 * a directory has changed and this is it's timestamp. The replica will use
     185 * the timestamp to determine if its resync operation was successful.
     186 */
     187struct ping_args {
     188        nis_name        dir;    /* Directory that had the change */
     189        u_long          stamp;  /* timestamp of the transaction  */
     190};
     191
     192/*
     193 * These are the type of entries that are stored in the transaction log,
     194 * note that modifications will appear as two entries, for names, they have
     195 * a "OLD" entry followed by a "NEW" entry. For entries in tables, there
     196 * is a remove followed by an add. It is done this way so that we can read
     197 * the log backwards to back out transactions and forwards to propogate
     198 * updated.
     199 */
     200enum log_entry_t {
     201        LOG_NOP = 0,
     202        ADD_NAME = 1,           /* Name Added to name space               */
     203        REM_NAME = 2,           /* Name removed from name space           */
     204        MOD_NAME_OLD = 3,       /* Name was modified in the name space    */
     205        MOD_NAME_NEW = 4,       /* Name was modified in the name space    */
     206        ADD_IBASE = 5,          /* Entry added to information base        */
     207        REM_IBASE = 6,          /* Entry removed from information base    */
     208        MOD_IBASE = 7,          /* Entry was modified in information base */
     209        UPD_STAMP = 8           /* Update timestamp (used as fenceposts)  */
     210};
     211       
     212/*
     213 * This result is returned from the name service when it is requested to
     214 * dump logged entries from its transaction log. Information base updates
     215 * will have the name of the information base in the le_name field and
     216 * a canonical set of attribute/value pairs to fully specify the entry's
     217 * 'name'.
     218 */
     219struct log_entry {
     220        u_long          le_time;        /* Time in seconds              */
     221        log_entry_t     le_type;        /* Type of log entry            */
     222        nis_name        le_princp;      /* Principal making the change  */
     223        nis_name        le_name;        /* Name of table/dir involved   */
     224        nis_attr        le_attrs<>;     /* List of AV pairs.            */
     225        nis_object      le_object;      /* Actual object value          */
     226};
     227
     228struct log_result {
     229        nis_error       lr_status;      /* The status itself            */
     230        netobj          lr_cookie;      /* Used by the dump callback    */
     231        log_entry       lr_entries<>;   /* zero or more entries         */
     232};
     233       
     234struct cp_result {
     235        nis_error       cp_status;      /* Status of the checkpoint     */
     236        u_long          cp_zticks;      /* Service 'ticks'              */
     237        u_long          cp_dticks;      /* Database 'ticks'             */
     238};
     239
     240/*
     241 * This structure defines a generic NIS tag list. The taglist contains
     242 * zero or tags, each of which is a type and a value. (u_long).
     243 * These are used to report statistics (see tag definitions below)
     244 * and to set or reset state variables.
     245 */
     246struct nis_tag {
     247        u_long  tag_type;       /* Statistic tag (may vary)      */
     248        string  tag_val<1024>;  /* Statistic value may also vary */
     249};
     250
     251struct nis_taglist {
     252        nis_tag tags<>;         /* List of tags */
     253};
     254
     255struct dump_args {
     256        nis_name        da_dir;         /* Directory to dump    */
     257        u_long          da_time;        /* From this timestamp  */
     258        nis_server      da_cbhost<1>;   /* Callback to use.     */
     259};
     260
     261struct fd_args {
     262        nis_name        dir_name;  /* The directory we're looking for */
     263        nis_name        requester; /* Host principal name for signature */
     264};
     265
     266struct fd_result {
     267        nis_error       status;         /* Status returned by function  */
     268        nis_name        source;         /* Source of this answer        */
     269        opaque          dir_data<>;     /* Directory Data (XDR'ed)      */
     270        opaque          signature<>;    /* Signature of the source      */
     271};
     272
     273
     274/*
     275 * What's going on here? Well, it's like this. When the service
     276 * is being compiled it wants to have the service definition specific
     277 * info included, and when the client is being compiled it wants that
     278 * info. This includes the appropriate file which was generated by
     279 * make in the protocols directory (probably /usr/include/rpcsvc).
     280 *
     281 * Uhm... guys? With RPC, you aren't supposed to have seperate
     282 * server-specific and client-specific header files. You have one header
     283 * file that's suitable for both. If your code doesn't work using just
     284 * the one header file, I submit to you that it's broken.
     285 *                                                      -Bill
     286 */
     287#ifdef SUN_STUPIDITY
     288#ifdef RPC_SVC
     289%#include "nis_svc.h"
     290#endif
     291#ifdef RPC_CLNT
     292%#include "nis_clnt.h"
     293#endif
     294#endif
     295
     296program  NIS_PROG {
     297
     298        /* RPC Language description of the NIS+ protocol */
     299        version NIS_VERSION {
     300                /* The name service functions */
     301                nis_result  NIS_LOOKUP(ns_request) = 1;
     302                nis_result  NIS_ADD(ns_request) = 2;
     303                nis_result  NIS_MODIFY(ns_request) = 3;
     304                nis_result  NIS_REMOVE(ns_request) = 4;
     305
     306                /* The information base functions */
     307                nis_result  NIS_IBLIST(ib_request) = 5;
     308                nis_result  NIS_IBADD(ib_request) = 6;
     309                nis_result  NIS_IBMODIFY(ib_request) = 7;
     310                nis_result  NIS_IBREMOVE(ib_request) = 8;
     311                nis_result  NIS_IBFIRST(ib_request) = 9;
     312                nis_result  NIS_IBNEXT(ib_request) = 10;
     313
     314                /* NIS Administrative functions */
     315                fd_result   NIS_FINDDIRECTORY(fd_args) = 12;
     316
     317                /* If fetch and optionally reset statistics */
     318                nis_taglist  NIS_STATUS(nis_taglist) = 14;
     319               
     320                /* Dump changes to directory since time in da_time */
     321                log_result  NIS_DUMPLOG(dump_args) = 15;
     322               
     323                /* Dump contents of directory named */
     324                log_result  NIS_DUMP(dump_args) = 16;
     325
     326                /* Check status of callback thread */
     327                bool        NIS_CALLBACK(netobj) = 17;
     328
     329                /* Return last update time for named dir */
     330                u_long      NIS_CPTIME(nis_name) = 18;
     331
     332                /* Checkpoint directory or table named */
     333                cp_result   NIS_CHECKPOINT(nis_name) = 19;
     334
     335                /* Send 'status changed' ping to replicates */
     336                void        NIS_PING(ping_args) = 20;
     337       
     338                /* Modify server behaviour (such as debugging) */
     339                nis_taglist NIS_SERVSTATE(nis_taglist) = 21;
     340       
     341                /* Create a Directory */
     342                nis_error   NIS_MKDIR(nis_name) = 22;
     343       
     344                /* Remove a Directory */
     345                nis_error   NIS_RMDIR(nis_name) = 23;
     346               
     347                /* Update public keys of a directory object */
     348                nis_error   NIS_UPDKEYS(nis_name) = 24;
     349        } = 3;
     350} = 100300;
     351
     352/*
     353 * Included below are the defines that become part of nis.h,
     354 * they are technically not part of the protocol, but do define
     355 * key aspects of the implementation and are therefore useful
     356 * in building a conforming server or client.
     357 */
     358#if RPC_HDR
     359%/*
     360% * Generic "hash" datastructures, used by all types of hashed data.
     361% */
     362%struct nis_hash_data {
     363%       nis_name                name;      /* NIS name of hashed item      */
     364%       int                     keychain;  /* It's hash key (for pop)      */
     365%       struct nis_hash_data    *next;     /* Hash collision pointer       */
     366%       struct nis_hash_data    *prv_item; /* A serial, doubly linked list */
     367%       struct nis_hash_data    *nxt_item; /* of items in the hash table   */
     368%};
     369%typedef struct nis_hash_data NIS_HASH_ITEM;
     370%
     371%struct nis_hash_table {
     372%       NIS_HASH_ITEM   *keys[64];      /* A hash table of items           */
     373%       NIS_HASH_ITEM   *first;         /* The first "item" in serial list */
     374%};
     375%typedef struct nis_hash_table NIS_HASH_TABLE;
     376%
     377%/* Structure for storing dynamically allocated static data */
     378%struct nis_sdata {
     379%       void    *buf;   /* Memory allocation pointer    */
     380%       u_long  size;   /* Buffer size                  */
     381%};
     382%
     383%/* Generic client creating flags */
     384%#define ZMH_VC         1
     385%#define ZMH_DG         2
     386%#define ZMH_AUTH       4
     387%
     388%/* Testing Access rights for objects */
     389%
     390%#define NIS_READ_ACC           1
     391%#define NIS_MODIFY_ACC         2
     392%#define NIS_CREATE_ACC         4
     393%#define NIS_DESTROY_ACC        8
     394%/* Test macros. a == access rights, m == desired rights. */
     395%#define WORLD(a, m)    (((a) & (m)) != 0)
     396%#define GROUP(a, m)    (((a) & ((m) << 8)) != 0)
     397%#define OWNER(a, m)    (((a) & ((m) << 16)) != 0)
     398%#define NOBODY(a, m)   (((a) & ((m) << 24)) != 0)
     399%
     400%#define OATYPE(d, n) (((d)->do_armask.do_armask_val+n)->oa_otype)
     401%#define OARIGHTS(d, n) (((d)->do_armask.do_armask_val+n)->oa_rights)
     402%#define WORLD_DEFAULT (NIS_READ_ACC)
     403%#define GROUP_DEFAULT (NIS_READ_ACC << 8)
     404%#define OWNER_DEFAULT ((NIS_READ_ACC +\
     405                         NIS_MODIFY_ACC +\
     406                         NIS_CREATE_ACC +\
     407                         NIS_DESTROY_ACC) << 16)
     408%#define DEFAULT_RIGHTS (WORLD_DEFAULT | GROUP_DEFAULT | OWNER_DEFAULT)
     409%
     410%/* Result manipulation defines ... */
     411%#define NIS_RES_NUMOBJ(x)      ((x)->objects.objects_len)
     412%#define NIS_RES_OBJECT(x)      ((x)->objects.objects_val)
     413%#define NIS_RES_COOKIE(x)      ((x)->cookie)
     414%#define NIS_RES_STATUS(x)      ((x)->status)
     415%
     416%/* These defines make getting at the variant part of the object easier. */
     417%#define TA_data zo_data.objdata_u.ta_data
     418%#define EN_data zo_data.objdata_u.en_data
     419%#define DI_data zo_data.objdata_u.di_data
     420%#define LI_data zo_data.objdata_u.li_data
     421%#define GR_data zo_data.objdata_u.gr_data
     422%
     423%#define __type_of(o) ((o)->zo_data.zo_type)
     424%
     425%/* Declarations for the internal subroutines in nislib.c */
     426%enum name_pos {SAME_NAME, HIGHER_NAME, LOWER_NAME, NOT_SEQUENTIAL, BAD_NAME};
     427%typedef enum name_pos name_pos;
     428%
     429%/*
     430% * Defines for getting at column data in entry objects. Because RPCGEN
     431% * generates some rather wordy structures, we create some defines that
     432% * collapse the needed keystrokes to access a particular value using
     433% * these definitions they take an nis_object *, and an int and return
     434% * a u_char * for Value, and an int for length.
     435% */
     436%#define ENTRY_VAL(obj, col) \
     437        (obj)->EN_data.en_cols.en_cols_val[col].ec_value.ec_value_val
     438%#define ENTRY_LEN(obj, col) \
     439        (obj)->EN_data.en_cols.en_cols_val[col].ec_value.ec_value_len
     440%
     441%#ifdef __cplusplus
     442%}
     443%#endif
     444%
     445%/* Prototypes, and extern declarations for the NIS library functions. */
     446%#include <rpcsvc/nislib.h>
     447%#endif /* __NIS_RPCGEN_H */
     448%/* EDIT_START */
     449%
     450%/*
     451% * nis_3.h
     452% *
     453% * This file contains definitions that are only of interest to the actual
     454% * service daemon and client stubs. Normal users of NIS will not include
     455% * this file.
     456% *
     457% * NOTE : This include file is automatically created by a combination
     458% * of rpcgen and sed. DO NOT EDIT IT, change the nis.x file instead
     459% * and then remake this file.
     460% */
     461%#ifndef __nis_3_h
     462%#define __nis_3_h
     463%#ifdef __cplusplus
     464%extern "C" {
     465%#endif
     466#endif
  • cpukit/librpc/include/rpcsvc/nis_cache.x

    r0ab65474 rdf49c60  
     1%/*
     2% * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
     3% * unrestricted use provided that this legend is included on all tape
     4% * media and as a part of the software program in whole or part.  Users
     5% * may copy or modify Sun RPC without charge, but are not authorized
     6% * to license or distribute it to anyone else except as part of a product or
     7% * program developed by the user or with the express written consent of
     8% * Sun Microsystems, Inc.
     9% *
     10% * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
     11% * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
     12% * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
     13% *
     14% * Sun RPC is provided with no support and without any obligation on the
     15% * part of Sun Microsystems, Inc. to assist in its use, correction,
     16% * modification or enhancement.
     17% *
     18% * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
     19% * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
     20% * OR ANY PART THEREOF.
     21% *
     22% * In no event will Sun Microsystems, Inc. be liable for any lost revenue
     23% * or profits or other special, indirect and consequential damages, even if
     24% * Sun has been advised of the possibility of such damages.
     25% *
     26% * Sun Microsystems, Inc.
     27% * 2550 Garcia Avenue
     28% * Mountain View, California  94043
     29% */
     30
     31/*
     32 *      nis_cache.x
     33 *
     34 *      Copyright (c) 1988-1992 Sun Microsystems Inc
     35 *      All Rights Reserved.
     36 */
     37
     38/* From: %#pragma ident "@(#)nis_cache.x        1.11    94/05/03 SMI" */
     39
     40#ifndef RPC_HDR
     41%#ifndef lint
     42%static const char rcsid[] =
     43%  "$FreeBSD: src/include/rpcsvc/nis_cache.x,v 1.3 1999/08/27 23:45:09 peter Exp $";
     44%#endif /* not lint */
     45#endif
     46
     47#ifdef RPC_HDR
     48%#include <rpc/types.h>
     49%#include <rpcsvc/nis.h>
     50%
     51%/* default cache file */
     52%#define CACHEFILE "/var/nis/NIS_SHARED_DIRCACHE"
     53%
     54%/* clients have to read-lock the cache file, and SVR4 locking requires that */
     55%/*   the file be writable, but we don't want a world-writable cache file.   */
     56%/*   So... everyone agrees to use a different, world-writable file for the  */
     57%/*   locking operations, but the data is in CACHEFILE.                      */
     58%#define CACHELOCK "/usr/tmp/.NIS_DIR_CACHELOCK"
     59%
     60%/* the file containing one trusted XDR'ed directory object.
     61% * This has to be present for the system to work.
     62% */
     63%#define COLD_START_FILE "/var/nis/NIS_COLD_START"
     64%
     65%enum pc_status {HIT, MISS, NEAR_MISS};
     66%
     67%extern int __nis_debuglevel;
     68%
     69%
     70#endif
     71
     72#ifdef RPC_CLNT
     73#ifdef SOLARIS
     74%#include "../gen/nis_clnt.h"
     75#else
     76%#include "nis.h"
     77#endif
     78#endif
     79
     80program CACHEPROG {
     81        version CACHE_VER_1 {
     82                void NIS_CACHE_ADD_ENTRY(fd_result) = 1;
     83                void NIS_CACHE_REMOVE_ENTRY(directory_obj) = 2;
     84                void NIS_CACHE_READ_COLDSTART(void) = 3;
     85                void NIS_CACHE_REFRESH_ENTRY(string<>) = 4;
     86        } = 1;
     87} = 100301;
  • cpukit/librpc/include/rpcsvc/nis_callback.x

    r0ab65474 rdf49c60  
     1%/*
     2% * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
     3% * unrestricted use provided that this legend is included on all tape
     4% * media and as a part of the software program in whole or part.  Users
     5% * may copy or modify Sun RPC without charge, but are not authorized
     6% * to license or distribute it to anyone else except as part of a product or
     7% * program developed by the user or with the express written consent of
     8% * Sun Microsystems, Inc.
     9% *
     10% * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
     11% * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
     12% * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
     13% *
     14% * Sun RPC is provided with no support and without any obligation on the
     15% * part of Sun Microsystems, Inc. to assist in its use, correction,
     16% * modification or enhancement.
     17% *
     18% * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
     19% * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
     20% * OR ANY PART THEREOF.
     21% *
     22% * In no event will Sun Microsystems, Inc. be liable for any lost revenue
     23% * or profits or other special, indirect and consequential damages, even if
     24% * Sun has been advised of the possibility of such damages.
     25% *
     26% * Sun Microsystems, Inc.
     27% * 2550 Garcia Avenue
     28% * Mountain View, California  94043
     29% */
     30
     31/*
     32 *      nis_callback.x
     33 *
     34 *      Copyright (c) 1988-1992 Sun Microsystems Inc
     35 *      All Rights Reserved.
     36 */
     37
     38/* From: %#pragma ident "@(#)nis_callback.x     1.7     94/05/03 SMI" */
     39
     40#ifndef RPC_HDR
     41%#ifndef lint
     42%static const char rcsid[] =
     43%  "$FreeBSD: src/include/rpcsvc/nis_callback.x,v 1.3 1999/08/27 23:45:09 peter Exp $";
     44%#endif /* not lint */
     45#endif
     46
     47/*
     48 * "@(#)zns_cback.x 1.2 90/09/10 Copyr 1990 Sun Micro"
     49 *
     50 * RPCL description of the Callback Service.
     51 */
     52
     53#ifdef RPC_HDR
     54%#include <rpcsvc/nis.h>
     55#endif
     56#ifdef RPC_XDR
     57#ifdef SOLARIS
     58%#include "nis_clnt.h"
     59#else
     60%#include "nis.h"
     61#endif
     62#endif
     63
     64typedef nis_object      *obj_p;
     65
     66struct cback_data {
     67        obj_p           entries<>;      /* List of objects */
     68};
     69
     70program CB_PROG {
     71        version CB_VERS {
     72                bool    CBPROC_RECEIVE(cback_data) = 1;
     73                void    CBPROC_FINISH(void) = 2;
     74                void    CBPROC_ERROR(nis_error) = 3;
     75        } = 1;
     76} = 100302;
  • cpukit/librpc/include/rpcsvc/nis_db.h

    r0ab65474 rdf49c60  
     1/*
     2 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
     3 * unrestricted use provided that this legend is included on all tape
     4 * media and as a part of the software program in whole or part.  Users
     5 * may copy or modify Sun RPC without charge, but are not authorized
     6 * to license or distribute it to anyone else except as part of a product or
     7 * program developed by the user.
     8 *
     9 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
     10 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
     11 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
     12 *
     13 * Sun RPC is provided with no support and without any obligation on the
     14 * part of Sun Microsystems, Inc. to assist in its use, correction,
     15 * modification or enhancement.
     16 *
     17 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
     18 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
     19 * OR ANY PART THEREOF.
     20 *
     21 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
     22 * or profits or other special, indirect and consequential damages, even if
     23 * Sun has been advised of the possibility of such damages.
     24 *
     25 * Sun Microsystems, Inc.
     26 * 2550 Garcia Avenue
     27 * Mountain View, California  94043
     28 *
     29 * $FreeBSD: src/include/rpcsvc/nis_db.h,v 1.5 1999/08/27 23:45:09 peter Exp $
     30 */
     31
     32/*
     33 * Copyright (c) 1991, by Sun Microsystems Inc.
     34 */
     35
     36/*
     37 * This header file defines the interface to the NIS database. All
     38 * implementations of the database must export at least these routines.
     39 * They must also follow the conventions set herein. See the implementors
     40 * guide for specific semantics that are required.
     41 */
     42
     43#ifndef _RPCSVC_NIS_DB_H
     44#define _RPCSVC_NIS_DB_H
     45
     46
     47/* From: #pragma ident  "@(#)nis_db.h   1.8     94/05/03 SMI" */
     48
     49/*
     50 * Note: although the version of <rpcsvc/nis_db.h> shipped with Solaris
     51 * 2.5/2.5.x is actually older than this one (according to the ident
     52 * string), it contains changes and a few added functions. Those changes
     53 * have been hand merged into this file to bring it up to date.
     54 */
     55
     56#include <rpc/rpc.h>
     57#include <rpcsvc/nis.h>
     58
     59#ifdef  __cplusplus
     60extern "C" {
     61#endif
     62
     63enum db_status {
     64        DB_SUCCESS = 0,
     65        DB_NOTFOUND = 1,
     66        DB_NOTUNIQUE = 2,
     67        DB_BADTABLE = 3,
     68        DB_BADQUERY = 4,
     69        DB_BADOBJECT = 5,
     70        DB_MEMORY_LIMIT = 6,
     71        DB_STORAGE_LIMIT = 7,
     72        DB_INTERNAL_ERROR = 8
     73};
     74typedef enum db_status db_status;
     75
     76enum db_action {
     77        DB_LOOKUP = 0,
     78        DB_REMOVE = 1,
     79        DB_ADD = 2,
     80        DB_FIRST = 3,
     81        DB_NEXT = 4,
     82        DB_ALL = 5,
     83        DB_RESET_NEXT = 6
     84};
     85typedef enum db_action db_action;
     86
     87typedef entry_obj *entry_object_p;
     88
     89typedef struct {
     90        u_int db_next_desc_len;
     91        char *db_next_desc_val;
     92} db_next_desc;
     93
     94struct db_result {
     95        db_status status;
     96        db_next_desc nextinfo;
     97        struct {
     98                u_int objects_len;
     99                entry_object_p *objects_val;
     100        } objects;
     101        long ticks;
     102};
     103typedef struct db_result db_result;
     104
     105/*
     106 * Prototypes for the database functions.
     107 */
     108
     109#if (__STDC__)
     110
     111extern bool_t db_initialize(char *);
     112#ifdef ORIGINAL_DECLS
     113extern bool_t db_create_table(char *, table_obj *);
     114extern bool_t db_destroy_table(char *);
     115#else
     116extern db_status db_create_table(char *, table_obj *);
     117extern db_status db_destroy_table(char *);
     118#endif
     119extern db_result *db_first_entry(char *, int, nis_attr *);
     120extern db_result *db_next_entry(char *, db_next_desc *);
     121extern db_result *db_reset_next_entry(char *, db_next_desc *);
     122extern db_result *db_list_entries(char *, int, nis_attr *);
     123extern db_result *db_add_entry(char *, int,  nis_attr *, entry_obj *);
     124extern db_result *db_remove_entry(char *, int, nis_attr *);
     125extern db_status db_checkpoint(char *);
     126extern db_status db_standby(char *);
     127#ifndef ORIGINAL_DECLS
     128extern db_status db_table_exists(char *);
     129extern db_status db_unload_table(char *);
     130extern void db_free_result(db_result *);
     131#endif
     132
     133#else /* Non-prototype definitions */
     134
     135extern bool_t db_initialize();
     136#ifdef ORIGINAL_DECLS
     137extern bool_t db_create_table();
     138extern bool_t db_destroy_table();
     139#else
     140extern db_status db_create_table();
     141extern db_status db_destroy_table();
     142#endif
     143extern db_result *db_first_entry();
     144extern db_result *db_next_entry();
     145extern db_result *db_reset_next_entry();
     146extern db_result *db_list_entries();
     147extern db_result *db_add_entry();
     148extern db_result *db_remove_entry();
     149extern db_status db_checkpoint();
     150extern db_status db_standby();
     151#ifndef ORIGINAL_DECLS
     152extern db_status db_table_exists();
     153extern db_status db_unload_table();
     154extern void db_free_result();
     155#endif
     156#endif  /* __STDC__ */
     157
     158#ifdef __cplusplus
     159}
     160#endif
     161
     162#endif  /* _RPCSVC_NIS_DB_H */
  • cpukit/librpc/include/rpcsvc/nis_object.x

    r0ab65474 rdf49c60  
     1%/*
     2% * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
     3% * unrestricted use provided that this legend is included on all tape
     4% * media and as a part of the software program in whole or part.  Users
     5% * may copy or modify Sun RPC without charge, but are not authorized
     6% * to license or distribute it to anyone else except as part of a product or
     7% * program developed by the user or with the express written consent of
     8% * Sun Microsystems, Inc.
     9% *
     10% * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
     11% * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
     12% * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
     13% *
     14% * Sun RPC is provided with no support and without any obligation on the
     15% * part of Sun Microsystems, Inc. to assist in its use, correction,
     16% * modification or enhancement.
     17% *
     18% * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
     19% * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
     20% * OR ANY PART THEREOF.
     21% *
     22% * In no event will Sun Microsystems, Inc. be liable for any lost revenue
     23% * or profits or other special, indirect and consequential damages, even if
     24% * Sun has been advised of the possibility of such damages.
     25% *
     26% * Sun Microsystems, Inc.
     27% * 2550 Garcia Avenue
     28% * Mountain View, California  94043
     29% */
     30
     31/*
     32 *      nis_object.x
     33 *
     34 *      Copyright (c) 1988-1992 Sun Microsystems Inc
     35 *      All Rights Reserved.
     36 */
     37
     38/* From: %#pragma ident "@(#)nis_object.x       1.10    94/05/03 SMI" */
     39
     40#if RPC_HDR
     41%
     42%#ifndef __nis_object_h
     43%#define __nis_object_h
     44%
     45#endif
     46/*
     47 *      This file defines the format for a NIS object in RPC language.
     48 * It is included by the main .x file and the database access protocol
     49 * file. It is common because both of them need to deal with the same
     50 * type of object. Generating the actual code though is a bit messy because
     51 * the nis.x file and the nis_dba.x file will generate xdr routines to
     52 * encode/decode objects when only one set is needed. Such is life when
     53 * one is using rpcgen.
     54 *
     55 * Note, the protocol doesn't specify any limits on such things as
     56 * maximum name length, number of attributes, etc. These are enforced
     57 * by the database backend. When you hit them you will no. Also see
     58 * the db_getlimits() function for fetching the limit values.
     59 *
     60 */
     61
     62/* Some manifest constants, chosen to maximize flexibility without
     63 * plugging the wire full of data.
     64 */
     65const NIS_MAXSTRINGLEN = 255;
     66const NIS_MAXNAMELEN   = 1024;
     67const NIS_MAXATTRNAME  = 32;
     68const NIS_MAXATTRVAL   = 2048;
     69const NIS_MAXCOLUMNS   = 64;
     70const NIS_MAXATTR      = 16;
     71const NIS_MAXPATH      = 1024;
     72const NIS_MAXREPLICAS  = 128;
     73const NIS_MAXLINKS     = 16;
     74
     75const NIS_PK_NONE      = 0;     /* no public key (unix/sys auth) */
     76const NIS_PK_DH        = 1;     /* Public key is Diffie-Hellman type */
     77const NIS_PK_RSA       = 2;     /* Public key if RSA type */
     78const NIS_PK_KERB      = 3;     /* Use kerberos style authentication */
     79
     80/*
     81 * The fundamental name type of NIS. The name may consist of two parts,
     82 * the first being the fully qualified name, and the second being an
     83 * optional set of attribute/value pairs.
     84 */
     85struct nis_attr {
     86        string  zattr_ndx<>;    /* name of the index            */
     87        opaque  zattr_val<>;    /* Value for the attribute.     */
     88};
     89
     90typedef string nis_name<>;      /* The NIS name itself. */
     91
     92/* NIS object types are defined by the following enumeration. The numbers
     93 * they use are based on the following scheme :
     94 *                   0 - 1023 are reserved for Sun,
     95 *              1024 - 2047 are defined to be private to a particular tree.
     96 *              2048 - 4095 are defined to be user defined.
     97 *              4096 - ...  are reserved for future use.
     98 */
     99
     100enum zotypes {
     101        BOGUS_OBJ       = 0,    /* Uninitialized object structure       */
     102        NO_OBJ          = 1,    /* NULL object (no data)                */
     103        DIRECTORY_OBJ   = 2,    /* Directory object describing domain   */
     104        GROUP_OBJ       = 3,    /* Group object (a list of names)       */
     105        TABLE_OBJ       = 4,    /* Table object (a database schema)     */
     106        ENTRY_OBJ       = 5,    /* Entry object (a database record)     */
     107        LINK_OBJ        = 6,    /* A name link.                         */
     108        PRIVATE_OBJ     = 7     /* Private object (all opaque data)     */
     109};
     110
     111/*
     112 * The types of Name services NIS knows about. They are enumerated
     113 * here. The Binder code will use this type to determine if it has
     114 * a set of library routines that will access the indicated name service.
     115 */
     116enum nstype {
     117        UNKNOWN = 0,
     118        NIS = 1,        /* Nis Plus Service             */
     119        SUNYP = 2,      /* Old NIS Service              */
     120        IVY = 3,        /* Nis Plus Plus Service        */
     121        DNS = 4,        /* Domain Name Service          */
     122        X500 = 5,       /* ISO/CCCIT X.500 Service      */
     123        DNANS = 6,      /* Digital DECNet Name Service  */
     124        XCHS = 7,       /* Xerox ClearingHouse Service  */
     125        CDS= 8
     126};
     127
     128/*
     129 * DIRECTORY - The name service object. These objects identify other name
     130 * servers that are serving some portion of the name space. Each has a
     131 * type associated with it. The resolver library will note whether or not
     132 * is has the needed routines to access that type of service.
     133 * The oarmask structure defines an access rights mask on a per object
     134 * type basis for the name spaces. The only bits currently used are
     135 * create and destroy. By enabling or disabling these access rights for
     136 * a specific object type for a one of the accessor entities (owner,
     137 * group, world) the administrator can control what types of objects
     138 * may be freely added to the name space and which require the
     139 * administrator's approval.
     140 */
     141struct oar_mask {
     142        u_long  oa_rights;      /* Access rights mask   */
     143        zotypes oa_otype;       /* Object type          */
     144};
     145
     146struct endpoint {
     147        string          uaddr<>;
     148        string          family<>;   /* Transport family (INET, OSI, etc) */
     149        string          proto<>;    /* Protocol (TCP, UDP, CLNP,  etc)   */
     150};
     151
     152/*
     153 * Note: pkey is a netobj which is limited to 1024 bytes which limits the
     154 * keysize to 8192 bits. This is consider to be a reasonable limit for
     155 * the expected lifetime of this service.
     156 */
     157struct nis_server {
     158        nis_name        name;           /* Principal name of the server  */
     159        endpoint        ep<>;           /* Universal addr(s) for server  */
     160        u_long          key_type;       /* Public key type               */
     161        netobj          pkey;           /* server's public key           */
     162};
     163
     164struct directory_obj {
     165        nis_name   do_name;      /* Name of the directory being served   */
     166        nstype     do_type;      /* one of NIS, DNS, IVY, YP, or X.500   */
     167        nis_server do_servers<>; /* <0> == Primary name server           */
     168        u_long     do_ttl;       /* Time To Live (for caches)            */
     169        oar_mask   do_armask<>;  /* Create/Destroy rights by object type */
     170};
     171
     172/*
     173 * ENTRY - This is one row of data from an information base.
     174 * The type value is used by the client library to convert the entry to
     175 * it's internal structure representation. The Table name is a back pointer
     176 * to the table where the entry is stored. This allows the client library
     177 * to determine where to send a request if the client wishes to change this
     178 * entry but got to it through a LINK rather than directly.
     179 * If the entry is a "standalone" entry then this field is void.
     180 */
     181const EN_BINARY   = 1;  /* Indicates value is binary data       */
     182const EN_CRYPT    = 2;  /* Indicates the value is encrypted     */
     183const EN_XDR      = 4;  /* Indicates the value is XDR encoded   */
     184const EN_MODIFIED = 8;  /* Indicates entry is modified.         */
     185const EN_ASN1     = 64; /* Means contents use ASN.1 encoding    */
     186
     187struct entry_col {
     188        u_long  ec_flags;       /* Flags for this value */
     189        opaque  ec_value<>;     /* It's textual value   */
     190};
     191
     192struct entry_obj {
     193        string  en_type<>;      /* Type of entry such as "passwd" */
     194        entry_col en_cols<>;    /* Value for the entry            */
     195};
     196
     197/*
     198 * GROUP - The group object contains a list of NIS principal names. Groups
     199 * are used to authorize principals. Each object has a set of access rights
     200 * for members of its group. Principal names in groups are in the form
     201 * name.directory and recursive groups are expressed as @groupname.directory
     202 */
     203struct group_obj {
     204        u_long          gr_flags;       /* Flags controlling group      */
     205        nis_name        gr_members<>;   /* List of names in group       */
     206};
     207
     208/*
     209 * LINK - This is the LINK object. It is quite similar to a symbolic link
     210 * in the UNIX filesystem. The attributes in the main object structure are
     211 * relative to the LINK data and not what it points to (like the file system)
     212 * "modify" privleges here indicate the right to modify what the link points
     213 * at and not to modify that actual object pointed to by the link.
     214 */
     215struct link_obj {
     216        zotypes  li_rtype;      /* Real type of the object      */
     217        nis_attr li_attrs<>;    /* Attribute/Values for tables  */
     218        nis_name li_name;       /* The object's real NIS name   */
     219};
     220
     221/*
     222 * TABLE - This is the table object. It implements a simple
     223 * data base that applications and use for configuration or
     224 * administration purposes. The role of the table is to group together
     225 * a set of related entries. Tables are the simple database component
     226 * of NIS. Like many databases, tables are logically divided into columns
     227 * and rows. The columns are labeled with indexes and each ENTRY makes
     228 * up a row. Rows may be addressed within the table by selecting one
     229 * or more indexes, and values for those indexes. Each row which has
     230 * a value for the given index that matches the desired value is returned.
     231 * Within the definition of each column there is a flags variable, this
     232 * variable contains flags which determine whether or not the column is
     233 * searchable, contains binary data, and access rights for the entry objects
     234 * column value.
     235 */
     236
     237const TA_BINARY     = 1;        /* Means table data is binary           */
     238const TA_CRYPT      = 2;        /* Means value should be encrypted      */
     239const TA_XDR        = 4;        /* Means value is XDR encoded           */
     240const TA_SEARCHABLE = 8;        /* Means this column is searchable      */
     241const TA_CASE       = 16;       /* Means this column is Case Sensitive  */
     242const TA_MODIFIED   = 32;       /* Means this columns attrs are modified*/
     243const TA_ASN1       = 64;       /* Means contents use ASN.1 encoding     */
     244
     245struct table_col {
     246        string  tc_name<64>;    /* Column Name             */
     247        u_long  tc_flags;       /* control flags           */
     248        u_long  tc_rights;      /* Access rights mask      */
     249};
     250
     251struct table_obj {
     252        string    ta_type<64>;   /* Table type such as "passwd" */
     253        int       ta_maxcol;     /* Total number of columns     */
     254        u_char    ta_sep;        /* Separator character         */
     255        table_col ta_cols<>;     /* The number of table indexes */
     256        string    ta_path<>;     /* A search path for this table */
     257};
     258
     259/*
     260 * This union joins together all of the currently known objects.
     261 */
     262union objdata switch (zotypes zo_type) {
     263        case DIRECTORY_OBJ :
     264                struct directory_obj di_data;
     265        case GROUP_OBJ :
     266                struct group_obj gr_data;
     267        case TABLE_OBJ :
     268                struct table_obj ta_data;
     269        case ENTRY_OBJ:
     270                struct entry_obj en_data;
     271        case LINK_OBJ :
     272                struct link_obj li_data;
     273        case PRIVATE_OBJ :
     274                opaque  po_data<>;
     275        case NO_OBJ :
     276                void;
     277        case BOGUS_OBJ :
     278                void;
     279        default :
     280                void;
     281};
     282
     283/*
     284 * This is the basic NIS object data type. It consists of a generic part
     285 * which all objects contain, and a specialized part which varies depending
     286 * on the type of the object. All of the specialized sections have been
     287 * described above. You might have wondered why they all start with an
     288 * integer size, followed by the useful data. The answer is, when the
     289 * server doesn't recognize the type returned it treats it as opaque data.
     290 * And the definition for opaque data is {int size; char *data;}. In this
     291 * way, servers and utility routines that do not understand a given type
     292 * may still pass it around. One has to be careful in setting
     293 * this variable accurately, it must take into account such things as
     294 * XDR padding of structures etc. The best way to set it is to note one's
     295 * position in the XDR encoding stream, encode the structure, look at the
     296 * new position and calculate the size.
     297 */
     298struct nis_oid {
     299        u_long  ctime;          /* Time of objects creation     */
     300        u_long  mtime;          /* Time of objects modification */
     301};
     302
     303struct nis_object {
     304        nis_oid  zo_oid;        /* object identity verifier.            */
     305        nis_name zo_name;       /* The NIS name for this object         */
     306        nis_name zo_owner;      /* NIS name of object owner.            */
     307        nis_name zo_group;      /* NIS name of access group.            */
     308        nis_name zo_domain;     /* The administrator for the object     */
     309        u_long   zo_access;     /* Access rights (owner, group, world)  */
     310        u_long   zo_ttl;        /* Object's time to live in seconds.    */
     311        objdata  zo_data;       /* Data structure for this type         */
     312};
     313#if RPC_HDR
     314%
     315%#endif /* if __nis_object_h */
     316%
     317#endif
  • cpukit/librpc/include/rpcsvc/nis_tags.h

    r0ab65474 rdf49c60  
     1/*
     2 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
     3 * unrestricted use provided that this legend is included on all tape
     4 * media and as a part of the software program in whole or part.  Users
     5 * may copy or modify Sun RPC without charge, but are not authorized
     6 * to license or distribute it to anyone else except as part of a product or
     7 * program developed by the user.
     8 *
     9 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
     10 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
     11 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
     12 *
     13 * Sun RPC is provided with no support and without any obligation on the
     14 * part of Sun Microsystems, Inc. to assist in its use, correction,
     15 * modification or enhancement.
     16 *
     17 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
     18 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
     19 * OR ANY PART THEREOF.
     20 *
     21 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
     22 * or profits or other special, indirect and consequential damages, even if
     23 * Sun has been advised of the possibility of such damages.
     24 *
     25 * Sun Microsystems, Inc.
     26 * 2550 Garcia Avenue
     27 * Mountain View, California  94043
     28 */
     29
     30/*
     31 * Copyright (c) 1991, Sun Microsystems Inc.
     32 */
     33
     34/*
     35 *      nis_tags.h
     36 *
     37 *      This file contains the tags and statistics definitions. It is
     38 *      automatically included by nis.h
     39 */
     40
     41#ifndef _RPCSVC_NIS_TAGS_H
     42#define _RPCSVC_NIS_TAGS_H
     43
     44/* From: #pragma ident  "@(#)nis_tags.h 1.10    94/05/03 SMI" */
     45/* from file: zns_tags.h        1.7 Copyright (c) 1990 Sun Microsystems */
     46
     47#ifdef  __cplusplus
     48extern "C" {
     49#endif
     50
     51#ifndef ORIGINAL_DECLS
     52#define         NIS_DIR "data"
     53#endif
     54
     55/* Lookup and List function flags */
     56#define FOLLOW_LINKS    (1<<0)  /* Follow link objects                  */
     57#define FOLLOW_PATH     (1<<1)  /* Follow the path in a table           */
     58#define HARD_LOOKUP     (1<<2)  /* Block until successful               */
     59#define ALL_RESULTS     (1<<3)  /* Retrieve all results                 */
     60#define NO_CACHE        (1<<4)  /* Do not return 'cached' results       */
     61#define MASTER_ONLY     (1<<5)  /* Get value only from master server    */
     62#define EXPAND_NAME     (1<<6)  /* Expand partitially qualified names   */
     63
     64/* Semantic modification for table operations flags */
     65#define RETURN_RESULT   (1<<7)  /* Return resulting object to client    */
     66#define ADD_OVERWRITE   (1<<8)  /* Allow overwrites on ADD              */
     67#define REM_MULTIPLE    (1<<9)  /* Allow wildcard deletes               */
     68#define MOD_SAMEOBJ     (1<<10) /* Check modified object before write   */
     69#define ADD_RESERVED    (1<<11) /* Spare ADD semantic                   */
     70#define REM_RESERVED    (1<<12) /* Spare REM semantic                   */
     71#ifdef ORIGINAL_DECLS
     72#define MOD_RESERVED    (1<<13) /* Spare MOD semantic                   */
     73#else
     74#define MOD_EXCLUSIVE   (1<<13) /* Modify no overwrite on modified keys */
     75#endif
     76
     77/* Transport specific modifications to the operation */
     78#define USE_DGRAM       (1<<16) /* Use a datagram transport             */
     79#define NO_AUTHINFO     (1<<17) /* Don't bother attaching auth info     */
     80
     81/*
     82 * Declarations for "standard" NIS+ tags
     83 * State variable tags have values      0 - 2047
     84 * Statistic tags have values           2048 - 65535
     85 * User Tags have values                >2^16
     86 */
     87#define TAG_DEBUG       1       /* set debug level              */
     88#define TAG_STATS       2       /* Enable/disable statistics    */
     89#define TAG_GCACHE      3       /* Flush the Group Cache        */
     90#ifndef ORIGINAL_DECLS
     91#define TAG_GCACHE_ALL  TAG_GCACHE
     92#endif
     93#define TAG_DCACHE      4       /* Flush the directory cache    */
     94#ifndef ORIGINAL_DECLS
     95#define TAG_DCACHE_ONE  TAG_DCACHE
     96#endif
     97#define TAG_OCACHE      5       /* Flush the Object Cache       */
     98#define TAG_SECURE      6       /* Set the security level       */
     99#ifndef ORIGINAL_DECLS
     100#define TAG_TCACHE_ONE  7       /* Flush the table cache        */
     101#define TAG_DCACHE_ALL  8       /* Flush entire directory cache */
     102#define TAG_TCACHE_ALL  9       /* Flush entire table cache     */
     103#define TAG_GCACHE_ONE  10      /* Flush one group object       */
     104#define TAG_DCACHE_ONE_REFRESH 11 /* Flush and refresh one DO   */
     105#endif
     106
     107#define TAG_OPSTATS     2048    /* NIS+ operations statistics   */
     108#define TAG_THREADS     2049    /* Child process/thread status  */
     109#define TAG_HEAP        2050    /* Heap usage statistics        */
     110#define TAG_UPDATES     2051    /* Updates to this service      */
     111#define TAG_VISIBLE     2052    /* First update that isn't replicated */
     112#define TAG_S_DCACHE    2053    /* Directory cache statistics   */
     113#define TAG_S_OCACHE    2054    /* Object cache statistics      */
     114#define TAG_S_GCACHE    2055    /* Group cache statistics       */
     115#define TAG_S_STORAGE   2056    /* Group cache statistics       */
     116#define TAG_UPTIME      2057    /* Time that server has been up */
     117#ifndef ORIGINAL_DECLS
     118#define TAG_DIRLIST     2058    /* Dir served by this server    */
     119#define TAG_NISCOMPAT   2059    /* Whether supports NIS compat mode */
     120#define TAG_DNSFORWARDING 2060  /* Whether DNS forwarding supported*/
     121#define TAG_SECURITY_LEVEL 2061 /* Security level of the server */
     122#define TAG_ROOTSERVER  2062    /* Whether root server          */
     123#endif
     124
     125/*
     126 * Declarations for the Group object flags. Currently
     127 * there are only 3.
     128 */
     129#define IMPMEM_GROUPS  1        /* Implicit Membership allowed  */
     130#define RECURS_GROUPS  2        /* Recursive Groups allowed     */
     131#define NEGMEM_GROUPS  4        /* Negative Groups allowed      */
     132
     133#ifdef  __cplusplus
     134}
     135#endif
     136
     137#endif  /* _RPCSVC_NIS_TAGS_H */
  • cpukit/librpc/include/rpcsvc/nislib.h

    r0ab65474 rdf49c60  
     1/*
     2 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
     3 * unrestricted use provided that this legend is included on all tape
     4 * media and as a part of the software program in whole or part.  Users
     5 * may copy or modify Sun RPC without charge, but are not authorized
     6 * to license or distribute it to anyone else except as part of a product or
     7 * program developed by the user.
     8 *
     9 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
     10 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
     11 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
     12 *
     13 * Sun RPC is provided with no support and without any obligation on the
     14 * part of Sun Microsystems, Inc. to assist in its use, correction,
     15 * modification or enhancement.
     16 *
     17 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
     18 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
     19 * OR ANY PART THEREOF.
     20 *
     21 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
     22 * or profits or other special, indirect and consequential damages, even if
     23 * Sun has been advised of the possibility of such damages.
     24 *
     25 * Sun Microsystems, Inc.
     26 * 2550 Garcia Avenue
     27 * Mountain View, California  94043
     28 */
     29
     30/*
     31 * Copyright (c) 1991, Sun Microsystems Inc.
     32 */
     33
     34/*
     35 * This file contains the interfaces that are visible in the SunOS 5.x
     36 * implementation of NIS Plus. When using C++ the defined __cplusplus and
     37 * __STDC__ should both be true.
     38 */
     39
     40#ifndef _RPCSVC_NISLIB_H
     41#define _RPCSVC_NISLIB_H
     42
     43/* From: #pragma ident  "@(#)nislib.h   1.16    94/05/03 SMI" */
     44
     45#ifdef __cplusplus
     46extern "C" {
     47#endif
     48
     49struct signature {
     50        int signature_len;
     51        char *signature_val;
     52};
     53
     54#ifdef __STDC__
     55extern void nis_freeresult(nis_result *);
     56extern nis_result * nis_lookup(nis_name, u_long);
     57extern nis_result * nis_list(nis_name, u_long,
     58        int (*)(nis_name, nis_object *, void *), void *);
     59extern nis_result * nis_add(nis_name, nis_object *);
     60extern nis_result * nis_remove(nis_name, nis_object *);
     61extern nis_result * nis_modify(nis_name, nis_object *);
     62
     63extern nis_result * nis_add_entry(nis_name, nis_object *, u_long);
     64extern nis_result * nis_remove_entry(nis_name, nis_object *, u_long);
     65extern nis_result * nis_modify_entry(nis_name, nis_object *, u_long);
     66extern nis_result * nis_first_entry(nis_name);
     67extern nis_result * nis_next_entry(nis_name, netobj *);
     68
     69extern nis_error nis_mkdir(nis_name, nis_server *);
     70extern nis_error nis_rmdir(nis_name, nis_server *);
     71extern name_pos nis_dir_cmp(nis_name, nis_name);
     72
     73extern nis_name * nis_getnames(nis_name);
     74extern void nis_freenames(nis_name *);
     75extern nis_name nis_domain_of(nis_name);
     76extern nis_name nis_leaf_of(nis_name);
     77extern nis_name nis_leaf_of_r(const nis_name, char *, size_t);
     78extern nis_name nis_name_of(nis_name);
     79extern nis_name nis_local_group(void);
     80extern nis_name nis_local_directory(void);
     81extern nis_name nis_local_principal(void);
     82extern nis_name nis_local_host(void);
     83
     84extern void nis_destroy_object(nis_object *);
     85extern nis_object * nis_clone_object(nis_object *, nis_object *);
     86extern void nis_print_object(nis_object *);
     87
     88extern char * nis_sperrno(nis_error);
     89extern void nis_perror(nis_error, char *);
     90extern char * nis_sperror(nis_error, char *);
     91extern void nis_lerror(nis_error, char *);
     92
     93extern void nis_print_group_entry(nis_name);
     94extern bool_t nis_ismember(nis_name, nis_name);
     95extern nis_error nis_creategroup(nis_name, u_long);
     96extern nis_error nis_destroygroup(nis_name);
     97extern nis_error nis_addmember(nis_name, nis_name);
     98extern nis_error nis_removemember(nis_name, nis_name);
     99extern nis_error nis_verifygroup(nis_name);
     100
     101extern void nis_freeservlist(nis_server **);
     102extern nis_server ** nis_getservlist(nis_name);
     103extern nis_error nis_stats(nis_server *, nis_tag *, int, nis_tag **);
     104extern nis_error nis_servstate(nis_server *, nis_tag *, int, nis_tag **);
     105extern void nis_freetags(nis_tag *, int);
     106
     107extern nis_result * nis_checkpoint(nis_name);
     108extern void nis_ping(nis_name, u_long, nis_object *);
     109
     110/*
     111 * XXX: PLEASE NOTE THAT THE FOLLOWING FUNCTIONS ARE INTERNAL
     112 * TO NIS+ AND SHOULD NOT BE USED BY ANY APPLICATION PROGRAM.
     113 * THEIR SEMANTICS AND/OR SIGNATURE CAN CHANGE WITHOUT NOTICE.
     114 * SO, PLEASE DO NOT USE THEM.  YOU ARE WARNED!!!!
     115 */
     116
     117extern char ** __break_name(nis_name, int *);
     118extern int __name_distance(char **, char **);
     119extern nis_result * nis_make_error(nis_error, u_long, u_long, u_long, u_long);
     120extern nis_attr * __cvt2attr(int *, char **);
     121extern void nis_free_request(ib_request *);
     122extern nis_error nis_get_request(nis_name, nis_object *, netobj*, ib_request*);
     123extern nis_object * nis_read_obj(char *);
     124extern int nis_write_obj(char *, nis_object *);
     125extern int nis_in_table(nis_name, NIS_HASH_TABLE *, int *);
     126extern int nis_insert_item(NIS_HASH_ITEM *, NIS_HASH_TABLE *);
     127extern NIS_HASH_ITEM * nis_find_item(nis_name, NIS_HASH_TABLE *);
     128extern NIS_HASH_ITEM * nis_remove_item(nis_name, NIS_HASH_TABLE *);
     129extern void nis_insert_name(nis_name, NIS_HASH_TABLE *);
     130extern void nis_remove_name(nis_name, NIS_HASH_TABLE *);
     131extern CLIENT * nis_make_rpchandle(nis_server *, int, u_long, u_long, u_long,
     132                                                                int, int);
     133extern void * nis_get_static_storage(struct nis_sdata *, u_long, u_long);
     134extern char * nis_data(char *);
     135extern void nis_print_rights(u_long);
     136extern void nis_print_directory(directory_obj *);
     137extern void nis_print_group(group_obj *);
     138extern void nis_print_table(table_obj *);
     139extern void nis_print_link(link_obj *);
     140extern void nis_print_entry(entry_obj *);
     141extern nis_object * nis_get_object(char *, char *, char *, u_long, u_long,
     142                                                                    zotypes);
     143extern nis_server * __nis_init_callback(CLIENT *,
     144    int (*)(nis_name, nis_object *, void *), void *);
     145extern int nis_getdtblsize(void);
     146extern int __nis_run_callback(netobj *, u_long, struct timeval *, CLIENT *);
     147
     148extern log_result *nis_dumplog(nis_server *, nis_name, u_long);
     149extern log_result *nis_dump(nis_server *, nis_name,
     150    int (*)(nis_name, nis_object *, void *));
     151
     152extern bool_t __do_ismember(nis_name, nis_name,
     153    nis_result *(*)(nis_name, u_long));
     154extern nis_name __nis_map_group(nis_name);
     155extern nis_name __nis_map_group_r(nis_name, char*, size_t);
     156
     157extern nis_error __nis_CacheBind(char *, directory_obj *);
     158extern nis_error __nis_CacheSearch(char *, directory_obj *);
     159extern bool_t __nis_CacheRemoveEntry(directory_obj *);
     160extern void __nis_CacheRestart(void);
     161extern void __nis_CachePrint(void);
     162extern void __nis_CacheDumpStatistics(void);
     163extern bool_t writeColdStartFile(directory_obj *);
     164
     165extern CLIENT * __get_ti_clnt(char *, CLIENT *, char **, pid_t *);
     166extern int __strcmp_case_insens(char *, char *);
     167extern int __strncmp_case_insens(char *, char *);
     168
     169extern fd_result * nis_finddirectory(directory_obj *, nis_name);
     170extern int __start_clock(int);
     171extern u_long __stop_clock(int);
     172
     173/*
     174 * This particular function is part of the FreeBSD NIS+ implementation
     175 * only. Ideally it should be somewhere else, but it is used by both
     176 * rpc.nisd and nis_cachemgr, and there aren't that many headers common
     177 * to both programs.
     178 */
     179
     180extern struct signature *__nis_calculate_encrypted_cksum(unsigned char *, unsigned int, char *, int);
     181
     182#else
     183
     184/* Non-prototype definitions (old fashioned C) */
     185
     186extern void nis_freeresult();
     187extern nis_result * nis_lookup();
     188extern nis_result * nis_list();
     189extern nis_result * nis_add();
     190extern nis_result * nis_remove();
     191extern nis_result * nis_modify();
     192
     193extern nis_result * nis_add_entry();
     194extern nis_result * nis_remove_entry();
     195extern nis_result * nis_modify_entry();
     196extern nis_result * nis_first_entry();
     197extern nis_result * nis_next_entry();
     198
     199extern nis_error nis_mkdir();
     200extern nis_error nis_rmdir();
     201extern name_pos nis_dir_cmp();
     202
     203extern nis_name *nis_getnames();
     204extern void nis_freenames();
     205extern nis_name nis_domain_of();
     206extern nis_name nis_leaf_of();
     207extern nis_name nis_leaf_of_r();
     208extern nis_name nis_name_of();
     209extern nis_name nis_local_group();
     210extern nis_name nis_local_directory();
     211extern nis_name nis_local_principal();
     212extern nis_name nis_local_host();
     213
     214extern void nis_destroy_object();
     215extern nis_object * nis_clone_object();
     216extern void nis_print_object();
     217
     218extern char * nis_sperrno();
     219extern void nis_perror();
     220extern char * nis_sperror();
     221extern void nis_lerror();
     222
     223extern void nis_print_group_entry();
     224extern bool_t nis_ismember();
     225extern nis_error nis_creategroup();
     226extern nis_error nis_destroygroup();
     227extern nis_error nis_addmember();
     228extern nis_error nis_removemember();
     229extern nis_error nis_verifygroup();
     230
     231extern void nis_freeservlist();
     232extern nis_server ** nis_getservlist();
     233extern nis_error nis_stats();
     234extern nis_error nis_servstate();
     235extern void nis_freetags();
     236
     237extern nis_result * nis_checkpoint();
     238extern void nis_ping();
     239
     240/*
     241 * XXX: PLEASE NOTE THAT THE FOLLOWING FUNCTIONS ARE INTERNAL
     242 * TO NIS+ AND SHOULD NOT BE USED BY ANY APPLICATION PROGRAM.
     243 * THEIR SEMANTICS AND/OR SIGNATURE CAN CHANGE WITHOUT NOTICE.
     244 * SO, PLEASE DO NOT USE THEM.  YOU ARE WARNED!!!!
     245 */
     246extern char ** __break_name();
     247extern int __name_distance();
     248extern nis_result * nis_make_error();
     249extern nis_attr * __cvt2attr();
     250extern void nis_free_request();
     251extern nis_error nis_get_request();
     252extern nis_object * nis_read_obj();
     253extern int nis_write_obj();
     254extern int nis_in_table();
     255extern int nis_insert_item();
     256extern NIS_HASH_ITEM * nis_find_item();
     257extern NIS_HASH_ITEM * nis_remove_item();
     258extern void nis_insert_name();
     259extern void nis_remove_name();
     260extern CLIENT * nis_make_rpchandle();
     261extern void * nis_get_static_storage();
     262extern char * nis_data();
     263
     264extern void nis_print_rights();
     265extern void nis_print_directory();
     266extern void nis_print_group();
     267extern void nis_print_table();
     268extern void nis_print_link();
     269extern void nis_print_entry();
     270extern nis_object * nis_get_object();
     271
     272extern nis_server * __nis_init_callback();
     273extern int nis_getdtblsize();
     274extern int __nis_run_callback();
     275
     276extern log_result * nis_dump();
     277extern log_result * nis_dumplog();
     278
     279extern bool_t __do_ismember();
     280extern nis_name __nis_map_group();
     281extern nis_name __nis_map_group_r();
     282
     283
     284extern nis_error __nis_CacheBind();
     285extern directory_obj * __nis_CacheSearch();
     286extern bool_t __nis_CacheRemoveEntry();
     287extern void __nis_CacheRestart();
     288extern void __nis_CachePrint();
     289extern void __nis_CacheDumpStatistics();
     290extern bool_t writeColdStartFile();
     291
     292extern CLIENT * __get_ti_clnt();
     293extern int __strcmp_case_insens();
     294extern int __strncmp_case_insens();
     295
     296extern fd_result * nis_finddirectory();
     297extern int __start_clock();
     298extern u_long __stop_clock();
     299
     300/*
     301 * This particular function is part of the FreeBSD NIS+ implementation
     302 * only. Ideally it should be somewhere else, but it is used by both
     303 * rpc.nisd and nis_cachemgr, and there aren't that many headers common
     304 * to both programs.
     305 */
     306
     307extern struct signature *__nis_calculate_encrypted_cksum();
     308
     309#endif
     310
     311#define NUL '\0'
     312
     313#ifdef  __cplusplus
     314}
     315#endif
     316
     317#endif  /* _RPCSVC_NISLIB_H */
  • cpukit/librpc/include/rpcsvc/nlm_prot.x

    r0ab65474 rdf49c60  
     1/* @(#)nlm_prot.x       2.1 88/08/01 4.0 RPCSRC */
     2/* @(#)nlm_prot.x 1.8 87/09/21 Copyr 1987 Sun Micro */
     3
     4/*
     5 * Network lock manager protocol definition
     6 * Copyright (C) 1986 Sun Microsystems, Inc.
     7 *
     8 * protocol used between local lock manager and remote lock manager
     9 */
     10
     11#ifdef RPC_HDR
     12%#define LM_MAXSTRLEN   1024
     13%#define MAXNAMELEN     LM_MAXSTRLEN+1
     14#else
     15%#ifndef lint
     16%static const char rcsid[] =
     17%  "$FreeBSD: src/include/rpcsvc/nlm_prot.x,v 1.8 1999/08/27 23:45:10 peter Exp $";
     18%#endif /* not lint */
     19#endif
     20
     21/*
     22 * status of a call to the lock manager
     23 */
     24enum nlm_stats {
     25        nlm_granted = 0,
     26        nlm_denied = 1,
     27        nlm_denied_nolocks = 2,
     28        nlm_blocked = 3,
     29        nlm_denied_grace_period = 4
     30};
     31
     32struct nlm_holder {
     33        bool exclusive;
     34        int svid;
     35        netobj oh;
     36        unsigned l_offset;
     37        unsigned l_len;
     38};
     39
     40union nlm_testrply switch (nlm_stats stat) {
     41        case nlm_denied:
     42                struct nlm_holder holder;
     43        default:
     44                void;
     45};
     46
     47struct nlm_stat {
     48        nlm_stats stat;
     49};
     50
     51struct nlm_res {
     52        netobj cookie;
     53        nlm_stat stat;
     54};
     55
     56struct nlm_testres {
     57        netobj cookie;
     58        nlm_testrply stat;
     59};
     60
     61struct nlm_lock {
     62        string caller_name<LM_MAXSTRLEN>;
     63        netobj fh;              /* identify a file */
     64        netobj oh;              /* identify owner of a lock */
     65        int svid;               /* generated from pid for svid */
     66        unsigned l_offset;
     67        unsigned l_len;
     68};
     69
     70struct nlm_lockargs {
     71        netobj cookie;
     72        bool block;
     73        bool exclusive;
     74        struct nlm_lock alock;
     75        bool reclaim;           /* used for recovering locks */
     76        int state;              /* specify local status monitor state */
     77};
     78
     79struct nlm_cancargs {
     80        netobj cookie;         
     81        bool block;
     82        bool exclusive;
     83        struct nlm_lock alock;
     84};
     85
     86struct nlm_testargs {
     87        netobj cookie;         
     88        bool exclusive;
     89        struct nlm_lock alock;
     90};
     91
     92struct nlm_unlockargs {
     93        netobj cookie;         
     94        struct nlm_lock alock;
     95};
     96
     97
     98#ifdef RPC_HDR
     99%/*
     100% * The following enums are actually bit encoded for efficient
     101% * boolean algebra.... DON'T change them.....
     102% */
     103#endif
     104enum    fsh_mode {
     105        fsm_DN  = 0,    /* deny none */
     106        fsm_DR  = 1,    /* deny read */
     107        fsm_DW  = 2,    /* deny write */
     108        fsm_DRW = 3     /* deny read/write */
     109};
     110
     111enum    fsh_access {
     112        fsa_NONE = 0,   /* for completeness */
     113        fsa_R    = 1,   /* read only */
     114        fsa_W    = 2,   /* write only */
     115        fsa_RW   = 3    /* read/write */
     116};
     117
     118struct  nlm_share {
     119        string caller_name<LM_MAXSTRLEN>;
     120        netobj  fh;
     121        netobj  oh;
     122        fsh_mode        mode;
     123        fsh_access      access;
     124};
     125
     126struct  nlm_shareargs {
     127        netobj  cookie;
     128        nlm_share       share;
     129        bool    reclaim;
     130};
     131
     132struct  nlm_shareres {
     133        netobj  cookie;
     134        nlm_stats       stat;
     135        int     sequence;
     136};
     137
     138struct  nlm_notify {
     139        string name<MAXNAMELEN>;
     140        long state;
     141};
     142
     143/*
     144 * Over-the-wire protocol used between the network lock managers
     145 */
     146
     147program NLM_PROG {
     148        version NLM_VERS {
     149
     150                nlm_testres     NLM_TEST(struct nlm_testargs) = 1;
     151
     152                nlm_res         NLM_LOCK(struct nlm_lockargs) = 2;
     153
     154                nlm_res         NLM_CANCEL(struct nlm_cancargs) = 3;
     155                nlm_res         NLM_UNLOCK(struct nlm_unlockargs) =     4;
     156
     157                /*
     158                 * remote lock manager call-back to grant lock
     159                 */
     160                nlm_res         NLM_GRANTED(struct nlm_testargs)= 5;
     161                /*
     162                 * message passing style of requesting lock
     163                 */
     164                void            NLM_TEST_MSG(struct nlm_testargs) = 6;
     165                void            NLM_LOCK_MSG(struct nlm_lockargs) = 7;
     166                void            NLM_CANCEL_MSG(struct nlm_cancargs) =8;
     167                void            NLM_UNLOCK_MSG(struct nlm_unlockargs) = 9;
     168                void            NLM_GRANTED_MSG(struct nlm_testargs) = 10;
     169                void            NLM_TEST_RES(nlm_testres) = 11;
     170                void            NLM_LOCK_RES(nlm_res) = 12;
     171                void            NLM_CANCEL_RES(nlm_res) = 13;
     172                void            NLM_UNLOCK_RES(nlm_res) = 14;
     173                void            NLM_GRANTED_RES(nlm_res) = 15;
     174        } = 1;
     175
     176        version NLM_VERSX {
     177                nlm_shareres    NLM_SHARE(nlm_shareargs) = 20;
     178                nlm_shareres    NLM_UNSHARE(nlm_shareargs) = 21;
     179                nlm_res         NLM_NM_LOCK(nlm_lockargs) = 22;
     180                void            NLM_FREE_ALL(nlm_notify) = 23;
     181        } = 3;
     182
     183} = 100021;
     184
  • cpukit/librpc/include/rpcsvc/pmap_prot.x

    r0ab65474 rdf49c60  
     1%/*
     2% * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
     3% * unrestricted use provided that this legend is included on all tape
     4% * media and as a part of the software program in whole or part.  Users
     5% * may copy or modify Sun RPC without charge, but are not authorized
     6% * to license or distribute it to anyone else except as part of a product or
     7% * program developed by the user.
     8% *
     9% * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
     10% * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
     11% * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
     12% *
     13% * Sun RPC is provided with no support and without any obligation on the
     14% * part of Sun Microsystems, Inc. to assist in its use, correction,
     15% * modification or enhancement.
     16% *
     17% * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
     18% * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
     19% * OR ANY PART THEREOF.
     20% *
     21% * In no event will Sun Microsystems, Inc. be liable for any lost revenue
     22% * or profits or other special, indirect and consequential damages, even if
     23% * Sun has been advised of the possibility of such damages.
     24% *
     25% * Sun Microsystems, Inc.
     26% * 2550 Garcia Avenue
     27% * Mountain View, California  94043
     28% */
     29%/*
     30% * Copyright (c) 1984,1989 by Sun Microsystems, Inc.
     31% */
     32
     33%/* from pmap_prot.x */
     34
     35#ifdef RPC_HDR
     36%
     37%#pragma ident  "@(#)pmap_prot.x        1.6     94/04/29 SMI"
     38%
     39%#ifndef _KERNEL
     40%
     41#endif
     42
     43/*
     44 * Port Mapper Protocol Specification (in RPC Language)
     45 * derived from RFC 1057
     46 */
     47
     48%/*
     49% * Protocol for the local binder service, or pmap.
     50% *
     51% * Copyright (C) 1984, Sun Microsystems, Inc.
     52% *
     53% * The following procedures are supported by the protocol:
     54% *
     55% * PMAPPROC_NULL() returns ()
     56% *     takes nothing, returns nothing
     57% *
     58% * PMAPPROC_SET(struct pmap) returns (bool_t)
     59% *     TRUE is success, FALSE is failure.  Registers the tuple
     60% *     [prog, vers, prot, port].
     61% *
     62% * PMAPPROC_UNSET(struct pmap) returns (bool_t)
     63% *     TRUE is success, FALSE is failure.  Un-registers pair
     64% *     [prog, vers].  prot and port are ignored.
     65% *
     66% * PMAPPROC_GETPORT(struct pmap) returns (long unsigned).
     67% *     0 is failure.  Otherwise returns the port number where the pair
     68% *     [prog, vers] is registered.  It may lie!
     69% *
     70% * PMAPPROC_DUMP() RETURNS (struct pmaplist_ptr)
     71% *
     72% * PMAPPROC_CALLIT(unsigned, unsigned, unsigned, string<>)
     73% *     RETURNS (port, string<>);
     74% * usage: encapsulatedresults = PMAPPROC_CALLIT(prog, vers, proc,
     75% *                                             encapsulatedargs);
     76% *     Calls the procedure on the local machine.  If it is not registered,
     77% *     this procedure is quite; ie it does not return error information!!!
     78% *     This procedure only is supported on rpc/udp and calls via
     79% *     rpc/udp.  This routine only passes null authentication parameters.
     80% *     This file has no interface to xdr routines for PMAPPROC_CALLIT.
     81% *
     82% * The service supports remote procedure calls on udp/ip or tcp/ip socket 111.
     83% */
     84%
     85const PMAPPORT = 111;   /* portmapper port number */
     86%
     87%
     88%/*
     89% * A mapping of (program, version, protocol) to port number
     90% */
     91
     92struct pmap {
     93        unsigned long pm_prog;
     94        unsigned long pm_vers;
     95        unsigned long pm_prot;
     96        unsigned long pm_port;
     97};
     98#ifdef RPC_HDR
     99%
     100%typedef pmap PMAP;
     101%
     102#endif
     103%
     104%/*
     105% * Supported values for the "prot" field
     106% */
     107%
     108const PMAP_IPPROTO_TCP = 6;     /* protocol number for TCP/IP */
     109const PMAP_IPPROTO_UDP = 17;    /* protocol number for UDP/IP */
     110%
     111%
     112%/*
     113% * A list of mappings
     114% *
     115% * Below are two definitions for the pmaplist structure.  This is done because
     116% * xdr_pmaplist() is specified to take a struct pmaplist **, rather than a
     117% * struct pmaplist * that rpcgen would produce.  One version of the pmaplist
     118% * structure (actually called pm__list) is used with rpcgen, and the other is
     119% * defined only in the header file for compatibility with the specified
     120% * interface.
     121% */
     122
     123struct pm__list {
     124        pmap pml_map;
     125        struct pm__list *pml_next;
     126};
     127
     128typedef pm__list *pmaplist_ptr;         /* results of PMAPPROC_DUMP */
     129
     130#ifdef RPC_HDR
     131%
     132%typedef struct pm__list pmaplist;
     133%typedef struct pm__list PMAPLIST;
     134%
     135%#ifndef __cplusplus
     136%struct pmaplist {
     137%       PMAP pml_map;
     138%       struct pmaplist *pml_next;
     139%};
     140%#endif
     141%
     142%#ifdef __cplusplus
     143%extern "C" {
     144%#endif
     145%#ifdef __STDC__
     146%extern  bool_t xdr_pmaplist(XDR *, pmaplist**);
     147%#else /* K&R C */
     148%bool_t xdr_pmaplist();
     149%#endif
     150%#ifdef __cplusplus
     151%}
     152%#endif
     153%
     154#endif
     155
     156%
     157%/*
     158% * Arguments to callit
     159% */
     160
     161struct rmtcallargs {
     162        unsigned long prog;
     163        unsigned long vers;
     164        unsigned long proc;
     165        opaque args<>;
     166};
     167#ifdef RPC_HDR
     168%
     169%/*
     170% * Client-side only representation of rmtcallargs structure.
     171% *
     172% * The routine that XDRs the rmtcallargs structure must deal with the
     173% * opaque arguments in the "args" structure.  xdr_rmtcall_args() needs to be
     174% * passed the XDR routine that knows the args' structure.  This routine
     175% * doesn't need to go over-the-wire (and it wouldn't make sense anyway) since
     176% * the application being called knows the args structure already.  So we use a
     177% * different "XDR" structure on the client side, p_rmtcallargs, which includes
     178% * the args' XDR routine.
     179% */
     180%struct p_rmtcallargs {
     181%       u_long prog;
     182%       u_long vers;
     183%       u_long proc;
     184%       struct {
     185%               u_int args_len;
     186%               char *args_val;
     187%       } args;
     188%       xdrproc_t       xdr_args;       /* encodes args */
     189%};
     190%
     191#endif  /* def RPC_HDR */
     192%
     193%
     194%/*
     195% * Results of callit
     196% */
     197
     198struct rmtcallres {
     199        unsigned long port;
     200        opaque res<>;
     201};
     202#ifdef RPC_HDR
     203%
     204%/*
     205% * Client-side only representation of rmtcallres structure.
     206% */
     207%struct p_rmtcallres {
     208%       u_long port;
     209%       struct {
     210%               u_int res_len;
     211%               char *res_val;
     212%       } res;
     213%       xdrproc_t       xdr_res;        /* decodes res */
     214%};
     215%
     216#endif  /* def RPC_HDR */
     217
     218/*
     219 * Port mapper procedures
     220 */
     221
     222program PMAPPROG {
     223   version PMAPVERS {
     224        void
     225        PMAPPROC_NULL(void)     = 0;
     226
     227        bool
     228        PMAPPROC_SET(pmap)      = 1;
     229
     230        bool
     231        PMAPPROC_UNSET(pmap)    = 2;
     232
     233        unsigned long
     234        PMAPPROC_GETPORT(pmap)  = 3;
     235
     236        pmaplist_ptr
     237        PMAPPROC_DUMP(void)     = 4;
     238
     239        rmtcallres
     240        PMAPPROC_CALLIT(rmtcallargs)  = 5;
     241   } = 2;
     242} = 100000;
     243%
     244#ifdef RPC_HDR
     245%#define PMAPVERS_PROTO         ((u_long)2)
     246%#define PMAPVERS_ORIG          ((u_long)1)
     247%
     248%#else          /* ndef _KERNEL */
     249%
     250%#include <rpc/pmap_rmt.h>
     251%
     252%#ifdef __cplusplus
     253%extern "C" {
     254%#endif
     255%
     256%#define        PMAPPORT 111
     257%
     258%struct pmap {
     259%       long unsigned pm_prog;
     260%       long unsigned pm_vers;
     261%       long unsigned pm_prot;
     262%       long unsigned pm_port;
     263%};
     264%typedef struct pmap PMAP;
     265%#ifdef __STDC__
     266%extern bool_t xdr_pmap (XDR *, struct pmap *);
     267%#else
     268%extern bool_t xdr_pmap ();
     269%#endif
     270%
     271%struct pmaplist {
     272%       struct pmap pml_map;
     273%       struct pmaplist *pml_next;
     274%};
     275%typedef struct pmaplist PMAPLIST;
     276%typedef struct pmaplist *pmaplist_ptr;
     277%
     278%
     279%#ifdef __cplusplus
     280%}
     281%#endif
     282%
     283%#endif         /* ndef _KERNEL */
     284#endif
     285
  • cpukit/librpc/include/rpcsvc/rex.x

    r0ab65474 rdf49c60  
     1/*
     2 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
     3 * unrestricted use provided that this legend is included on all tape
     4 * media and as a part of the software program in whole or part.  Users
     5 * may copy or modify Sun RPC without charge, but are not authorized
     6 * to license or distribute it to anyone else except as part of a product or
     7 * program developed by the user.
     8 *
     9 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
     10 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
     11 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
     12 *
     13 * Sun RPC is provided with no support and without any obligation on the
     14 * part of Sun Microsystems, Inc. to assist in its use, correction,
     15 * modification or enhancement.
     16 *
     17 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
     18 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
     19 * OR ANY PART THEREOF.
     20 *
     21 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
     22 * or profits or other special, indirect and consequential damages, even if
     23 * Sun has been advised of the possibility of such damages.
     24 *
     25 * Sun Microsystems, Inc.
     26 * 2550 Garcia Avenue
     27 * Mountain View, California  94043
     28 */
     29
     30/*
     31 * Remote execution (rex) protocol specification
     32 */
     33
     34#ifndef RPC_HDR
     35%#ifndef lint
     36%/*static char sccsid[] = "from: @(#)rex.x 1.3 87/09/18 Copyr 1987 Sun Micro";*/
     37%/*static char sccsid[] = "from: @(#)rex.x      2.1 88/08/01 4.0 RPCSRC";*/
     38%static const char rcsid[] =
     39%  "$FreeBSD: src/include/rpcsvc/rex.x,v 1.6 1999/08/27 23:45:10 peter Exp $";
     40%#endif /* not lint */
     41#endif
     42
     43const STRINGSIZE = 1024;
     44typedef string rexstring<1024>;
     45
     46/*
     47 * values to pass to REXPROC_SIGNAL
     48 */
     49const SIGINT = 2;       /* interrupt */
     50
     51/*
     52 * Values for rst_flags, below
     53 */
     54const REX_INTERACTIVE = 1;      /* interactive mode */
     55
     56struct rex_start {
     57        rexstring rst_cmd<>;    /* list of command and args */
     58        rexstring rst_host;     /* working directory host name */
     59        rexstring rst_fsname;   /* working directory file system name */
     60        rexstring rst_dirwithin;/* working directory within file system */
     61        rexstring rst_env<>;    /* list of environment */
     62        unsigned int rst_port0; /* port for stdin */
     63        unsigned int rst_port1; /* port for stdout */
     64        unsigned int rst_port2; /* port for stderr */
     65        unsigned int rst_flags; /* options - see const above */
     66};
     67
     68struct rex_result {
     69        int rlt_stat;           /* integer status code */
     70        rexstring rlt_message;  /* string message for human consumption */
     71};
     72
     73
     74struct sgttyb {
     75        unsigned four;  /* always equals 4 */
     76        opaque chars[4];
     77        /* chars[0] == input speed */
     78        /* chars[1] == output speed */
     79        /* chars[2] == kill character */
     80        /* chars[3] == erase character */
     81        unsigned flags;
     82};
     83/* values for speeds above (baud rates)  */
     84const B0  = 0;
     85const B50 = 1;
     86const B75 = 2;
     87const B110 = 3;
     88const B134 = 4;
     89const B150 = 5;
     90const B200 = 6;
     91const B300 = 7;
     92const B600 = 8;
     93const B1200 = 9;
     94const B1800 = 10;
     95const B2400 = 11;
     96const B4800 = 12;
     97const B9600 = 13;
     98const B19200 = 14;
     99const B38400 = 15;
     100
     101/* values for flags above */
     102const TANDEM = 0x00000001; /* send stopc on out q full */
     103const CBREAK = 0x00000002; /* half-cooked mode */
     104const LCASE = 0x00000004; /* simulate lower case */
     105const ECHO = 0x00000008; /* echo input */
     106const CRMOD = 0x00000010; /* map \r to \r\n on output */
     107const RAW = 0x00000020; /* no i/o processing */
     108const ODDP = 0x00000040; /* get/send odd parity */
     109const EVENP = 0x00000080; /* get/send even parity */
     110const ANYP = 0x000000c0; /* get any parity/send none */
     111const NLDELAY = 0x00000300; /* \n delay */
     112const  NL0 = 0x00000000;
     113const  NL1 = 0x00000100; /* tty 37 */
     114const  NL2 = 0x00000200; /* vt05 */
     115const  NL3 = 0x00000300;
     116const TBDELAY = 0x00000c00; /* horizontal tab delay */
     117const  TAB0 = 0x00000000;
     118const  TAB1 = 0x00000400; /* tty 37 */
     119const  TAB2 = 0x00000800;
     120const XTABS = 0x00000c00; /* expand tabs on output */
     121const CRDELAY = 0x00003000; /* \r delay */
     122const  CR0 = 0x00000000;
     123const  CR1 = 0x00001000; /* tn 300 */
     124const  CR2 = 0x00002000; /* tty 37 */
     125const  CR3 = 0x00003000; /* concept 100 */
     126const VTDELAY = 0x00004000; /* vertical tab delay */
     127const  FF0 = 0x00000000;
     128const  FF1 = 0x00004000; /* tty 37 */
     129const BSDELAY = 0x00008000; /* \b delay */
     130const  BS0 = 0x00000000;
     131const  BS1 = 0x00008000;
     132const CRTBS = 0x00010000; /* do backspacing for crt */
     133const PRTERA = 0x00020000; /* \ ... / erase */
     134const CRTERA = 0x00040000; /* " \b " to wipe out char */
     135const TILDE = 0x00080000; /* hazeltine tilde kludge */
     136const MDMBUF = 0x00100000; /* start/stop output on carrier intr */
     137const LITOUT = 0x00200000; /* literal output */
     138const TOSTOP = 0x00400000; /* SIGTTOU on background output */
     139const FLUSHO = 0x00800000; /* flush output to terminal */
     140const NOHANG = 0x01000000; /* no SIGHUP on carrier drop */
     141const L001000 = 0x02000000;
     142const CRTKIL = 0x04000000; /* kill line with " \b " */
     143const PASS8 = 0x08000000;
     144const CTLECH = 0x10000000; /* echo control chars as ^X */
     145const PENDIN = 0x20000000; /* tp->t_rawq needs reread */
     146const DECCTQ = 0x40000000; /* only ^Q starts after ^S */
     147const NOFLSH = 0x80000000; /* no output flush on signal */
     148
     149struct tchars {
     150        unsigned six;   /* always equals 6 */
     151        opaque chars[6];
     152        /* chars[0] == interrupt char */
     153        /* chars[1] == quit char */
     154        /* chars[2] == start output char */
     155        /* chars[3] == stop output char */
     156        /* chars[4] == end-of-file char */
     157        /* chars[5] == input delimeter (like nl) */
     158};
     159
     160struct ltchars {
     161        unsigned six;   /* always equals 6 */
     162        opaque chars[6];
     163        /* chars[0] == stop process signal */
     164        /* chars[1] == delayed stop process signal */
     165        /* chars[2] == reprint line */
     166        /* chars[3] == flush output */
     167        /* chars[4] == word erase */
     168        /* chars[5] == literal next character */
     169        unsigned mode;
     170};
     171
     172struct rex_ttysize {
     173        int ts_lines;
     174        int ts_cols;
     175};
     176
     177struct rex_ttymode {
     178    sgttyb basic;    /* standard unix tty flags */
     179    tchars more; /* interrupt, kill characters, etc. */
     180    ltchars yetmore; /* special Berkeley characters */
     181    unsigned andmore;     /* and Berkeley modes */
     182};
     183
     184/* values for andmore above */
     185const LCRTBS = 0x0001;  /* do backspacing for crt */
     186const LPRTERA = 0x0002; /* \ ... / erase */
     187const LCRTERA = 0x0004; /* " \b " to wipe out char */
     188const LTILDE = 0x0008;  /* hazeltine tilde kludge */
     189const LMDMBUF = 0x0010; /* start/stop output on carrier intr */
     190const LLITOUT = 0x0020; /* literal output */
     191const LTOSTOP = 0x0040; /* SIGTTOU on background output */
     192const LFLUSHO = 0x0080; /* flush output to terminal */
     193const LNOHANG = 0x0100; /* no SIGHUP on carrier drop */
     194const LL001000 = 0x0200;
     195const LCRTKIL = 0x0400; /* kill line with " \b " */
     196const LPASS8 = 0x0800;
     197const LCTLECH = 0x1000; /* echo control chars as ^X */
     198const LPENDIN = 0x2000; /* needs reread */
     199const LDECCTQ = 0x4000; /* only ^Q starts after ^S */
     200const LNOFLSH = 0x8000; /* no output flush on signal */
     201
     202program REXPROG {
     203        version REXVERS {
     204
     205                /*
     206                 * Start remote execution
     207                 */
     208                rex_result
     209                REXPROC_START(rex_start) = 1;
     210
     211                /*
     212                 * Wait for remote execution to terminate
     213                 */
     214                rex_result
     215                REXPROC_WAIT(void) = 2;
     216
     217                /*
     218                 * Send tty modes
     219                 */
     220                void
     221                REXPROC_MODES(rex_ttymode) = 3;
     222
     223                /*
     224                 * Send window size change
     225                 */
     226                void
     227                REXPROC_WINCH(rex_ttysize) = 4;
     228
     229                /*
     230                 * Send other signal
     231                 */
     232                void
     233                REXPROC_SIGNAL(int) = 5;
     234        } = 1;
     235} = 100017;
  • cpukit/librpc/include/rpcsvc/rnusers.x

    r0ab65474 rdf49c60  
     1/*
     2 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
     3 * unrestricted use provided that this legend is included on all tape
     4 * media and as a part of the software program in whole or part.  Users
     5 * may copy or modify Sun RPC without charge, but are not authorized
     6 * to license or distribute it to anyone else except as part of a product or
     7 * program developed by the user.
     8 *
     9 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
     10 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
     11 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
     12 *
     13 * Sun RPC is provided with no support and without any obligation on the
     14 * part of Sun Microsystems, Inc. to assist in its use, correction,
     15 * modification or enhancement.
     16 *
     17 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
     18 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
     19 * OR ANY PART THEREOF.
     20 *
     21 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
     22 * or profits or other special, indirect and consequential damages, even if
     23 * Sun has been advised of the possibility of such damages.
     24 *
     25 * Sun Microsystems, Inc.
     26 * 2550 Garcia Avenue
     27 * Mountain View, California  94043
     28 */
     29
     30/*
     31 * Find out about remote users
     32 */
     33
     34#ifndef RPC_HDR
     35%#ifndef lint
     36%/*static char sccsid[] = "from: @(#)rnusers.x 1.2 87/09/20 Copyr 1987 Sun Micro";*/
     37%/*static char sccsid[] = "from: @(#)rnusers.x  2.1 88/08/01 4.0 RPCSRC";*/
     38%static const char rcsid[] =
     39%  "$FreeBSD: src/include/rpcsvc/rnusers.x,v 1.6 1999/08/27 23:45:10 peter Exp $";
     40%#endif /* not lint */
     41#endif
     42
     43const MAXUSERS = 100;
     44const MAXUTLEN = 256;
     45
     46struct utmp {
     47        string ut_line<MAXUTLEN>;
     48        string ut_name<MAXUTLEN>;
     49        string ut_host<MAXUTLEN>;
     50        int ut_time;
     51};
     52
     53
     54struct utmpidle {
     55        utmp ui_utmp;
     56        unsigned int ui_idle;
     57};
     58
     59typedef utmp utmparr<MAXUSERS>;
     60
     61typedef utmpidle utmpidlearr<MAXUSERS>;
     62
     63const RUSERS_MAXUSERLEN = 32;
     64const RUSERS_MAXLINELEN = 32;
     65const RUSERS_MAXHOSTLEN = 257;
     66
     67struct rusers_utmp {
     68        string ut_user<RUSERS_MAXUSERLEN>;      /* aka ut_name */
     69        string ut_line<RUSERS_MAXLINELEN>;      /* device */
     70        string ut_host<RUSERS_MAXHOSTLEN>;      /* host user logged on from */
     71        int ut_type;                            /* type of entry */
     72        int ut_time;                            /* time entry was made */
     73        unsigned int ut_idle;                   /* minutes idle */
     74};
     75
     76typedef rusers_utmp utmp_array<>;
     77
     78program RUSERSPROG {
     79        /*
     80         * Old version does not include idle information
     81         */
     82        version RUSERSVERS_ORIG {
     83                int
     84                RUSERSPROC_NUM(void) = 1;
     85
     86                utmparr
     87                RUSERSPROC_NAMES(void) = 2;
     88
     89                utmparr
     90                RUSERSPROC_ALLNAMES(void) = 3;
     91        } = 1;
     92
     93        /*
     94         * Includes idle information
     95         */
     96        version RUSERSVERS_IDLE {
     97                int
     98                RUSERSPROC_NUM(void) = 1;
     99
     100                utmpidlearr
     101                RUSERSPROC_NAMES(void) = 2;
     102
     103                utmpidlearr
     104                RUSERSPROC_ALLNAMES(void) = 3;
     105        } = 2;
     106
     107        /*
     108         * Version 3 rusers procedures (from Solaris).
     109         * (Thanks a lot Sun.)
     110         */
     111        version RUSERSVERS_3 {
     112                int
     113                RUSERSPROC_NUM(void) = 1;
     114
     115                utmp_array
     116                RUSERSPROC_NAMES(void) = 2;
     117
     118                utmp_array
     119                RUSERSPROC_ALLNAMES(void) = 3;
     120        } = 3;
     121
     122} = 100002;
     123
  • cpukit/librpc/include/rpcsvc/rquota.x

    r0ab65474 rdf49c60  
     1/*
     2 * Remote quota protocol
     3 * Requires unix authentication
     4 */
     5
     6#ifndef RPC_HDR
     7%#ifndef lint
     8%/*static char sccsid[] = "from: @(#)rquota.x 1.2 87/09/20 Copyr 1987 Sun Micro";*/
     9%/*static char sccsid[] = "from: @(#)rquota.x   2.1 88/08/01 4.0 RPCSRC";*/
     10%static const char rcsid[] =
     11%  "$FreeBSD: src/include/rpcsvc/rquota.x,v 1.6 1999/08/27 23:45:10 peter Exp $";
     12%#endif /* not lint */
     13#endif
     14
     15const RQ_PATHLEN = 1024;
     16
     17struct getquota_args {
     18        string gqa_pathp<RQ_PATHLEN>;   /* path to filesystem of interest */
     19        int gqa_uid;                    /* inquire about quota for uid */
     20};
     21
     22/*
     23 * remote quota structure
     24 */
     25struct rquota {
     26        int rq_bsize;                   /* block size for block counts */
     27        bool rq_active;                 /* indicates whether quota is active */
     28        unsigned int rq_bhardlimit;     /* absolute limit on disk blks alloc */
     29        unsigned int rq_bsoftlimit;     /* preferred limit on disk blks */
     30        unsigned int rq_curblocks;      /* current block count */
     31        unsigned int rq_fhardlimit;     /* absolute limit on allocated files */
     32        unsigned int rq_fsoftlimit;     /* preferred file limit */
     33        unsigned int rq_curfiles;       /* current # allocated files */
     34        unsigned int rq_btimeleft;      /* time left for excessive disk use */
     35        unsigned int rq_ftimeleft;      /* time left for excessive files */
     36};     
     37
     38enum gqr_status {
     39        Q_OK = 1,               /* quota returned */
     40        Q_NOQUOTA = 2,          /* noquota for uid */
     41        Q_EPERM = 3             /* no permission to access quota */
     42};
     43
     44union getquota_rslt switch (gqr_status status) {
     45case Q_OK:
     46        rquota gqr_rquota;      /* valid if status == Q_OK */
     47case Q_NOQUOTA:
     48        void;
     49case Q_EPERM:
     50        void;
     51};
     52
     53program RQUOTAPROG {
     54        version RQUOTAVERS {
     55                /*
     56                 * Get all quotas
     57                 */
     58                getquota_rslt
     59                RQUOTAPROC_GETQUOTA(getquota_args) = 1;
     60
     61                /*
     62                 * Get active quotas only
     63                 */
     64                getquota_rslt
     65                RQUOTAPROC_GETACTIVEQUOTA(getquota_args) = 2;
     66        } = 1;
     67} = 100011;
  • cpukit/librpc/include/rpcsvc/rstat.x

    r0ab65474 rdf49c60  
     1/*
     2 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
     3 * unrestricted use provided that this legend is included on all tape
     4 * media and as a part of the software program in whole or part.  Users
     5 * may copy or modify Sun RPC without charge, but are not authorized
     6 * to license or distribute it to anyone else except as part of a product or
     7 * program developed by the user.
     8 *
     9 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
     10 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
     11 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
     12 *
     13 * Sun RPC is provided with no support and without any obligation on the
     14 * part of Sun Microsystems, Inc. to assist in its use, correction,
     15 * modification or enhancement.
     16 *
     17 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
     18 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
     19 * OR ANY PART THEREOF.
     20 *
     21 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
     22 * or profits or other special, indirect and consequential damages, even if
     23 * Sun has been advised of the possibility of such damages.
     24 *
     25 * Sun Microsystems, Inc.
     26 * 2550 Garcia Avenue
     27 * Mountain View, California  94043
     28 */
     29
     30/*
     31 * Gather statistics on remote machines
     32 */
     33
     34#ifdef RPC_HDR
     35
     36%#ifndef FSCALE
     37%/*
     38% * Scale factor for scaled integers used to count load averages.
     39% */
     40%#define FSHIFT  8               /* bits to right of fixed binary point */
     41%#define FSCALE  (1<<FSHIFT)
     42%
     43%#endif /* ndef FSCALE */
     44
     45#else
     46
     47%#ifndef lint
     48%/*static char sccsid[] = "from: @(#)rstat.x 1.2 87/09/18 Copyr 1987 Sun Micro";*/
     49%/*static char sccsid[] = "from: @(#)rstat.x    2.2 88/08/01 4.0 RPCSRC";*/
     50%static const char rcsid[] =
     51%  "$FreeBSD: src/include/rpcsvc/rstat.x,v 1.6 1999/08/27 23:45:11 peter Exp $";
     52%#endif /* not lint */
     53
     54#endif /* def RPC_HDR */
     55
     56const RSTAT_CPUSTATES = 4;
     57const RSTAT_DK_NDRIVE = 4;
     58
     59/*
     60 * GMT since 0:00, January 1, 1970
     61 */
     62struct rstat_timeval {
     63        unsigned int tv_sec;    /* seconds */
     64        unsigned int tv_usec;   /* and microseconds */
     65};
     66
     67struct statstime {                              /* RSTATVERS_TIME */
     68        int cp_time[RSTAT_CPUSTATES];
     69        int dk_xfer[RSTAT_DK_NDRIVE];
     70        unsigned int v_pgpgin;  /* these are cumulative sum */
     71        unsigned int v_pgpgout;
     72        unsigned int v_pswpin;
     73        unsigned int v_pswpout;
     74        unsigned int v_intr;
     75        int if_ipackets;
     76        int if_ierrors;
     77        int if_oerrors;
     78        int if_collisions;
     79        unsigned int v_swtch;
     80        int avenrun[3];         /* scaled by FSCALE */
     81        rstat_timeval boottime;
     82        rstat_timeval curtime;
     83        int if_opackets;
     84};
     85
     86struct statsswtch {                     /* RSTATVERS_SWTCH */
     87        int cp_time[RSTAT_CPUSTATES];
     88        int dk_xfer[RSTAT_DK_NDRIVE];
     89        unsigned int v_pgpgin;  /* these are cumulative sum */
     90        unsigned int v_pgpgout;
     91        unsigned int v_pswpin;
     92        unsigned int v_pswpout;
     93        unsigned int v_intr;
     94        int if_ipackets;
     95        int if_ierrors;
     96        int if_oerrors;
     97        int if_collisions;
     98        unsigned int v_swtch;
     99        unsigned int avenrun[3];/* scaled by FSCALE */
     100        rstat_timeval boottime;
     101        int if_opackets;
     102};
     103
     104struct stats {                          /* RSTATVERS_ORIG */
     105        int cp_time[RSTAT_CPUSTATES];
     106        int dk_xfer[RSTAT_DK_NDRIVE];
     107        unsigned int v_pgpgin;  /* these are cumulative sum */
     108        unsigned int v_pgpgout;
     109        unsigned int v_pswpin;
     110        unsigned int v_pswpout;
     111        unsigned int v_intr;
     112        int if_ipackets;
     113        int if_ierrors;
     114        int if_oerrors;
     115        int if_collisions;
     116        int if_opackets;
     117};
     118
     119
     120program RSTATPROG {
     121        /*
     122         * Newest version includes current time and context switching info
     123         */
     124        version RSTATVERS_TIME {
     125                statstime
     126                RSTATPROC_STATS(void) = 1;
     127
     128                unsigned int
     129                RSTATPROC_HAVEDISK(void) = 2;
     130        } = 3;
     131        /*
     132         * Does not have current time
     133         */
     134        version RSTATVERS_SWTCH {
     135                statsswtch
     136                RSTATPROC_STATS(void) = 1;
     137
     138                unsigned int
     139                RSTATPROC_HAVEDISK(void) = 2;
     140        } = 2;
     141        /*
     142         * Old version has no info about current time or context switching
     143         */
     144        version RSTATVERS_ORIG {
     145                stats
     146                RSTATPROC_STATS(void) = 1;
     147
     148                unsigned int
     149                RSTATPROC_HAVEDISK(void) = 2;
     150        } = 1;
     151} = 100001;
  • cpukit/librpc/include/rpcsvc/rwall.x

    r0ab65474 rdf49c60  
     1%/*
     2% * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
     3% * unrestricted use provided that this legend is included on all tape
     4% * media and as a part of the software program in whole or part.  Users
     5% * may copy or modify Sun RPC without charge, but are not authorized
     6% * to license or distribute it to anyone else except as part of a product or
     7% * program developed by the user or with the express written consent of
     8% * Sun Microsystems, Inc.
     9% *
     10% * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
     11% * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
     12% * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
     13% *
     14% * Sun RPC is provided with no support and without any obligation on the
     15% * part of Sun Microsystems, Inc. to assist in its use, correction,
     16% * modification or enhancement.
     17% *
     18% * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
     19% * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
     20% * OR ANY PART THEREOF.
     21% *
     22% * In no event will Sun Microsystems, Inc. be liable for any lost revenue
     23% * or profits or other special, indirect and consequential damages, even if
     24% * Sun has been advised of the possibility of such damages.
     25% *
     26% * Sun Microsystems, Inc.
     27% * 2550 Garcia Avenue
     28% * Mountain View, California  94043
     29% */
     30
     31%/*
     32% * Copyright (c) 1984, 1990 by Sun Microsystems, Inc.
     33% */
     34%
     35%/* from @(#)rwall.x    1.6 91/03/11 TIRPC 1.0 */
     36
     37#ifdef RPC_HDR
     38%
     39%#ifndef _rpcsvc_rwall_h
     40%#define _rpcsvc_rwall_h
     41%
     42%typedef char *wrapstring;
     43%
     44#endif
     45
     46program WALLPROG {
     47        version WALLVERS {
     48                void   
     49                WALLPROC_WALL(wrapstring) = 2;
     50
     51        } = 1;
     52} = 100008;
     53
     54#ifdef RPC_HDR
     55%
     56%#endif /* ! _rpcsvc_rwall_h */
     57#endif
  • cpukit/librpc/include/rpcsvc/sm_inter.x

    r0ab65474 rdf49c60  
     1/* @(#)sm_inter.x       2.2 88/08/01 4.0 RPCSRC */
     2/* @(#)sm_inter.x 1.7 87/06/24 Copyr 1987 Sun Micro */
     3
     4/*
     5 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
     6 * unrestricted use provided that this legend is included on all tape
     7 * media and as a part of the software program in whole or part.  Users
     8 * may copy or modify Sun RPC without charge, but are not authorized
     9 * to license or distribute it to anyone else except as part of a product or
     10 * program developed by the user.
     11 *
     12 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
     13 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
     14 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
     15 *
     16 * Sun RPC is provided with no support and without any obligation on the
     17 * part of Sun Microsystems, Inc. to assist in its use, correction,
     18 * modification or enhancement.
     19 *
     20 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
     21 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
     22 * OR ANY PART THEREOF.
     23 *
     24 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
     25 * or profits or other special, indirect and consequential damages, even if
     26 * Sun has been advised of the possibility of such damages.
     27 *
     28 * Sun Microsystems, Inc.
     29 * 2550 Garcia Avenue
     30 * Mountain View, California  94043
     31 */
     32
     33/*
     34 * Status monitor protocol specification
     35 * Copyright (C) 1986 Sun Microsystems, Inc.
     36 *
     37 */
     38
     39#ifndef RPC_HDR
     40%#ifndef lint
     41%static const char rcsid[] =
     42%  "$FreeBSD: src/include/rpcsvc/sm_inter.x,v 1.8 1999/08/27 23:45:11 peter Exp $";
     43%#endif /* not lint */
     44#endif
     45
     46program SM_PROG {
     47        version SM_VERS  {
     48                /* res_stat = stat_succ if status monitor agrees to monitor */
     49                /* res_stat = stat_fail if status monitor cannot monitor */
     50                /* if res_stat == stat_succ, state = state number of site sm_name */
     51                struct sm_stat_res                       SM_STAT(struct sm_name) = 1;
     52
     53                /* res_stat = stat_succ if status monitor agrees to monitor */
     54                /* res_stat = stat_fail if status monitor cannot monitor */
     55                /* stat consists of state number of local site */
     56                struct sm_stat_res                       SM_MON(struct mon) = 2;
     57
     58                /* stat consists of state number of local site */
     59                struct sm_stat                           SM_UNMON(struct mon_id) = 3;
     60
     61                /* stat consists of state number of local site */
     62                struct sm_stat                           SM_UNMON_ALL(struct my_id) = 4;
     63
     64                void                                     SM_SIMU_CRASH(void) = 5;
     65
     66        } = 1;
     67} = 100024;
     68
     69const   SM_MAXSTRLEN = 1024;
     70
     71struct sm_name {
     72        string mon_name<SM_MAXSTRLEN>;
     73};
     74
     75struct my_id {
     76        string   my_name<SM_MAXSTRLEN>;         /* name of the site iniates the monitoring request*/
     77        int     my_prog;                        /* rpc program # of the requesting process */
     78        int     my_vers;                        /* rpc version # of the requesting process */
     79        int     my_proc;                        /* rpc procedure # of the requesting process */
     80};
     81
     82struct mon_id {
     83        string  mon_name<SM_MAXSTRLEN>;         /* name of the site to be monitored */
     84        struct my_id my_id;
     85};
     86
     87
     88struct mon{
     89        struct mon_id mon_id;
     90        opaque priv[16];                /* private information to store at monitor for requesting process */
     91};
     92
     93
     94/*
     95 * state # of status monitor monitonically increases each time
     96 * status of the site changes:
     97 * an even number (>= 0) indicates the site is down and
     98 * an odd number (> 0) indicates the site is up;
     99 */
     100struct sm_stat {
     101        int state;              /* state # of status monitor */
     102};
     103
     104enum res {
     105        stat_succ = 0,          /* status monitor agrees to monitor */
     106        stat_fail = 1           /* status monitor cannot monitor */
     107};
     108
     109struct sm_stat_res {
     110        res res_stat;
     111        int state;
     112};
     113
     114/*
     115 * structure of the status message sent back by the status monitor
     116 * when monitor site status changes
     117 */
     118struct status {
     119        string mon_name<SM_MAXSTRLEN>;
     120        int state;
     121        opaque priv[16];                /* stored private information */
     122};
  • cpukit/librpc/include/rpcsvc/spray.x

    r0ab65474 rdf49c60  
     1/*
     2 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
     3 * unrestricted use provided that this legend is included on all tape
     4 * media and as a part of the software program in whole or part.  Users
     5 * may copy or modify Sun RPC without charge, but are not authorized
     6 * to license or distribute it to anyone else except as part of a product or
     7 * program developed by the user.
     8 *
     9 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
     10 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
     11 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
     12 *
     13 * Sun RPC is provided with no support and without any obligation on the
     14 * part of Sun Microsystems, Inc. to assist in its use, correction,
     15 * modification or enhancement.
     16 *
     17 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
     18 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
     19 * OR ANY PART THEREOF.
     20 *
     21 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
     22 * or profits or other special, indirect and consequential damages, even if
     23 * Sun has been advised of the possibility of such damages.
     24 *
     25 * Sun Microsystems, Inc.
     26 * 2550 Garcia Avenue
     27 * Mountain View, California  94043
     28 */
     29
     30/*
     31 * Spray a server with packets
     32 * Useful for testing flakiness of network interfaces
     33 */
     34
     35#ifndef RPC_HDR
     36%#ifndef lint
     37%/*static char sccsid[] = "from: @(#)spray.x 1.2 87/09/18 Copyr 1987 Sun Micro";*/
     38%/*static char sccsid[] = "from: @(#)spray.x    2.1 88/08/01 4.0 RPCSRC";*/
     39%static const char rcsid[] =
     40%  "$FreeBSD: src/include/rpcsvc/spray.x,v 1.6 1999/08/27 23:45:11 peter Exp $";
     41%#endif /* not lint */
     42#endif
     43
     44const SPRAYMAX = 8845;  /* max amount can spray */
     45
     46/*
     47 * GMT since 0:00, 1 January 1970
     48 */
     49struct spraytimeval {
     50        unsigned int sec;
     51        unsigned int usec;
     52};
     53
     54/*
     55 * spray statistics
     56 */
     57struct spraycumul {
     58        unsigned int counter;
     59        spraytimeval clock;
     60};
     61
     62/*
     63 * spray data
     64 */
     65typedef opaque sprayarr<SPRAYMAX>;
     66
     67program SPRAYPROG {
     68        version SPRAYVERS {
     69                /*
     70                 * Just throw away the data and increment the counter
     71                 * This call never returns, so the client should always
     72                 * time it out.
     73                 */
     74                void
     75                SPRAYPROC_SPRAY(sprayarr) = 1;
     76
     77                /*
     78                 * Get the value of the counter and elapsed time  since
     79                 * last CLEAR.
     80                 */
     81                spraycumul     
     82                SPRAYPROC_GET(void) = 2;
     83
     84                /*
     85                 * Clear the counter and reset the elapsed time
     86                 */
     87                void
     88                SPRAYPROC_CLEAR(void) = 3;
     89        } = 1;
     90} = 100012;
  • cpukit/librpc/include/rpcsvc/yp.x

    r0ab65474 rdf49c60  
     1/* @(#)yp.x     2.1 88/08/01 4.0 RPCSRC */
     2
     3/*
     4 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
     5 * unrestricted use provided that this legend is included on all tape
     6 * media and as a part of the software program in whole or part.  Users
     7 * may copy or modify Sun RPC without charge, but are not authorized
     8 * to license or distribute it to anyone else except as part of a product or
     9 * program developed by the user.
     10 *
     11 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
     12 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
     13 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
     14 *
     15 * Sun RPC is provided with no support and without any obligation on the
     16 * part of Sun Microsystems, Inc. to assist in its use, correction,
     17 * modification or enhancement.
     18 *
     19 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
     20 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
     21 * OR ANY PART THEREOF.
     22 *
     23 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
     24 * or profits or other special, indirect and consequential damages, even if
     25 * Sun has been advised of the possibility of such damages.
     26 *
     27 * Sun Microsystems, Inc.
     28 * 2550 Garcia Avenue
     29 * Mountain View, California  94043
     30 */
     31
     32/*
     33 * Protocol description file for the Yellow Pages Service
     34 */
     35
     36#ifndef RPC_HDR
     37%#ifndef lint
     38%static const char rcsid[] =
     39%  "$FreeBSD: src/include/rpcsvc/yp.x,v 1.12 1999/08/27 23:45:12 peter Exp $";
     40%#endif /* not lint */
     41#endif
     42
     43const YPMAXRECORD = 1024;
     44const YPMAXDOMAIN = 64;
     45const YPMAXMAP = 64;
     46const YPMAXPEER = 64;
     47
     48
     49enum ypstat {
     50        YP_TRUE         =  1,
     51        YP_NOMORE       =  2,
     52        YP_FALSE        =  0,
     53        YP_NOMAP        = -1,
     54        YP_NODOM        = -2,
     55        YP_NOKEY        = -3,
     56        YP_BADOP        = -4,
     57        YP_BADDB        = -5,
     58        YP_YPERR        = -6,
     59        YP_BADARGS      = -7,
     60        YP_VERS         = -8
     61};
     62
     63
     64enum ypxfrstat {
     65        YPXFR_SUCC      =  1,
     66        YPXFR_AGE       =  2,
     67        YPXFR_NOMAP     = -1,
     68        YPXFR_NODOM     = -2,
     69        YPXFR_RSRC      = -3,
     70        YPXFR_RPC       = -4,
     71        YPXFR_MADDR     = -5,
     72        YPXFR_YPERR     = -6,
     73        YPXFR_BADARGS   = -7,
     74        YPXFR_DBM       = -8,
     75        YPXFR_FILE      = -9,
     76        YPXFR_SKEW      = -10,
     77        YPXFR_CLEAR     = -11,
     78        YPXFR_FORCE     = -12,
     79        YPXFR_XFRERR    = -13,
     80        YPXFR_REFUSED   = -14
     81};
     82
     83
     84typedef string domainname<YPMAXDOMAIN>;
     85typedef string mapname<YPMAXMAP>;
     86typedef string peername<YPMAXPEER>;
     87typedef opaque keydat<YPMAXRECORD>;
     88typedef opaque valdat<YPMAXRECORD>;
     89
     90
     91struct ypmap_parms {
     92        domainname domain;     
     93        mapname map;
     94        unsigned int ordernum;
     95        peername peer;
     96};
     97
     98struct ypreq_key {
     99        domainname domain;
     100        mapname map;
     101        keydat key;
     102};
     103
     104struct ypreq_nokey {
     105        domainname domain;     
     106        mapname map;
     107};
     108       
     109struct ypreq_xfr {
     110        ypmap_parms map_parms;
     111        unsigned int transid;
     112        unsigned int prog;
     113        unsigned int port;
     114};
     115
     116
     117struct ypresp_val {
     118        ypstat stat;
     119        valdat val;
     120};
     121
     122struct ypresp_key_val {
     123        ypstat stat;
     124#ifdef STUPID_SUN_BUG /* These are backwards */
     125        keydat key;
     126        valdat val;
     127#else
     128        valdat val;
     129        keydat key;
     130#endif
     131};
     132
     133
     134struct ypresp_master {
     135        ypstat stat;   
     136        peername peer;
     137};
     138
     139struct ypresp_order {
     140        ypstat stat;
     141        unsigned int ordernum;
     142};
     143
     144union ypresp_all switch (bool more) {
     145case TRUE:
     146        ypresp_key_val val;
     147case FALSE:
     148        void;
     149};
     150
     151struct ypresp_xfr {
     152        unsigned int transid;
     153        ypxfrstat xfrstat;
     154};
     155
     156struct ypmaplist {
     157        mapname map;
     158        ypmaplist *next;
     159};
     160
     161struct ypresp_maplist {
     162        ypstat stat;
     163        ypmaplist *maps;
     164};
     165
     166enum yppush_status {
     167        YPPUSH_SUCC     =  1,   /* Success */
     168        YPPUSH_AGE      =  2,   /* Master's version not newer */
     169        YPPUSH_NOMAP    = -1,   /* Can't find server for map */
     170        YPPUSH_NODOM    = -2,   /* Domain not supported */
     171        YPPUSH_RSRC     = -3,   /* Local resource alloc failure */
     172        YPPUSH_RPC      = -4,   /* RPC failure talking to server */
     173        YPPUSH_MADDR    = -5,   /* Can't get master address */
     174        YPPUSH_YPERR    = -6,   /* YP server/map db error */
     175        YPPUSH_BADARGS  = -7,   /* Request arguments bad */
     176        YPPUSH_DBM      = -8,   /* Local dbm operation failed */
     177        YPPUSH_FILE     = -9,   /* Local file I/O operation failed */
     178        YPPUSH_SKEW     = -10,  /* Map version skew during transfer */
     179        YPPUSH_CLEAR    = -11,  /* Can't send "Clear" req to local ypserv */
     180        YPPUSH_FORCE    = -12,  /* No local order number in map  use -f flag. */
     181        YPPUSH_XFRERR   = -13,  /* ypxfr error */
     182        YPPUSH_REFUSED  = -14   /* Transfer request refused by ypserv */
     183};
     184
     185struct yppushresp_xfr {
     186        unsigned transid;
     187        yppush_status status;
     188};
     189
     190/*
     191 * Response structure and overall result status codes.  Success and failure
     192 * represent two separate response message types.
     193 */
     194 
     195enum ypbind_resptype {
     196        YPBIND_SUCC_VAL = 1,
     197        YPBIND_FAIL_VAL = 2
     198};
     199 
     200struct ypbind_binding {
     201    opaque ypbind_binding_addr[4]; /* In network order */
     202    opaque ypbind_binding_port[2]; /* In network order */
     203};   
     204
     205union ypbind_resp switch (ypbind_resptype ypbind_status) {
     206case YPBIND_FAIL_VAL:
     207        unsigned ypbind_error;
     208case YPBIND_SUCC_VAL:
     209        ypbind_binding ypbind_bindinfo;
     210};     
     211
     212/* Detailed failure reason codes for response field ypbind_error*/
     213 
     214const YPBIND_ERR_ERR    = 1;    /* Internal error */
     215const YPBIND_ERR_NOSERV = 2;    /* No bound server for passed domain */
     216const YPBIND_ERR_RESC   = 3;    /* System resource allocation failure */
     217 
     218 
     219/*
     220 * Request data structure for ypbind "Set domain" procedure.
     221 */
     222struct ypbind_setdom {
     223        domainname ypsetdom_domain;
     224        ypbind_binding ypsetdom_binding;
     225        unsigned ypsetdom_vers;
     226};
     227
     228
     229/*
     230 * NIS v1 support for backwards compatibility
     231 */
     232enum ypreqtype {
     233        YPREQ_KEY = 1,
     234        YPREQ_NOKEY = 2,
     235        YPREQ_MAP_PARMS = 3
     236};
     237
     238enum ypresptype {
     239        YPRESP_VAL = 1,
     240        YPRESP_KEY_VAL = 2,
     241        YPRESP_MAP_PARMS = 3
     242};
     243
     244union yprequest switch (ypreqtype yp_reqtype) {
     245case YPREQ_KEY:
     246        ypreq_key yp_req_keytype;
     247case YPREQ_NOKEY:
     248        ypreq_nokey yp_req_nokeytype;
     249case YPREQ_MAP_PARMS:
     250        ypmap_parms yp_req_map_parmstype;
     251};
     252
     253union ypresponse switch (ypresptype yp_resptype) {
     254case YPRESP_VAL:
     255        ypresp_val yp_resp_valtype;
     256case YPRESP_KEY_VAL:
     257        ypresp_key_val yp_resp_key_valtype;
     258case YPRESP_MAP_PARMS:
     259        ypmap_parms yp_resp_map_parmstype;
     260};
     261
     262#if !defined(YPBIND_ONLY) && !defined(YPPUSH_ONLY)
     263/*
     264 * YP access protocol
     265 */
     266program YPPROG {
     267/*
     268 * NIS v1 support for backwards compatibility
     269 */
     270        version YPOLDVERS {
     271                void
     272                YPOLDPROC_NULL(void) = 0;
     273
     274                bool
     275                YPOLDPROC_DOMAIN(domainname) = 1;
     276
     277                bool
     278                YPOLDPROC_DOMAIN_NONACK(domainname) = 2;
     279
     280                ypresponse
     281                YPOLDPROC_MATCH(yprequest) = 3;
     282
     283                ypresponse
     284                YPOLDPROC_FIRST(yprequest) = 4;
     285
     286                ypresponse
     287                YPOLDPROC_NEXT(yprequest) = 5;
     288
     289                ypresponse
     290                YPOLDPROC_POLL(yprequest) = 6;
     291
     292                ypresponse
     293                YPOLDPROC_PUSH(yprequest) = 7;
     294
     295                ypresponse
     296                YPOLDPROC_PULL(yprequest) = 8;
     297
     298                ypresponse
     299                YPOLDPROC_GET(yprequest) = 9;
     300        } = 1;
     301
     302        version YPVERS {
     303                void
     304                YPPROC_NULL(void) = 0;
     305
     306                bool
     307                YPPROC_DOMAIN(domainname) = 1; 
     308
     309                bool
     310                YPPROC_DOMAIN_NONACK(domainname) = 2;
     311
     312                ypresp_val
     313                YPPROC_MATCH(ypreq_key) = 3;
     314
     315                ypresp_key_val
     316#ifdef STUPID_SUN_BUG /* should be ypreq_nokey */
     317                YPPROC_FIRST(ypreq_key) = 4;
     318#else
     319                YPPROC_FIRST(ypreq_nokey) = 4;
     320#endif
     321                ypresp_key_val
     322                YPPROC_NEXT(ypreq_key) = 5;
     323
     324                ypresp_xfr
     325                YPPROC_XFR(ypreq_xfr) = 6;
     326
     327                void
     328                YPPROC_CLEAR(void) = 7;
     329
     330                ypresp_all
     331                YPPROC_ALL(ypreq_nokey) = 8;
     332
     333                ypresp_master
     334                YPPROC_MASTER(ypreq_nokey) = 9;
     335
     336                ypresp_order
     337                YPPROC_ORDER(ypreq_nokey) = 10;
     338
     339                ypresp_maplist
     340                YPPROC_MAPLIST(domainname) = 11;
     341        } = 2;
     342} = 100004;
     343#endif
     344#if !defined(YPSERV_ONLY) && !defined(YPBIND_ONLY)
     345/*
     346 * YPPUSHPROC_XFRRESP is the callback routine for result of YPPROC_XFR
     347 */
     348program YPPUSH_XFRRESPPROG {
     349        version YPPUSH_XFRRESPVERS {
     350                void
     351                YPPUSHPROC_NULL(void) = 0;
     352#ifdef STUPID_SUN_BUG /* argument and return value are backwards */
     353                yppushresp_xfr 
     354                YPPUSHPROC_XFRRESP(void) = 1;
     355#else
     356                void
     357                YPPUSHPROC_XFRRESP(yppushresp_xfr) = 1;
     358#endif
     359        } = 1;
     360} = 0x40000000; /* transient: could be anything up to 0x5fffffff */
     361#endif
     362#if !defined(YPSERV_ONLY) && !defined(YPPUSH_ONLY)
     363/*
     364 * YP binding protocol
     365 */
     366program YPBINDPROG {
     367        version YPBINDVERS {
     368                void
     369                YPBINDPROC_NULL(void) = 0;
     370       
     371                ypbind_resp
     372                YPBINDPROC_DOMAIN(domainname) = 1;
     373
     374                void
     375                YPBINDPROC_SETDOM(ypbind_setdom) = 2;
     376        } = 2;
     377} = 100007;
     378
     379#endif
  • cpukit/librpc/include/rpcsvc/yp_prot.h

    r0ab65474 rdf49c60  
     1/*
     2 * Copyright (c) 1992/3 Theo de Raadt <deraadt@fsa.ca>
     3 * All rights reserved.
     4 *
     5 * Redistribution and use in source and binary forms, with or without
     6 * modification, are permitted provided that the following conditions
     7 * are met:
     8 * 1. Redistributions of source code must retain the above copyright
     9 *    notice, this list of conditions and the following disclaimer.
     10 * 2. Redistributions in binary form must reproduce the above copyright
     11 *    notice, this list of conditions and the following disclaimer in the
     12 *    documentation and/or other materials provided with the distribution.
     13 * 3. The name of the author may not be used to endorse or promote
     14 *    products derived from this software without specific prior written
     15 *    permission.
     16 *
     17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
     18 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     19 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     20 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
     21 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     27 * SUCH DAMAGE.
     28 *
     29 * $FreeBSD: src/include/rpcsvc/yp_prot.h,v 1.10 1999/08/27 23:45:12 peter Exp $
     30 */
     31
     32#ifndef _RPCSVC_YP_PROT_H_
     33#define _RPCSVC_YP_PROT_H_
     34
     35/*
     36 * YPSERV PROTOCOL:
     37 *
     38 * ypserv supports the following procedures:
     39 *
     40 * YPPROC_NULL          takes (void), returns (void).
     41 *                      called to check if server is alive.
     42 * YPPROC_DOMAIN        takes (char *), returns (bool_t).
     43 *                      true if ypserv serves the named domain.
     44 * YPPROC_DOMAIN_NOACK  takes (char *), returns (bool_t).
     45 *                      true if ypserv serves the named domain.
     46 *                      used for broadcasts, does not ack if ypserv
     47 *                      doesn't handle named domain.
     48 * YPPROC_MATCH         takes (struct ypreq_key), returns (struct ypresp_val)
     49 *                      does a lookup.
     50 * YPPROC_FIRST         takes (struct ypreq_nokey) returns (ypresp_key_val).
     51 *                      gets the first key/datum from the map.
     52 * YPPROC_NEXT          takes (struct ypreq_key) returns (ypresp_key_val).
     53 *                      gets the next key/datum from the map.
     54 * YPPROC_XFR           takes (struct ypreq_xfr), returns (void).
     55 *                      tells ypserv to check if there is a new version of
     56 *                      the map.
     57 * YPPROC_CLEAR         takes (void), returns (void).
     58 *                      tells ypserv to flush it's file cache, so that
     59 *                      newly transferred files will get read.
     60 * YPPROC_ALL           takes (struct ypreq_nokey), returns (bool_t and
     61 *                      struct ypresp_key_val).
     62 *                      returns an array of data, with the bool_t being
     63 *                      false on the last datum. read the source, it's
     64 *                      convoluted.
     65 * YPPROC_MASTER        takes (struct ypreq_nokey), returns (ypresp_master).
     66 * YPPROC_ORDER         takes (struct ypreq_nokey), returns (ypresp_order).
     67 * YPPROC_MAPLIST       takes (char *), returns (struct ypmaplist *).
     68 */
     69
     70#ifndef BOOL_DEFINED
     71typedef u_int bool;
     72#define BOOL_DEFINED
     73#endif
     74
     75/* Program and version symbols, magic numbers */
     76
     77#define YPPROG          ((u_long)100004)
     78#define YPVERS          ((u_long)2)
     79#define YPVERS_ORIG     ((u_long)1)
     80#define YPMAXRECORD     ((u_long)1024)
     81#define YPMAXDOMAIN     ((u_long)64)
     82#define YPMAXMAP        ((u_long)64)
     83#define YPMAXPEER       ((u_long)256)
     84
     85/*
     86 * I don't know if anything of sun's depends on this, or if they
     87 * simply defined it so that their own code wouldn't try to send
     88 * packets over the ethernet MTU. This YP code doesn't use it.
     89 */
     90#define YPMSGSZ         1600
     91
     92#ifndef DATUM
     93typedef struct {
     94        char    *dptr;
     95        int     dsize;
     96} datum;
     97#define DATUM
     98#endif
     99
     100struct ypmap_parms {
     101        char *domain;
     102        char *map;
     103        u_long ordernum;
     104        char *owner;
     105};
     106
     107struct ypreq_key {
     108        char *domain;
     109        char *map;
     110        datum keydat;
     111};
     112
     113struct ypreq_nokey {
     114        char *domain;
     115        char *map;
     116};
     117
     118struct ypreq_xfr {
     119        struct ypmap_parms map_parms;
     120        u_long transid;
     121        u_long proto;
     122        u_short port;
     123};
     124#define ypxfr_domain    map_parms.domain
     125#define ypxfr_map       map_parms.map
     126#define ypxfr_ordernum  map_parms.ordernum
     127#define ypxfr_owner     map_parms.owner
     128
     129struct ypresp_val {
     130        u_long status;
     131        datum valdat;
     132};
     133
     134struct ypresp_key_val {
     135        u_long status;
     136        datum keydat;
     137        datum valdat;
     138};
     139
     140struct ypresp_master {
     141        u_long status;
     142        char *master;
     143};
     144
     145struct ypresp_order {
     146        u_long status;
     147        u_long ordernum;
     148};
     149
     150struct ypmaplist {
     151        char ypml_name[YPMAXMAP + 1];
     152        struct ypmaplist *ypml_next;
     153};
     154
     155struct ypresp_maplist {
     156        u_long status;
     157        struct ypmaplist *list;
     158};
     159
     160/* ypserv procedure numbers */
     161#define YPPROC_NULL             ((u_long)0)
     162#define YPPROC_DOMAIN           ((u_long)1)
     163#define YPPROC_DOMAIN_NONACK    ((u_long)2)
     164#define YPPROC_MATCH            ((u_long)3)
     165#define YPPROC_FIRST            ((u_long)4)
     166#define YPPROC_NEXT             ((u_long)5)
     167#define YPPROC_XFR              ((u_long)6)
     168#define YPPROC_CLEAR            ((u_long)7)
     169#define YPPROC_ALL              ((u_long)8)
     170#define YPPROC_MASTER           ((u_long)9)
     171#define YPPROC_ORDER            ((u_long)10)
     172#define YPPROC_MAPLIST          ((u_long)11)
     173
     174/* ypserv procedure return status values */
     175#define YP_TRUE         ((long)1)       /* general purpose success code */
     176#define YP_NOMORE       ((long)2)       /* no more entries in map */
     177#define YP_FALSE        ((long)0)       /* general purpose failure code */
     178#define YP_NOMAP        ((long)-1)      /* no such map in domain */
     179#define YP_NODOM        ((long)-2)      /* domain not supported */
     180#define YP_NOKEY        ((long)-3)      /* no such key in map */
     181#define YP_BADOP        ((long)-4)      /* invalid operation */
     182#define YP_BADDB        ((long)-5)      /* server data base is bad */
     183#define YP_YPERR        ((long)-6)      /* YP server error */
     184#define YP_BADARGS      ((long)-7)      /* request arguments bad */
     185#define YP_VERS         ((long)-8)      /* YP server version mismatch */
     186
     187/*
     188 * Sun's header file says:
     189 * "Domain binding data structure, used by ypclnt package and ypserv modules.
     190 * Users of the ypclnt package (or of this protocol) don't HAVE to know about
     191 * it, but it must be available to users because _yp_dobind is a public
     192 * interface."
     193 *
     194 * This is totally bogus! Nowhere else does Sun state that _yp_dobind() is
     195 * a public interface, and I don't know any reason anyone would want to call
     196 * it. But, just in case anyone does actually expect it to be available..
     197 * we provide this.. exactly as Sun wants it.
     198 */
     199struct dom_binding {
     200        struct dom_binding *dom_pnext;
     201        char dom_domain[YPMAXDOMAIN + 1];
     202        struct sockaddr_in dom_server_addr;
     203        u_short dom_server_port;
     204        int dom_socket;
     205        CLIENT *dom_client;
     206        u_short dom_local_port;
     207        long dom_vers;
     208};
     209
     210/*
     211 * YPBIND PROTOCOL:
     212 *
     213 * ypbind supports the following procedures:
     214 *
     215 * YPBINDPROC_NULL      takes (void), returns (void).
     216 *                      to check if ypbind is running.
     217 * YPBINDPROC_DOMAIN    takes (char *), returns (struct ypbind_resp).
     218 *                      requests that ypbind start to serve the
     219 *                      named domain (if it doesn't already)
     220 * YPBINDPROC_SETDOM    takes (struct ypbind_setdom), returns (void).
     221 *                      used by ypset.
     222 */
     223
     224#define YPBINDPROG              ((u_long)100007)
     225#define YPBINDVERS              ((u_long)2)
     226#define YPBINDVERS_ORIG         ((u_long)1)
     227
     228/* ypbind procedure numbers */
     229#define YPBINDPROC_NULL         ((u_long)0)
     230#define YPBINDPROC_DOMAIN       ((u_long)1)
     231#define YPBINDPROC_SETDOM       ((u_long)2)
     232
     233/* error code in ypbind_resp.ypbind_status */
     234enum ypbind_resptype {
     235        YPBIND_SUCC_VAL = 1,
     236        YPBIND_FAIL_VAL = 2
     237};
     238
     239/* network order, of course */
     240struct ypbind_binding {
     241        struct in_addr  ypbind_binding_addr;
     242        u_short         ypbind_binding_port;
     243};
     244
     245struct ypbind_resp {
     246        enum ypbind_resptype    ypbind_status;
     247        union {
     248                u_long                  ypbind_error;
     249                struct ypbind_binding   ypbind_bindinfo;
     250        } ypbind_respbody;
     251};
     252
     253/* error code in ypbind_resp.ypbind_respbody.ypbind_error */
     254#define YPBIND_ERR_ERR          1       /* internal error */
     255#define YPBIND_ERR_NOSERV       2       /* no bound server for passed domain */
     256#define YPBIND_ERR_RESC         3       /* system resource allocation failure */
     257
     258/*
     259 * Request data structure for ypbind "Set domain" procedure.
     260 */
     261struct ypbind_setdom {
     262        char ypsetdom_domain[YPMAXDOMAIN + 1];
     263        struct ypbind_binding ypsetdom_binding;
     264        u_short ypsetdom_vers;
     265};
     266#define ypsetdom_addr ypsetdom_binding.ypbind_binding_addr
     267#define ypsetdom_port ypsetdom_binding.ypbind_binding_port
     268
     269/*
     270 * YPPUSH PROTOCOL:
     271 *
     272 * Sun says:
     273 * "Protocol between clients (ypxfr, only) and yppush
     274 *  yppush speaks a protocol in the transient range, which
     275 *  is supplied to ypxfr as a command-line parameter when it
     276 *  is activated by ypserv."
     277 *
     278 * This protocol is not implemented, naturally, because this YP
     279 * implementation only does the client side.
     280 */
     281#define YPPUSHVERS              ((u_long)1)
     282#define YPPUSHVERS_ORIG         ((u_long)1)
     283
     284/* yppush procedure numbers */
     285#define YPPUSHPROC_NULL         ((u_long)0)
     286#define YPPUSHPROC_XFRRESP      ((u_long)1)
     287
     288struct yppushresp_xfr {
     289        u_long  transid;
     290        u_long  status;
     291};
     292
     293/* yppush status value in yppushresp_xfr.status */
     294#define YPPUSH_SUCC     ((long)1)       /* Success */
     295#define YPPUSH_AGE      ((long)2)       /* Master's version not newer */
     296#define YPPUSH_NOMAP    ((long)-1)      /* Can't find server for map */
     297#define YPPUSH_NODOM    ((long)-2)      /* Domain not supported */
     298#define YPPUSH_RSRC     ((long)-3)      /* Local resource alloc failure */
     299#define YPPUSH_RPC      ((long)-4)      /* RPC failure talking to server */
     300#define YPPUSH_MADDR    ((long)-5)      /* Can't get master address */
     301#define YPPUSH_YPERR    ((long)-6)      /* YP server/map db error */
     302#define YPPUSH_BADARGS  ((long)-7)      /* Request arguments bad */
     303#define YPPUSH_DBM      ((long)-8)      /* Local dbm operation failed */
     304#define YPPUSH_FILE     ((long)-9)      /* Local file I/O operation failed */
     305#define YPPUSH_SKEW     ((long)-10)     /* Map version skew during transfer */
     306#define YPPUSH_CLEAR    ((long)-11)     /* Can't send "Clear" req to local ypserv */
     307#define YPPUSH_FORCE    ((long)-12)     /* No local order number in map - use -f */
     308#define YPPUSH_XFRERR   ((long)-13)     /* ypxfr error */
     309#define YPPUSH_REFUSED  ((long)-14)     /* Transfer request refused by ypserv */
     310
     311struct inaddr;
     312__BEGIN_DECLS
     313bool_t  xdr_datum __P((XDR *, datum *));
     314bool_t  xdr_ypreq_key __P((XDR *, struct ypreq_key *));
     315bool_t  xdr_ypreq_nokey __P((XDR *, struct ypreq_nokey *));
     316bool_t  xdr_ypreq_xfr __P((XDR *, struct ypreq_xfr *));
     317bool_t  xdr_ypresp_val __P((XDR *, struct ypresp_val *));
     318bool_t  xdr_ypresp_key_val __P((XDR *, struct ypresp_key_val *));
     319bool_t  xdr_ypbind_resp __P((XDR *, struct ypbind_resp *));
     320bool_t  xdr_ypbind_setdom __P((XDR *, struct ypbind_setdom *));
     321bool_t  xdr_yp_inaddr __P((XDR *, struct inaddr *));
     322bool_t  xdr_ypmap_parms __P((XDR *, struct ypmap_parms *));
     323bool_t  xdr_yppushresp_xfr __P((XDR *, struct yppushresp_xfr *));
     324bool_t  xdr_ypresp_order __P((XDR *, struct ypresp_order *));
     325bool_t  xdr_ypresp_master __P((XDR *, struct ypresp_master *));
     326bool_t  xdr_ypresp_maplist __P((XDR *, struct ypresp_maplist *));
     327__END_DECLS
     328
     329#endif /* _RPCSVC_YP_PROT_H_ */
  • cpukit/librpc/include/rpcsvc/ypclnt.h

    r0ab65474 rdf49c60  
     1/*
     2 * Copyright (c) 1992/3 Theo de Raadt <deraadt@fsa.ca>
     3 * All rights reserved.
     4 *
     5 * Redistribution and use in source and binary forms, with or without
     6 * modification, are permitted provided that the following conditions
     7 * are met:
     8 * 1. Redistributions of source code must retain the above copyright
     9 *    notice, this list of conditions and the following disclaimer.
     10 * 2. Redistributions in binary form must reproduce the above copyright
     11 *    notice, this list of conditions and the following disclaimer in the
     12 *    documentation and/or other materials provided with the distribution.
     13 * 3. The name of the author may not be used to endorse or promote
     14 *    products derived from this software without specific prior written
     15 *    permission.
     16 *
     17 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
     18 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
     19 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     20 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
     21 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     22 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     23 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     24 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     25 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     26 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     27 * SUCH DAMAGE.
     28 *
     29 * $FreeBSD: src/include/rpcsvc/ypclnt.h,v 1.11 1999/08/27 23:45:12 peter Exp $
     30 */
     31
     32#ifndef _RPCSVC_YPCLNT_H_
     33#define _RPCSVC_YPCLNT_H_
     34
     35#include <sys/cdefs.h>
     36
     37#define YPERR_BADARGS   1               /* args to function are bad */
     38#define YPERR_RPC       2               /* RPC failure */
     39#define YPERR_DOMAIN    3               /* can't bind to a server for domain */
     40#define YPERR_MAP       4               /* no such map in server's domain */
     41#define YPERR_KEY       5               /* no such key in map */
     42#define YPERR_YPERR     6               /* some internal YP server or client error */
     43#define YPERR_RESRC     7               /* local resource allocation failure */
     44#define YPERR_NOMORE    8               /* no more records in map database */
     45#define YPERR_PMAP      9               /* can't communicate with portmapper */
     46#define YPERR_YPBIND    10              /* can't communicate with ypbind */
     47#define YPERR_YPSERV    11              /* can't communicate with ypserv */
     48#define YPERR_NODOM     12              /* local domain name not set */
     49#define YPERR_BADDB     13              /* YP data base is bad */
     50#define YPERR_VERS      14              /* YP version mismatch */
     51#define YPERR_ACCESS    15              /* access violation */
     52#define YPERR_BUSY      16              /* database is busy */
     53
     54/*
     55 * Types of update operations
     56 */
     57#define YPOP_CHANGE     1               /* change, do not add */
     58#define YPOP_INSERT     2               /* add, do not change */
     59#define YPOP_DELETE     3               /* delete this entry */
     60#define YPOP_STORE      4               /* add, or change */
     61
     62struct ypall_callback {
     63        /* return non-0 to stop getting called */
     64        int (*foreach) __P((unsigned long, char *, int, char *, int, void *));
     65        char *data;             /* opaque pointer for use of callback fn */
     66};
     67
     68struct dom_binding;
     69
     70__BEGIN_DECLS
     71int     yp_bind         __P((char *dom));
     72int     _yp_dobind      __P((char *dom, struct dom_binding **ypdb));
     73void    yp_unbind       __P((char *dom));
     74int     yp_get_default_domain __P((char **domp));
     75int     yp_match        __P((char *indomain, char *inmap,
     76                            const char *inkey, int inkeylen, char **outval,
     77                            int *outvallen));
     78int     yp_first        __P((char *indomain, char *inmap,
     79                            char **outkey, int *outkeylen, char **outval,
     80                            int *outvallen));
     81int     yp_next         __P((char *indomain, char *inmap,
     82                            char *inkey, int inkeylen, char **outkey,
     83                            int *outkeylen, char **outval, int *outvallen));
     84int     yp_master       __P((char *indomain, char *inmap, char **outname));
     85int     yp_order        __P((char *indomain, char *inmap, int *outorder));
     86int     yp_all          __P((char *indomain, char *inmap,
     87                            struct ypall_callback *incallback));
     88char *  yperr_string    __P((int incode));
     89char *  ypbinderr_string __P((int incode));
     90int     ypprot_err      __P((unsigned int incode));
     91__END_DECLS
     92
     93#endif /* _RPCSVC_YPCLNT_H_ */
     94
  • cpukit/librpc/include/rpcsvc/yppasswd.x

    r0ab65474 rdf49c60  
     1/*
     2 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
     3 * unrestricted use provided that this legend is included on all tape
     4 * media and as a part of the software program in whole or part.  Users
     5 * may copy or modify Sun RPC without charge, but are not authorized
     6 * to license or distribute it to anyone else except as part of a product or
     7 * program developed by the user.
     8 *
     9 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
     10 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
     11 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
     12 *
     13 * Sun RPC is provided with no support and without any obligation on the
     14 * part of Sun Microsystems, Inc. to assist in its use, correction,
     15 * modification or enhancement.
     16 *
     17 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
     18 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
     19 * OR ANY PART THEREOF.
     20 *
     21 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
     22 * or profits or other special, indirect and consequential damages, even if
     23 * Sun has been advised of the possibility of such damages.
     24 *
     25 * Sun Microsystems, Inc.
     26 * 2550 Garcia Avenue
     27 * Mountain View, California  94043
     28 */
     29
     30/*
     31 * YP password update protocol
     32 * Requires unix authentication
     33 */
     34
     35#ifndef RPC_HDR
     36%#ifndef lint
     37%/*static char sccsid[] = "from: @(#)yppasswd.x 1.1 87/04/13 Copyr 1987 Sun Micro";*/
     38%/*static char sccsid[] = "from: @(#)yppasswd.x 2.1 88/08/01 4.0 RPCSRC";*/
     39%static const char rcsid[] =
     40%  "$FreeBSD: src/include/rpcsvc/yppasswd.x,v 1.6 1999/08/27 23:45:12 peter Exp $";
     41%#endif /* not lint */
     42#endif
     43
     44program YPPASSWDPROG {
     45        version YPPASSWDVERS {
     46                /*
     47                 * Update my passwd entry
     48                 */
     49                int
     50                YPPASSWDPROC_UPDATE(yppasswd) = 1;
     51        } = 1;
     52} = 100009;
     53
     54
     55struct x_passwd {
     56        string pw_name<>;       /* username */
     57        string pw_passwd<>;     /* encrypted password */
     58        int pw_uid;             /* user id */
     59        int pw_gid;             /* group id */
     60        string pw_gecos<>;      /* in real life name */
     61        string pw_dir<>;        /* home directory */
     62        string pw_shell<>;      /* default shell */
     63};
     64
     65struct yppasswd {
     66        string oldpass<>;       /* unencrypted old password */
     67        x_passwd newpw;         /* new passwd entry */
     68};
     69
     70
     71#ifdef RPC_HDR
     72%#include <sys/cdefs.h>
     73%extern int _yppasswd __P(( char * , struct x_passwd * ));
     74%#define yppasswd(x,y) _yppasswd(x,y)
     75#endif
  • cpukit/librpc/include/rpcsvc/ypupdate_prot.x

    r0ab65474 rdf49c60  
     1%/*
     2% * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
     3% * unrestricted use provided that this legend is included on all tape
     4% * media and as a part of the software program in whole or part.  Users
     5% * may copy or modify Sun RPC without charge, but are not authorized
     6% * to license or distribute it to anyone else except as part of a product or
     7% * program developed by the user or with the express written consent of
     8% * Sun Microsystems, Inc.
     9% *
     10% * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
     11% * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
     12% * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
     13% *
     14% * Sun RPC is provided with no support and without any obligation on the
     15% * part of Sun Microsystems, Inc. to assist in its use, correction,
     16% * modification or enhancement.
     17% *
     18% * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
     19% * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
     20% * OR ANY PART THEREOF.
     21% *
     22% * In no event will Sun Microsystems, Inc. be liable for any lost revenue
     23% * or profits or other special, indirect and consequential damages, even if
     24% * Sun has been advised of the possibility of such damages.
     25% *
     26% * Sun Microsystems, Inc.
     27% * 2550 Garcia Avenue
     28% * Mountain View, California  94043
     29% */
     30
     31%/*
     32% * Copyright (c) 1986, 1990 by Sun Microsystems, Inc.
     33% */
     34%
     35%/* from @(#)ypupdate_prot.x    1.3 91/03/11 TIRPC 1.0 */
     36#ifndef RPC_HDR
     37%#ifndef lint
     38%static const char rcsid[] =
     39%  "$FreeBSD: src/include/rpcsvc/ypupdate_prot.x,v 1.3 1999/08/27 23:45:13 peter Exp $";
     40%#endif
     41#endif
     42%
     43%/*
     44% * Compiled from ypupdate_prot.x using rpcgen
     45% * This is NOT source code!
     46% * DO NOT EDIT THIS FILE!
     47% */
     48
     49/*
     50 * YP update service protocol
     51 */
     52#ifdef RPC_HDR
     53%
     54%#ifndef _rpcsvc_ypupdate_prot_h
     55%#define _rpcsvc_ypupdate_prot_h
     56%
     57#endif
     58
     59const MAXMAPNAMELEN = 255;
     60const MAXYPDATALEN  = 1023;
     61const MAXERRMSGLEN  = 255;
     62
     63program YPU_PROG {
     64        version YPU_VERS {
     65                u_int YPU_CHANGE(ypupdate_args) = 1;
     66                u_int YPU_INSERT(ypupdate_args) = 2;
     67                u_int YPU_DELETE(ypdelete_args) = 3;
     68                u_int YPU_STORE(ypupdate_args)  = 4;
     69        } = 1;
     70} = 100028;
     71
     72typedef opaque yp_buf<MAXYPDATALEN>;
     73
     74struct ypupdate_args {
     75        string mapname<MAXMAPNAMELEN>;
     76        yp_buf key;
     77        yp_buf datum;
     78};
     79
     80struct ypdelete_args {
     81        string mapname<MAXMAPNAMELEN>;
     82        yp_buf key;
     83};
     84
     85#ifdef RPC_HDR
     86%
     87%#endif /* !_rpcsvc_ypupdate_prot_h */
     88#endif
  • cpukit/librpc/include/rpcsvc/ypxfrd.x

    r0ab65474 rdf49c60  
     1/*
     2 * Copyright (c) 1995, 1996
     3 *      Bill Paul <wpaul@ctr.columbia.edu>.  All rights reserved.
     4 *
     5 * Redistribution and use in source and binary forms, with or without
     6 * modification, are permitted provided that the following conditions
     7 * are met:
     8 * 1. Redistributions of source code must retain the above copyright
     9 *    notice, this list of conditions and the following disclaimer.
     10 * 2. Redistributions in binary form must reproduce the above copyright
     11 *    notice, this list of conditions and the following disclaimer in the
     12 *    documentation and/or other materials provided with the distribution.
     13 * 3. All advertising materials mentioning features or use of this software
     14 *    must display the following acknowledgement:
     15 *      This product includes software developed by Bill Paul.
     16 * 4. Neither the name of the author nor the names of any co-contributors
     17 *    may be used to endorse or promote products derived from this software
     18 *    without specific prior written permission.
     19 *
     20 * THIS SOFTWARE IS PROVIDED BY Bill Paul AND CONTRIBUTORS ``AS IS'' AND
     21 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
     22 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
     23 * ARE DISCLAIMED.  IN NO EVENT SHALL Bill Paul OR CONTRIBUTORS BE LIABLE
     24 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
     25 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
     26 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
     27 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
     28 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
     29 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
     30 * SUCH DAMAGE.
     31 *
     32 * $FreeBSD: src/include/rpcsvc/ypxfrd.x,v 1.7 1999/08/27 23:45:13 peter Exp $
     33 */
     34
     35/*
     36 * This protocol definition file describes a file transfer
     37 * system used to very quickly move NIS maps from one host to
     38 * another. This is similar to what Sun does with their ypxfrd
     39 * protocol, but it must be stressed that this protocol is _NOT_
     40 * compatible with Sun's. There are a couple of reasons for this:
     41 *
     42 * 1) Sun's protocol is proprietary. The protocol definition is
     43 *    not freely available in any of the SunRPC source distributions,
     44 *    even though the NIS v2 protocol is.
     45 *
     46 * 2) The idea here is to transfer entire raw files rather than
     47 *    sending just the records. Sun uses ndbm for its NIS map files,
     48 *    while FreeBSD uses Berkeley DB. Both are hash databases, but the
     49 *    formats are incompatible, making it impossible for them to
     50 *    use each others' files. Even if FreeBSD adopted ndbm for its
     51 *    database format, FreeBSD/i386 is a little-endian OS and
     52 *    SunOS/SPARC is big-endian; ndbm is byte-order sensitive and
     53 *    not very smart about it, which means an attempt to read a
     54 *    database on a little-endian box that was created on a big-endian
     55 *    box (or vice-versa) can cause the ndbm code to eat itself.
     56 *    Luckily, Berkeley DB is able to deal with this situation in
     57 *    a more graceful manner.
     58 *
     59 * While the protocol is incompatible, the idea is the same: we just open
     60 * up a TCP pipe to the client and transfer the raw map database
     61 * from the master server to the slave. This is many times faster than
     62 * the standard yppush/ypxfr transfer method since it saves us from
     63 * having to recreate the map databases via the DB library each time.
     64 * For example: creating a passwd database with 30,000 entries with yp_mkdb
     65 * can take a couple of minutes, but to just copy the file takes only a few
     66 * seconds.
     67 */
     68
     69#ifndef RPC_HDR
     70%#ifndef lint
     71%static const char rcsid[] =
     72%  "$FreeBSD: src/include/rpcsvc/ypxfrd.x,v 1.7 1999/08/27 23:45:13 peter Exp $";
     73%#endif /* not lint */
     74#endif
     75
     76/* XXX cribbed from yp.x */
     77const _YPMAXRECORD = 1024;
     78const _YPMAXDOMAIN = 64;
     79const _YPMAXMAP = 64;
     80const _YPMAXPEER = 64;
     81
     82/* Suggested default -- not necesarrily the one used. */
     83const YPXFRBLOCK = 32767;
     84
     85/*
     86 * Possible return codes from the remote server.
     87 */
     88enum xfrstat {
     89        XFR_REQUEST_OK  = 1,    /* Transfer request granted */
     90        XFR_DENIED      = 2,    /* Transfer request denied */
     91        XFR_NOFILE      = 3,    /* Requested map file doesn't exist */
     92        XFR_ACCESS      = 4,    /* File exists, but I couldn't access it */
     93        XFR_BADDB       = 5,    /* File is not a hash database */
     94        XFR_READ_OK     = 6,    /* Block read successfully */
     95        XFR_READ_ERR    = 7,    /* Read error during transfer */
     96        XFR_DONE        = 8,    /* Transfer completed */
     97        XFR_DB_ENDIAN_MISMATCH  = 9,    /* Database byte order mismatch */
     98        XFR_DB_TYPE_MISMATCH    = 10    /* Database type mismatch */
     99};
     100
     101/*
     102 * Database type specifications. The client can use this to ask
     103 * the server for a particular type of database or just take whatever
     104 * the server has to offer.
     105 */
     106enum xfr_db_type {
     107        XFR_DB_ASCII            = 1,    /* Flat ASCII text */
     108        XFR_DB_BSD_HASH         = 2,    /* Berkeley DB, hash method */
     109        XFR_DB_BSD_BTREE        = 3,    /* Berkeley DB, btree method */
     110        XFR_DB_BSD_RECNO        = 4,    /* Berkeley DB, recno method */
     111        XFR_DB_BSD_MPOOL        = 5,    /* Berkeley DB, mpool method */
     112        XFR_DB_BSD_NDBM         = 6,    /* Berkeley DB, hash, ndbm compat */
     113        XFR_DB_GNU_GDBM         = 7,    /* GNU GDBM */
     114        XFR_DB_DBM              = 8,    /* Old, deprecated dbm format */
     115        XFR_DB_NDBM             = 9,    /* ndbm format (used by Sun's NISv2) */
     116        XFR_DB_OPAQUE           = 10,   /* Mystery format -- just pass along */
     117        XFR_DB_ANY              = 11,   /* I'll take any format you've got */
     118        XFR_DB_UNKNOWN          = 12    /* Unknown format */
     119};
     120
     121/*
     122 * Machine byte order specification. This allows the client to check
     123 * that it's copying a map database from a machine of similar byte sex.
     124 * This is necessary for handling database libraries that are fatally
     125 * byte order sensitive.
     126 *
     127 * The XFR_ENDIAN_ANY type is for use with the Berkeley DB database
     128 * formats; Berkeley DB is smart enough to make up for byte order
     129 * differences, so byte sex isn't important.
     130 */
     131enum xfr_byte_order {
     132        XFR_ENDIAN_BIG          = 1,    /* We want big endian */
     133        XFR_ENDIAN_LITTLE       = 2,    /* We want little endian */
     134        XFR_ENDIAN_ANY          = 3     /* We'll take whatever you got */
     135};
     136
     137typedef string xfrdomain<_YPMAXDOMAIN>;
     138typedef string xfrmap<_YPMAXMAP>;
     139typedef string xfrmap_filename<_YPMAXMAP>;      /* actual name of map file */
     140
     141/*
     142 * Ask the remote ypxfrd for a map using this structure.
     143 * Note: we supply both a map name and a map file name. These are not
     144 * the same thing. In the case of ndbm, maps are stored in two files:
     145 * map.bykey.pag and may.bykey.dir. We may also have to deal with
     146 * file extensions (on the off chance that the remote server is supporting
     147 * multiple DB formats). To handle this, we tell the remote server both
     148 * what map we want and, in the case of ndbm, whether we want the .dir
     149 * or the .pag part. This name should not be a fully qualified path:
     150 * it's up to the remote server to decide which directories to look in.
     151 */
     152struct ypxfr_mapname {
     153        xfrmap xfrmap;
     154        xfrdomain xfrdomain;
     155        xfrmap_filename xfrmap_filename;
     156        xfr_db_type xfr_db_type;
     157        xfr_byte_order xfr_byte_order;
     158};
     159
     160/* Read response using this structure. */
     161union xfr switch (bool ok) {
     162case TRUE:
     163        opaque xfrblock_buf<>;
     164case FALSE:
     165        xfrstat xfrstat;
     166};
     167
     168program YPXFRD_FREEBSD_PROG {
     169        version YPXFRD_FREEBSD_VERS {
     170                union xfr
     171                YPXFRD_GETMAP(ypxfr_mapname) = 1;
     172        } = 1;
     173} = 600100069;  /* 100069 + 60000000 -- 100069 is the Sun ypxfrd prog number */
Note: See TracChangeset for help on using the changeset viewer.