Changeset df49c60 in rtems for c/src/exec/librpc


Ignore:
Timestamp:
06/12/00 15:00:15 (23 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:
c/src/exec/librpc
Files:
133 edited

Legend:

Unmodified
Added
Removed
  • c/src/exec/librpc/Makefile.am

    r0ab65474 rdf49c60  
    88SUBDIRS = include src
    99
     10EXTRA_DIST = README_RTEMS
     11
    1012include $(top_srcdir)/../../../automake/subdirs.am
    1113include $(top_srcdir)/../../../automake/local.am
  • c/src/exec/librpc/README_RTEMS

    r0ab65474 rdf49c60  
     1USING RPC/XDR ON RTEMS
     2======================
     3For the most part, programmers using RPC/XDR routines on RTEMS
     4can proceed as if they were to be using a POSIX/UNIX system.
     5The only significant changes are those to start the portmapper
     6and to allow use of RPC/XDR by multiple threads.
     7
     8Starting the portmapper
     9=======================
     10The SUN portmapper program has been modified to run as an RTEMS
     11task.  Applications which need the portmapper can start this
     12task by calling:
     13        int rtems_rpc_start_portmapper (int priority);
     14The return value is an RTEMS status code.
     15
     16Multi-threaded operation
     17========================
     18The RPC/XDR package has been modified to allow for multiple RTEMS
     19tasks to use RPC/XDR routines.  If more than one task is to call
     20an RPC/XDR routine, the additional tasks must call:
     21        int rtems_rpc_task_init(void);
     22before calling any RPC/XDR routines.  For example, the portmapper
     23calls this routine since the portmapper uses RPC/XDR routines in
     24a separate thread.
     25The return value is an RTEMS status code.
     26
     27
     28Porting Notes
     29=============
     30Most of the FreeBSD rpc library ports to RTEMS with little
     31or no modification beyond that required to provide for operation
     32in a multitasking environment.  Multitasking operation was
     33provided by moving all `static persistence' variables into
     34a single structure and using an RTEMS task variable to point
     35to that structure. 
     36
     37Some of the library, however, has not made it into the RTEMS
     38implementation.  FreeBSD source files which have been left out include:
     39- Files which provide RPC to the AF_UNIX address family:
     40        clnt_unix.c
     41        svc_unix.c
     42  An `ifndef __rtems__' was added to clnt_generic.c because clnt_unix.c
     43  was omitted.
     44- Files which need NIS:
     45        auth_time.c
     46- Files which provide DES authentication:
     47        auth_des.c
     48        authdes_prot.c
     49        crypt_client.c
     50        des_crypt.c
     51        des_soft.c
     52        getpublickey.c
     53        key_call.c
     54        key_prot_xdr.c
     55        svc_auth_des.c
     56
     57The FreeBSD xdr source compiles and runs on RTEMS without modification.
     58
     59The original source was obtained from:
     60        ftp://ftp.FreeBSD.org/pub/FreeBSD/
     61                        branches/4.0-stable/src/lib/libc/rpc
     62                        branches/4.0-stable/src/lib/libc/xdr
     63                        branches/4.0-stable/src/include/rpc
     64                        branches/4.0-stable/src/include/rpcsvc
  • c/src/exec/librpc/include/Makefile.am

    r0ab65474 rdf49c60  
    55AUTOMAKE_OPTIONS = foreign 1.4
    66
    7 SUBDIRS = rpc
     7SUBDIRS = rpc rpcsvc
    88
    99include $(top_srcdir)/../../../automake/subdirs.am
  • c/src/exec/librpc/include/rpc/Makefile.am

    r0ab65474 rdf49c60  
    55AUTOMAKE_OPTIONS = foreign 1.4
    66
    7 H_FILES = auth.h rpc.h svc.h types.h clnt.h rpc_msg.h svc_auth.h xdr.h
     7H_FILES = auth.h auth_des.h auth_unix.h clnt.h des.h des_crypt.h pmap_clnt.h \
     8    pmap_prot.h pmap_rmt.h rpc.h rpc_com.h rpc_msg.h svc.h svc_auth.h \
     9    types.h xdr.h
    810
    911noinst_HEADERS = $(H_FILES)
    1012
    1113if HAS_NETWORKING
    12 PREINSTALL_FILES = \
    13 $(PROJECT_INCLUDE)/rpc \
    14 $(H_FILES:%=$(PROJECT_INCLUDE)/rpc/%)
     14PREINSTALL_FILES += $(PROJECT_INCLUDE)/rpc \
     15    $(H_FILES:%=$(PROJECT_INCLUDE)/rpc/%)
    1516
    1617$(PROJECT_INCLUDE)/rpc:
     
    2021endif
    2122
    22 all-am: $(PREINSTALL_FILES)
    23 debug-am: $(PREINSTALL_FILES)
    24 profile-am: $(PREINSTALL_FILES)
     23all-local: $(PREINSTALL_FILES)
    2524
    2625include $(top_srcdir)/../../../automake/local.am
  • c/src/exec/librpc/include/rpc/auth.h

    r0ab65474 rdf49c60  
    1 #ifndef RPC_AUTH_H
    2 #define RPC_AUTH_H
    3 
    4 /* @(#)auth.h   2.3 88/08/07 4.0 RPCSRC; from 1.17 88/02/08 SMI */
    51/*
    62 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
     
    106 * to license or distribute it to anyone else except as part of a product or
    117 * program developed by the user.
    12  * 
     8 *
    139 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
    14  * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
     10 * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    1511 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
    16  * 
     12 *
    1713 * Sun RPC is provided with no support and without any obligation on the
    1814 * part of Sun Microsystems, Inc. to assist in its use, correction,
    1915 * modification or enhancement.
    20  * 
     16 *
    2117 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
    2218 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
    2319 * OR ANY PART THEREOF.
    24  * 
     20 *
    2521 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
    2622 * or profits or other special, indirect and consequential damages, even if
    2723 * Sun has been advised of the possibility of such damages.
    28  * 
     24 *
    2925 * Sun Microsystems, Inc.
    3026 * 2550 Garcia Avenue
    3127 * Mountain View, California  94043
     28 *
     29 *      from: @(#)auth.h 1.17 88/02/08 SMI
     30 *      from: @(#)auth.h        2.3 88/08/07 4.0 RPCSRC
     31 * $FreeBSD: src/include/rpc/auth.h,v 1.15 1999/08/27 23:45:02 peter Exp $
    3232 */
    3333
     
    4242 */
    4343
     44#ifndef _RPC_AUTH_H
     45#define _RPC_AUTH_H
     46#include <sys/cdefs.h>
     47#include <sys/socket.h>
    4448
    4549#define MAX_AUTH_BYTES  400
     
    6872union des_block {
    6973        struct {
    70                 u_int32 high;
    71                 u_int32 low;
     74                u_int32_t high;
     75                u_int32_t low;
    7276        } key;
    7377        char c[8];
    7478};
    7579typedef union des_block des_block;
    76 extern bool_t xdr_des_block();
     80__BEGIN_DECLS
     81extern bool_t xdr_des_block __P((XDR *, des_block *));
     82__END_DECLS
    7783
    7884/*
     
    8490        u_int   oa_length;              /* not to exceed MAX_AUTH_BYTES */
    8591};
     92__BEGIN_DECLS
     93bool_t xdr_opaque_auth __P((XDR *xdrs, struct opaque_auth *ap));
     94__END_DECLS
    8695
    8796
     
    8998 * Auth handle, interface to client side authenticators.
    9099 */
    91 typedef struct {
     100typedef struct __rpc_auth {
    92101        struct  opaque_auth     ah_cred;
    93102        struct  opaque_auth     ah_verf;
    94103        union   des_block       ah_key;
    95104        struct auth_ops {
    96                 void    (*ah_nextverf)();
    97                 int     (*ah_marshal)();        /* nextverf & serialize */
    98                 int     (*ah_validate)();       /* validate varifier */
    99                 int     (*ah_refresh)();        /* refresh credentials */
    100                 void    (*ah_destroy)();        /* destroy this structure */
     105                void    (*ah_nextverf) __P((struct __rpc_auth *));
     106                /* nextverf & serialize */
     107                int     (*ah_marshal) __P((struct __rpc_auth *, XDR *));
     108                /* validate verifier */
     109                int     (*ah_validate) __P((struct __rpc_auth *,
     110                                struct opaque_auth *));
     111                /* refresh credentials */
     112                int     (*ah_refresh) __P((struct __rpc_auth *));
     113                /* destroy this structure */
     114                void    (*ah_destroy) __P((struct __rpc_auth *));
    101115        } *ah_ops;
    102116        caddr_t ah_private;
     
    139153
    140154extern struct opaque_auth _null_auth;
    141 
    142155
    143156/*
     
    154167 *      int *aup_gids;
    155168 */
    156 extern AUTH *authunix_create();
    157 extern AUTH *authunix_create_default(); /* takes no parameters */
    158 extern AUTH *authnone_create();         /* takes no parameters */
    159 extern AUTH *authdes_create();
     169__BEGIN_DECLS
     170struct sockaddr_in;
     171extern AUTH *authunix_create            __P((char *, int, int, int, int *));
     172extern AUTH *authunix_create_default    __P((void));
     173extern AUTH *authnone_create            __P((void));
     174__END_DECLS
     175
     176/* Forward compatibility with TI-RPC */
     177#define authsys_create authunix_create
     178#define authsys_create_default authunix_create_default
     179
     180/*
     181 * DES style authentication
     182 * AUTH *authdes_create(servername, window, timehost, ckey)
     183 *      char *servername;               - network name of server
     184 *      u_int window;                   - time to live
     185 *      struct sockaddr *timehost;      - optional hostname to sync with
     186 *      des_block *ckey;                - optional conversation key to use
     187 */
     188__BEGIN_DECLS
     189extern AUTH *authdes_create __P(( char *, u_int, struct sockaddr *, des_block * ));
     190#ifdef NOTYET
     191/*
     192 * TI-RPC supports this call, but it requires the inclusion of
     193 * NIS+-specific headers which would require the inclusion of other
     194 * headers which would result in a tangled mess. For now, the NIS+
     195 * code prototypes this routine internally.
     196 */
     197extern AUTH *authdes_pk_create __P(( char *, netobj *, u_int,
     198                                     struct sockaddr *, des_block *,
     199                                     nis_server * ));
     200#endif
     201__END_DECLS
     202
     203/*
     204 * Netname manipulation routines.
     205 */
     206__BEGIN_DECLS
     207extern int netname2user __P(( char *, uid_t *, gid_t *, int *, gid_t *));
     208extern int netname2host __P(( char *, char *, int ));
     209extern int getnetname __P(( char * ));
     210extern int user2netname __P(( char *, uid_t, char * ));
     211extern int host2netname __P(( char *, char *, char * ));
     212extern void passwd2des __P(( char *, char * ));
     213__END_DECLS
     214
     215/*
     216 * Keyserv interface routines.
     217 * XXX Should not be here.
     218 */
     219#ifndef HEXKEYBYTES
     220#define HEXKEYBYTES 48
     221#endif
     222typedef char kbuf[HEXKEYBYTES];
     223typedef char *namestr;
     224
     225struct netstarg {
     226        kbuf st_priv_key;
     227        kbuf st_pub_key;
     228        namestr st_netname;
     229};
     230
     231__BEGIN_DECLS
     232extern int key_decryptsession __P(( const char *, des_block * ));
     233extern int key_decryptsession_pk __P(( char *, netobj *, des_block * ));
     234extern int key_encryptsession __P(( const char *, des_block * ));
     235extern int key_encryptsession_pk __P(( char *, netobj *, des_block * ));
     236extern int key_gendes __P(( des_block * ));
     237extern int key_setsecret __P(( const char * ));
     238extern int key_secretkey_is_set __P(( void ));
     239extern int key_setnet __P(( struct netstarg * ));
     240extern int key_get_conv __P(( char *, des_block * ));
     241__END_DECLS
     242
     243/*
     244 * Publickey routines.
     245 */
     246__BEGIN_DECLS
     247extern int getpublickey __P(( char *, char * ));
     248extern int getpublicandprivatekey __P(( char *, char * ));
     249extern int getsecretkey __P(( char *, char *, char * ));
     250__END_DECLS
     251
    160252
    161253#define AUTH_NONE       0               /* no authentication */
    162254#define AUTH_NULL       0               /* backward compatibility */
    163255#define AUTH_UNIX       1               /* unix style (uid, gids) */
     256#define AUTH_SYS        1               /* forward compatibility */
    164257#define AUTH_SHORT      2               /* short hand unix style */
    165258#define AUTH_DES        3               /* des style (encrypted timestamps) */
    166259
    167 #endif /* RPC_AUTH_H */
     260#endif /* !_RPC_AUTH_H */
  • c/src/exec/librpc/include/rpc/auth_des.h

    r0ab65474 rdf49c60  
     1/*      @(#)auth_des.h  2.2 88/07/29 4.0 RPCSRC; from 1.3 88/02/08 SMI */
     2/*
     3 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
     4 * unrestricted use provided that this legend is included on all tape
     5 * media and as a part of the software program in whole or part.  Users
     6 * may copy or modify Sun RPC without charge, but are not authorized
     7 * to license or distribute it to anyone else except as part of a product or
     8 * program developed by the user.
     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) 1988 by Sun Microsystems, Inc.
     33 */
     34
     35/*
     36 * auth_des.h, Protocol for DES style authentication for RPC
     37 */
     38
     39#ifndef _AUTH_DES_
     40#define _AUTH_DES_
     41
     42/*
     43 * There are two kinds of "names": fullnames and nicknames
     44 */
     45enum authdes_namekind {
     46        ADN_FULLNAME,
     47        ADN_NICKNAME
     48};
     49
     50/*
     51 * A fullname contains the network name of the client,
     52 * a conversation key and the window
     53 */
     54struct authdes_fullname {
     55        char *name;             /* network name of client, up to MAXNETNAMELEN */
     56        des_block key;          /* conversation key */
     57        u_long window;          /* associated window */
     58};
     59
     60
     61/*
     62 * A credential
     63 */
     64struct authdes_cred {
     65        enum authdes_namekind adc_namekind;
     66        struct authdes_fullname adc_fullname;
     67        u_long adc_nickname;
     68};
     69
     70
     71
     72/*
     73 * A des authentication verifier
     74 */
     75struct authdes_verf {
     76        union {
     77                struct timeval adv_ctime;       /* clear time */
     78                des_block adv_xtime;            /* crypt time */
     79        } adv_time_u;
     80        u_long adv_int_u;
     81};
     82
     83/*
     84 * des authentication verifier: client variety
     85 *
     86 * adv_timestamp is the current time.
     87 * adv_winverf is the credential window + 1.
     88 * Both are encrypted using the conversation key.
     89 */
     90#define adv_timestamp   adv_time_u.adv_ctime
     91#define adv_xtimestamp  adv_time_u.adv_xtime
     92#define adv_winverf     adv_int_u
     93
     94/*
     95 * des authentication verifier: server variety
     96 *
     97 * adv_timeverf is the client's timestamp + client's window
     98 * adv_nickname is the server's nickname for the client.
     99 * adv_timeverf is encrypted using the conversation key.
     100 */
     101#define adv_timeverf    adv_time_u.adv_ctime
     102#define adv_xtimeverf   adv_time_u.adv_xtime
     103#define adv_nickname    adv_int_u
     104
     105__BEGIN_DECLS
     106extern int authdes_getucred __P(( struct authdes_cred *, uid_t *, gid_t *, int *, gid_t * ));
     107__END_DECLS
     108
     109#endif /* ndef _AUTH_DES_ */
  • c/src/exec/librpc/include/rpc/auth_unix.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, MERCHANTABILITY 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 *      from: @(#)auth_unix.h 1.8 88/02/08 SMI
     30 *      from: @(#)auth_unix.h   2.2 88/07/29 4.0 RPCSRC
     31 * $FreeBSD: src/include/rpc/auth_unix.h,v 1.10 1999/08/27 23:45:03 peter Exp $
     32 */
     33
     34/*
     35 * auth_unix.h, Protocol for UNIX style authentication parameters for RPC
     36 *
     37 * Copyright (C) 1984, Sun Microsystems, Inc.
     38 */
     39
     40/*
     41 * The system is very weak.  The client uses no encryption for  it
     42 * credentials and only sends null verifiers.  The server sends backs
     43 * null verifiers or optionally a verifier that suggests a new short hand
     44 * for the credentials.
     45 */
     46
     47#ifndef _RPC_AUTH_UNIX_H
     48#define _RPC_AUTH_UNIX_H
     49#include <sys/cdefs.h>
     50
     51/* The machine name is part of a credential; it may not exceed 255 bytes */
     52#define MAX_MACHINE_NAME 255
     53
     54/* gids compose part of a credential; there may not be more than 16 of them */
     55#define NGRPS 16
     56
     57/*
     58 * Unix style credentials.
     59 */
     60struct authunix_parms {
     61        u_long   aup_time;
     62        char    *aup_machname;
     63        int      aup_uid;
     64        int      aup_gid;
     65        u_int    aup_len;
     66        int     *aup_gids;
     67};
     68
     69#define authsys_parms authunix_parms
     70
     71__BEGIN_DECLS
     72extern bool_t xdr_authunix_parms __P((XDR *, struct authunix_parms *));
     73__END_DECLS
     74
     75/*
     76 * If a response verifier has flavor AUTH_SHORT,
     77 * then the body of the response verifier encapsulates the following structure;
     78 * again it is serialized in the obvious fashion.
     79 */
     80struct short_hand_verf {
     81        struct opaque_auth new_cred;
     82};
     83
     84#endif /* !_RPC_AUTH_UNIX_H */
  • c/src/exec/librpc/include/rpc/clnt.h

    r0ab65474 rdf49c60  
    1 #ifndef RPC_CLNT_H
    2 #define RPC_CLNT_H
    3 
    4 /* @(#)clnt.h   2.1 88/07/29 4.0 RPCSRC; from 1.31 88/02/08 SMI*/
    51/*
    62 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
     
    106 * to license or distribute it to anyone else except as part of a product or
    117 * program developed by the user.
    12  * 
     8 *
    139 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
    14  * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
     10 * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    1511 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
    16  * 
     12 *
    1713 * Sun RPC is provided with no support and without any obligation on the
    1814 * part of Sun Microsystems, Inc. to assist in its use, correction,
    1915 * modification or enhancement.
    20  * 
     16 *
    2117 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
    2218 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
    2319 * OR ANY PART THEREOF.
    24  * 
     20 *
    2521 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
    2622 * or profits or other special, indirect and consequential damages, even if
    2723 * Sun has been advised of the possibility of such damages.
    28  * 
     24 *
    2925 * Sun Microsystems, Inc.
    3026 * 2550 Garcia Avenue
    3127 * Mountain View, California  94043
     28 *
     29 *      from: @(#)clnt.h 1.31 88/02/08 SMI
     30 *      from: @(#)clnt.h        2.1 88/07/29 4.0 RPCSRC
     31 * $FreeBSD: src/include/rpc/clnt.h,v 1.11 1999/08/27 23:45:03 peter Exp $
    3232 */
    3333
     
    3838 */
    3939
    40 #ifndef _CLNT_
    41 #define _CLNT_
     40#ifndef _RPC_CLNT_H_
     41#define _RPC_CLNT_H_
     42#include <sys/cdefs.h>
     43#include <sys/un.h>
    4244
    4345/*
     
    9193        enum clnt_stat re_status;
    9294        union {
    93                 int RE_errno;           /* realated system error */
     95                int RE_errno;           /* related system error */
    9496                enum auth_stat RE_why;  /* why the auth error occurred */
    9597                struct {
    96                         u_long low;     /* lowest verion supported */
    97                         u_long high;    /* highest verion supported */
     98                        u_int32_t low;  /* lowest verion supported */
     99                        u_int32_t high; /* highest verion supported */
    98100                } RE_vers;
    99101                struct {                /* maybe meaningful if RPC_FAILED */
    100                         long s1;
    101                         long s2;
     102                        int32_t s1;
     103                        int32_t s2;
    102104                } RE_lb;                /* life boot & debugging only */
    103105        } ru;
     
    114116 * Client is responsible for initializing auth, see e.g. auth_none.c.
    115117 */
    116 typedef struct {
     118typedef struct __rpc_client {
    117119        AUTH    *cl_auth;                       /* authenticator */
    118120        struct clnt_ops {
    119                 enum clnt_stat  (*cl_call)();   /* call remote procedure */
    120                 void            (*cl_abort)();  /* abort a call */
    121                 void            (*cl_geterr)(); /* get specific error code */
    122                 bool_t          (*cl_freeres)(); /* frees results */
    123                 void            (*cl_destroy)();/* destroy this structure */
    124                 bool_t          (*cl_control)();/* the ioctl() of rpc */
     121                /* call remote procedure */
     122                enum clnt_stat  (*cl_call) __P((struct __rpc_client *,
     123                                        u_long, xdrproc_t, caddr_t, xdrproc_t,
     124                                        caddr_t, struct timeval));
     125                /* abort a call */
     126                void            (*cl_abort) __P((struct __rpc_client *));
     127                /* get specific error code */
     128                void            (*cl_geterr) __P((struct __rpc_client *,
     129                                        struct rpc_err *));
     130                /* frees results */
     131                bool_t          (*cl_freeres) __P((struct __rpc_client *,
     132                                        xdrproc_t, caddr_t));
     133                /* destroy this structure */
     134                void            (*cl_destroy) __P((struct __rpc_client *));
     135                /* the ioctl() of rpc */
     136                bool_t          (*cl_control) __P((struct __rpc_client *, u_int,
     137                                        void *));
    125138        } *cl_ops;
    126139        caddr_t                 cl_private;     /* private stuff */
     
    147160 */
    148161#define CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs)     \
    149         ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs))
     162        ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, (caddr_t)argsp, \
     163                xres, (caddr_t)resp, secs))
    150164#define clnt_call(rh, proc, xargs, argsp, xres, resp, secs)     \
    151         ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs))
     165        ((*(rh)->cl_ops->cl_call)(rh, proc, xargs, (caddr_t)argsp, \
     166                xres, (caddr_t)resp, secs))
    152167
    153168/*
     
    189204
    190205/*
    191  * control operations that apply to both udp and tcp transports
     206 * control operations that apply to udp, tcp and unix transports
     207 *
     208 * Note: options marked XXX are no-ops in this implementation of RPC.
     209 * The are present in TI-RPC but can't be implemented here since they
     210 * depend on the presence of STREAMS/TLI, which we don't have.
     211 *
    192212 */
    193213#define CLSET_TIMEOUT       1   /* set timeout (timeval) */
    194214#define CLGET_TIMEOUT       2   /* get timeout (timeval) */
    195215#define CLGET_SERVER_ADDR   3   /* get server's address (sockaddr) */
     216#define CLGET_FD            6   /* get connections file descriptor */
     217#define CLGET_SVC_ADDR      7   /* get server's address (netbuf)         XXX */
     218#define CLSET_FD_CLOSE      8   /* close fd while clnt_destroy */
     219#define CLSET_FD_NCLOSE     9   /* Do not close fd while clnt_destroy */
     220#define CLGET_XID           10  /* Get xid */
     221#define CLSET_XID           11  /* Set xid */
     222#define CLGET_VERS          12  /* Get version number */
     223#define CLSET_VERS          13  /* Set version number */
     224#define CLGET_PROG          14  /* Get program number */
     225#define CLSET_PROG          15  /* Set program number */
     226#define CLSET_SVC_ADDR      16  /* get server's address (netbuf)         XXX */
     227#define CLSET_PUSH_TIMOD    17  /* push timod if not already present     XXX */
     228#define CLSET_POP_TIMOD     18  /* pop timod                             XXX */
     229
    196230/*
    197231 * udp only control operations
     
    199233#define CLSET_RETRY_TIMEOUT 4   /* set retry timeout (timeval) */
    200234#define CLGET_RETRY_TIMEOUT 5   /* get retry timeout (timeval) */
     235
     236/*
     237 * Operations which GSSAPI needs. (Bletch.)
     238 */
     239#define CLGET_LOCAL_ADDR    19  /* get local addr (sockaddr) */
     240
    201241
    202242/*
     
    210250
    211251/*
    212  * RPCTEST is a test program which is accessable on every rpc
     252 * RPCTEST is a test program which is accessible on every rpc
    213253 * transport/port.  It is used for testing, performance evaluation,
    214254 * and network administration.
     
    228268/*
    229269 * Below are the client handle creation routines for the various
    230  * implementations of client side rpc.  They can return NULL if a 
     270 * implementations of client side rpc.  They can return NULL if a
    231271 * creation failure occurs.
    232272 */
     
    239279 *      u_long vers;
    240280 */
    241 extern CLIENT *clntraw_create();
    242 
    243 
    244 /*
    245  * Generic client creation routine. Supported protocols are "udp" and "tcp"
    246  */
    247 extern CLIENT *
    248 clnt_create(/*host, prog, vers, prot*/); /*
    249         char *host;     -- hostname
    250         u_long prog;    -- program number
    251         u_long vers;    -- version number
    252         char *prot;     -- protocol
    253 */
    254 
    255 
     281__BEGIN_DECLS
     282extern CLIENT *clntraw_create   __P((u_long, u_long));
     283__END_DECLS
     284
     285
     286/*
     287 * Generic client creation routine. Supported protocols are "udp", "tcp"
     288 * and "unix".
     289 * CLIENT *
     290 * clnt_create(host, prog, vers, prot);
     291 *      char *host;     -- hostname
     292 *      u_long prog;    -- program number
     293 *      u_long vers;    -- version number
     294 *      char *prot;     -- protocol
     295 */
     296__BEGIN_DECLS
     297extern CLIENT *clnt_create      __P((char *, u_long, u_long, char *));
     298__END_DECLS
    256299
    257300
     
    267310 *      u_int recvsz;
    268311 */
    269 extern CLIENT *clnttcp_create();
     312__BEGIN_DECLS
     313extern CLIENT *clnttcp_create   __P((struct sockaddr_in *,
     314                                     u_long,
     315                                     u_long,
     316                                     int *,
     317                                     u_int,
     318                                     u_int));
     319__END_DECLS
     320
    270321
    271322/*
     
    290341 *      u_int recvsz;
    291342 */
    292 extern CLIENT *clntudp_create();
    293 extern CLIENT *clntudp_bufcreate();
     343__BEGIN_DECLS
     344extern CLIENT *clntudp_create   __P((struct sockaddr_in *,
     345                                     u_long,
     346                                     u_long,
     347                                     struct timeval,
     348                                     int *));
     349extern CLIENT *clntudp_bufcreate __P((struct sockaddr_in *,
     350                                     u_long,
     351                                     u_long,
     352                                     struct timeval,
     353                                     int *,
     354                                     u_int,
     355                                     u_int));
     356__END_DECLS
     357
     358
     359/*
     360 * AF_UNIX based rpc
     361 * CLIENT *
     362 * clntunix_create(raddr, prog, vers, sockp, sendsz, recvsz)
     363 *      struct sockaddr_un *raddr;
     364 *      u_long prog;
     365 *      u_long version;
     366 *      register int *sockp;
     367 *      u_int sendsz;
     368 *      u_int recvsz;
     369 */
     370__BEGIN_DECLS
     371extern CLIENT *clntunix_create  __P((struct sockaddr_un *,
     372                                     u_long,
     373                                     u_long,
     374                                     int *,
     375                                     u_int,
     376                                     u_int));
     377__END_DECLS
     378
    294379
    295380/*
    296381 * Print why creation failed
    297382 */
    298 void clnt_pcreateerror(/* char *msg */);        /* stderr */
    299 char *clnt_spcreateerror(/* char *msg */);      /* string */
     383__BEGIN_DECLS
     384extern void clnt_pcreateerror   __P((char *));                  /* stderr */
     385extern char *clnt_spcreateerror __P((char *));                  /* string */
     386__END_DECLS
    300387
    301388/*
    302389 * Like clnt_perror(), but is more verbose in its output
    303  */
    304 void clnt_perrno(/* enum clnt_stat num */);     /* stderr */
     390 */
     391__BEGIN_DECLS
     392extern void clnt_perrno         __P((enum clnt_stat));          /* stderr */
     393extern char *clnt_sperrno       __P((enum clnt_stat));          /* string */
     394__END_DECLS
    305395
    306396/*
    307397 * Print an English error message, given the client error code
    308398 */
    309 void clnt_perror(/* CLIENT *clnt, char *msg */);        /* stderr */
    310 char *clnt_sperror(/* CLIENT *clnt, char *msg */);      /* string */
    311 
    312 /*
     399__BEGIN_DECLS
     400extern void clnt_perror         __P((CLIENT *, char *));        /* stderr */
     401extern char *clnt_sperror       __P((CLIENT *, char *));        /* string */
     402__END_DECLS
     403
     404
     405/*
    313406 * If a creation fails, the following allows the user to figure out why.
    314407 */
     
    321414
    322415
    323 
    324 /*
    325  * Copy error message to buffer.
    326  */
    327 char *clnt_sperrno(/* enum clnt_stat num */);   /* string */
    328 
    329 
    330 
    331416#define UDPMSGSIZE      8800    /* rpc imposed limit on udp msg size */
    332417#define RPCSMALLMSGSIZE 400     /* a more reasonable packet size */
    333418
    334 #endif /*!_CLNT_*/
    335 
    336 #endif /*  RPC_CLNT_H */
     419#endif /* !_RPC_CLNT_H */
  • c/src/exec/librpc/include/rpc/des.h

    r0ab65474 rdf49c60  
     1/*  @(#)des.h   2.2 88/08/10 4.0 RPCSRC; from 2.7 88/02/08 SMI  */
     2/*
     3 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
     4 * unrestricted use provided that this legend is included on all tape
     5 * media and as a part of the software program in whole or part.  Users
     6 * may copy or modify Sun RPC without charge, but are not authorized
     7 * to license or distribute it to anyone else except as part of a product or
     8 * program developed by the user.
     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 * Generic DES driver interface
     32 * Keep this file hardware independent!
     33 * Copyright (c) 1986 by Sun Microsystems, Inc.
     34 */
     35
     36#define DES_MAXLEN      65536   /* maximum # of bytes to encrypt  */
     37#define DES_QUICKLEN    16      /* maximum # of bytes to encrypt quickly */
     38
     39enum desdir { ENCRYPT, DECRYPT };
     40enum desmode { CBC, ECB };
     41
     42/*
     43 * parameters to ioctl call
     44 */
     45struct desparams {
     46        u_char des_key[8];      /* key (with low bit parity) */
     47        enum desdir des_dir;    /* direction */
     48        enum desmode des_mode;  /* mode */
     49        u_char des_ivec[8];     /* input vector */
     50        unsigned des_len;       /* number of bytes to crypt */
     51        union {
     52                u_char UDES_data[DES_QUICKLEN];
     53                u_char *UDES_buf;
     54        } UDES;
     55#       define des_data UDES.UDES_data  /* direct data here if quick */
     56#       define des_buf  UDES.UDES_buf   /* otherwise, pointer to data */
     57};
     58
     59#ifdef notdef
     60
     61/*
     62 * These ioctls are only implemented in SunOS. Maybe someday
     63 * if somebody writes a driver for DES hardware that works
     64 * with FreeBSD, we can being that back.
     65 */
     66
     67/*
     68 * Encrypt an arbitrary sized buffer
     69 */
     70#define DESIOCBLOCK     _IOWR(d, 6, struct desparams)
     71
     72/*
     73 * Encrypt of small amount of data, quickly
     74 */
     75#define DESIOCQUICK     _IOWR(d, 7, struct desparams)
     76
     77#endif
     78
     79/*
     80 * Software DES.
     81 */
     82extern int _des_crypt __P(( char *, int, struct desparams * ));
  • c/src/exec/librpc/include/rpc/des_crypt.h

    r0ab65474 rdf49c60  
     1/*
     2 * @(#)des_crypt.h      2.1 88/08/11 4.0 RPCSRC;        from 1.4 88/02/08 (C) 1986 SMI
     3 * $FreeBSD: src/include/rpc/des_crypt.h,v 1.2 1999/12/29 05:00:42 peter Exp $
     4 *
     5 * des_crypt.h, des library routine interface
     6 * Copyright (C) 1986, Sun Microsystems, Inc.
     7 */
     8/*
     9 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
     10 * unrestricted use provided that this legend is included on all tape
     11 * media and as a part of the software program in whole or part.  Users
     12 * may copy or modify Sun RPC without charge, but are not authorized
     13 * to license or distribute it to anyone else except as part of a product or
     14 * program developed by the user.
     15 *
     16 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
     17 * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
     18 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
     19 *
     20 * Sun RPC is provided with no support and without any obligation on the
     21 * part of Sun Microsystems, Inc. to assist in its use, correction,
     22 * modification or enhancement.
     23 *
     24 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
     25 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
     26 * OR ANY PART THEREOF.
     27 *
     28 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
     29 * or profits or other special, indirect and consequential damages, even if
     30 * Sun has been advised of the possibility of such damages.
     31 *
     32 * Sun Microsystems, Inc.
     33 * 2550 Garcia Avenue
     34 * Mountain View, California  94043
     35 */
     36
     37#include <sys/cdefs.h>
     38#include <rpc/rpc.h>
     39
     40#define DES_MAXDATA 8192        /* max bytes encrypted in one call */
     41#define DES_DIRMASK (1 << 0)
     42#define DES_ENCRYPT (0*DES_DIRMASK)     /* Encrypt */
     43#define DES_DECRYPT (1*DES_DIRMASK)     /* Decrypt */
     44
     45
     46#define DES_DEVMASK (1 << 1)
     47#define DES_HW (0*DES_DEVMASK)  /* Use hardware device */
     48#define DES_SW (1*DES_DEVMASK)  /* Use software device */
     49
     50
     51#define DESERR_NONE 0   /* succeeded */
     52#define DESERR_NOHWDEVICE 1     /* succeeded, but hw device not available */
     53#define DESERR_HWERROR 2        /* failed, hardware/driver error */
     54#define DESERR_BADPARAM 3       /* failed, bad parameter to call */
     55
     56#define DES_FAILED(err) \
     57        ((err) > DESERR_NOHWDEVICE)
     58
     59/*
     60 * cbc_crypt()
     61 * ecb_crypt()
     62 *
     63 * Encrypt (or decrypt) len bytes of a buffer buf.
     64 * The length must be a multiple of eight.
     65 * The key should have odd parity in the low bit of each byte.
     66 * ivec is the input vector, and is updated to the new one (cbc only).
     67 * The mode is created by oring together the appropriate parameters.
     68 * DESERR_NOHWDEVICE is returned if DES_HW was specified but
     69 * there was no hardware to do it on (the data will still be
     70 * encrypted though, in software).
     71 */
     72
     73
     74/*
     75 * Cipher Block Chaining mode
     76 */
     77__BEGIN_DECLS
     78#ifdef __STDC__
     79int cbc_crypt __P(( char *, char *, unsigned int, unsigned int, char *));
     80#else
     81cbc_crypt(/* key, buf, len, mode, ivec */); /*
     82        char *key;     
     83        char *buf;
     84        unsigned len;
     85        unsigned mode;
     86        char *ivec;     
     87*/
     88#endif
     89
     90/*
     91 * Electronic Code Book mode
     92 */
     93#ifdef __STDC__
     94int ecb_crypt __P(( char *, char *, unsigned int, unsigned int ));
     95#else
     96ecb_crypt(/* key, buf, len, mode */); /*
     97        char *key;     
     98        char *buf;
     99        unsigned len;
     100        unsigned mode;
     101*/
     102#endif
     103__END_DECLS
     104
     105#ifndef _KERNEL
     106/*
     107 * Set des parity for a key.
     108 * DES parity is odd and in the low bit of each byte
     109 */
     110__BEGIN_DECLS
     111#ifdef __STDC__
     112void des_setparity __P(( char *));
     113#else
     114void
     115des_setparity(/* key */); /*
     116        char *key;     
     117*/
     118#endif
     119__END_DECLS
     120#endif
  • c/src/exec/librpc/include/rpc/pmap_clnt.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, MERCHANTABILITY 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 *      from: @(#)pmap_clnt.h 1.11 88/02/08 SMI
     30 *      from: @(#)pmap_clnt.h   2.1 88/07/29 4.0 RPCSRC
     31 * $FreeBSD: src/include/rpc/pmap_clnt.h,v 1.11 1999/08/27 23:45:04 peter Exp $
     32 */
     33
     34/*
     35 * pmap_clnt.h
     36 * Supplies C routines to get to portmap services.
     37 *
     38 * Copyright (C) 1984, Sun Microsystems, Inc.
     39 */
     40
     41/*
     42 * Usage:
     43 *      success = pmap_set(program, version, protocol, port);
     44 *      success = pmap_unset(program, version);
     45 *      port = pmap_getport(address, program, version, protocol);
     46 *      head = pmap_getmaps(address);
     47 *      clnt_stat = pmap_rmtcall(address, program, version, procedure,
     48 *              xdrargs, argsp, xdrres, resp, tout, port_ptr)
     49 *              (works for udp only.)
     50 *      clnt_stat = clnt_broadcast(program, version, procedure,
     51 *              xdrargs, argsp, xdrres, resp, eachresult)
     52 *              (like pmap_rmtcall, except the call is broadcasted to all
     53 *              locally connected nets.  For each valid response received,
     54 *              the procedure eachresult is called.  Its form is:
     55 *      done = eachresult(resp, raddr)
     56 *              bool_t done;
     57 *              caddr_t resp;
     58 *              struct sockaddr_in raddr;
     59 *              where resp points to the results of the call and raddr is the
     60 *              address if the responder to the broadcast.
     61 */
     62
     63#ifndef _RPC_PMAPCLNT_H
     64#define _RPC_PMAPCLNT_H
     65#include <sys/cdefs.h>
     66
     67__BEGIN_DECLS
     68extern bool_t           pmap_set        __P((u_long, u_long, int, int));
     69extern bool_t           pmap_unset      __P((u_long, u_long));
     70extern struct pmaplist  *pmap_getmaps   __P((struct sockaddr_in *));
     71extern enum clnt_stat   pmap_rmtcall    __P((struct sockaddr_in *,
     72                                             u_long, u_long, u_long,
     73                                             xdrproc_t, caddr_t,
     74                                             xdrproc_t, caddr_t,
     75                                             struct timeval, u_long *));
     76extern enum clnt_stat   clnt_broadcast  __P((u_long, u_long, u_long,
     77                                             xdrproc_t, char *,
     78                                             xdrproc_t, char *,
     79                                             bool_t (*) __P((caddr_t,
     80                                                 struct sockaddr_in *))));
     81extern u_short          pmap_getport    __P((struct sockaddr_in *,
     82                                             u_long, u_long, u_int));
     83__END_DECLS
     84
     85#endif /* !_RPC_PMAPCLNT_H */
  • c/src/exec/librpc/include/rpc/pmap_prot.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, MERCHANTABILITY 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 *      from: @(#)pmap_prot.h 1.14 88/02/08 SMI
     30 *      from: @(#)pmap_prot.h   2.1 88/07/29 4.0 RPCSRC
     31 * $FreeBSD: src/include/rpc/pmap_prot.h,v 1.10 1999/08/27 23:45:04 peter Exp $
     32 */
     33
     34/*
     35 * pmap_prot.h
     36 * Protocol for the local binder service, or pmap.
     37 *
     38 * Copyright (C) 1984, Sun Microsystems, Inc.
     39 *
     40 * The following procedures are supported by the protocol:
     41 *
     42 * PMAPPROC_NULL() returns ()
     43 *      takes nothing, returns nothing
     44 *
     45 * PMAPPROC_SET(struct pmap) returns (bool_t)
     46 *      TRUE is success, FALSE is failure.  Registers the tuple
     47 *      [prog, vers, prot, port].
     48 *
     49 * PMAPPROC_UNSET(struct pmap) returns (bool_t)
     50 *      TRUE is success, FALSE is failure.  Un-registers pair
     51 *      [prog, vers].  prot and port are ignored.
     52 *
     53 * PMAPPROC_GETPORT(struct pmap) returns (long unsigned).
     54 *      0 is failure.  Otherwise returns the port number where the pair
     55 *      [prog, vers] is registered.  It may lie!
     56 *
     57 * PMAPPROC_DUMP() RETURNS (struct pmaplist *)
     58 *
     59 * PMAPPROC_CALLIT(unsigned, unsigned, unsigned, string<>)
     60 *      RETURNS (port, string<>);
     61 * usage: encapsulatedresults = PMAPPROC_CALLIT(prog, vers, proc, encapsulatedargs);
     62 *      Calls the procedure on the local machine.  If it is not registered,
     63 *      this procedure is quite; ie it does not return error information!!!
     64 *      This procedure only is supported on rpc/udp and calls via
     65 *      rpc/udp.  This routine only passes null authentication parameters.
     66 *      This file has no interface to xdr routines for PMAPPROC_CALLIT.
     67 *
     68 * The service supports remote procedure calls on udp/ip or tcp/ip socket 111.
     69 */
     70
     71#ifndef _RPC_PMAPPROT_H
     72#define _RPC_PMAPPROT_H
     73#include <sys/cdefs.h>
     74
     75#define PMAPPORT                ((u_short)111)
     76#define PMAPPROG                ((u_long)100000)
     77#define PMAPVERS                ((u_long)2)
     78#define PMAPVERS_PROTO          ((u_long)2)
     79#define PMAPVERS_ORIG           ((u_long)1)
     80#define PMAPPROC_NULL           ((u_long)0)
     81#define PMAPPROC_SET            ((u_long)1)
     82#define PMAPPROC_UNSET          ((u_long)2)
     83#define PMAPPROC_GETPORT        ((u_long)3)
     84#define PMAPPROC_DUMP           ((u_long)4)
     85#define PMAPPROC_CALLIT         ((u_long)5)
     86
     87struct pmap {
     88        long unsigned pm_prog;
     89        long unsigned pm_vers;
     90        long unsigned pm_prot;
     91        long unsigned pm_port;
     92};
     93
     94struct pmaplist {
     95        struct pmap     pml_map;
     96        struct pmaplist *pml_next;
     97};
     98
     99__BEGIN_DECLS
     100extern bool_t xdr_pmap          __P((XDR *, struct pmap *));
     101extern bool_t xdr_pmaplist      __P((XDR *, struct pmaplist **));
     102__END_DECLS
     103
     104#endif /* !_RPC_PMAPPROT_H */
  • c/src/exec/librpc/include/rpc/pmap_rmt.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, MERCHANTABILITY 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 *      from: @(#)pmap_rmt.h 1.2 88/02/08 SMI
     30 *      from: @(#)pmap_rmt.h    2.1 88/07/29 4.0 RPCSRC
     31 * $FreeBSD: src/include/rpc/pmap_rmt.h,v 1.10 1999/08/27 23:45:05 peter Exp $
     32 */
     33
     34/*
     35 * Structures and XDR routines for parameters to and replies from
     36 * the portmapper remote-call-service.
     37 *
     38 * Copyright (C) 1986, Sun Microsystems, Inc.
     39 */
     40
     41#ifndef _RPC_PMAPRMT_H
     42#define _RPC_PMAPRMT_H
     43#include <sys/cdefs.h>
     44
     45struct rmtcallargs {
     46        u_long prog, vers, proc, arglen;
     47        caddr_t args_ptr;
     48        xdrproc_t xdr_args;
     49};
     50
     51struct rmtcallres {
     52        u_long *port_ptr;
     53        u_long resultslen;
     54        caddr_t results_ptr;
     55        xdrproc_t xdr_results;
     56};
     57
     58__BEGIN_DECLS
     59extern bool_t xdr_rmtcall_args  __P((XDR *, struct rmtcallargs *));
     60extern bool_t xdr_rmtcallres    __P((XDR *, struct rmtcallres *));
     61__END_DECLS
     62
     63#endif /* !_RPC_PMAPRMT_H */
  • c/src/exec/librpc/include/rpc/rpc.h

    r0ab65474 rdf49c60  
    1 #ifndef RPC_H
    2 #define RPC_H
    3 
    4 /* @(#)rpc.h    2.4 89/07/11 4.0 RPCSRC; from 1.9 88/02/08 SMI */
    51/*
    62 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
     
    106 * to license or distribute it to anyone else except as part of a product or
    117 * program developed by the user.
    12  * 
     8 *
    139 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
    14  * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
     10 * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    1511 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
    16  * 
     12 *
    1713 * Sun RPC is provided with no support and without any obligation on the
    1814 * part of Sun Microsystems, Inc. to assist in its use, correction,
     
    3026 * 2550 Garcia Avenue
    3127 * Mountain View, California  94043
     28 *
     29 *      from: @(#)rpc.h 1.9 88/02/08 SMI
     30 *      from: @(#)rpc.h 2.4 89/07/11 4.0 RPCSRC
     31 * $FreeBSD: src/include/rpc/rpc.h,v 1.12 2000/01/26 09:02:40 shin Exp $
    3232 */
    3333
     
    3838 * Copyright (C) 1984, Sun Microsystems, Inc.
    3939 */
    40 #ifndef __RPC_HEADER__
    41 #define __RPC_HEADER__
     40#ifndef _RPC_RPC_H
     41#define _RPC_RPC_H
    4242
    4343#include <rpc/types.h>          /* some typedefs */
    4444#include <netinet/in.h>
    45 #include <sys/socket.h>
    4645
    4746/* external data representation interfaces */
     
    5655/* semi-private protocol headers */
    5756#include <rpc/rpc_msg.h>        /* protocol for rpc messages */
    58 /*#include "auth_unix.h"        * protocol for unix style cred */
     57#include <rpc/auth_unix.h>      /* protocol for unix style cred */
    5958/*
    60  *  Uncomment-out the next line if you are building the rpc library with   
     59 *  Uncomment-out the next line if you are building the rpc library with
    6160 *  DES Authentication (see the README file in the secure_rpc/ directory).
    6261 */
    63 /*#include "auth_des.h"  * protocol for des style cred */
     62#include <rpc/auth_des.h>       /* protocol for des style cred */
    6463
    6564/* Server side only remote procedure callee */
     
    8079};
    8180
    82 struct rpcent *getrpcbyname(), *getrpcbynumber(), *getrpcent();
     81__BEGIN_DECLS
     82extern struct rpcent *getrpcbyname      __P((char *));
     83extern struct rpcent *getrpcbynumber    __P((int));
     84extern struct rpcent *getrpcent         __P((void));
     85extern int getrpcport __P((char *host, int prognum, int versnum, int proto));
     86extern void setrpcent __P((int));
     87extern void endrpcent __P((void));
    8388
    84 #endif /* ndef __RPC_HEADER__ */
     89extern int bindresvport __P((int, struct sockaddr_in *));
     90extern int bindresvport_sa __P((int, struct sockaddr *));
     91extern int get_myaddress __P((struct sockaddr_in *));
     92__END_DECLS
    8593
    86 #endif /* RPC_H */
     94int rtems_rpc_task_init (void);
     95int rtems_rpc_start_portmapper (int priority);
     96
     97#ifdef _RTEMS_RPC_INTERNAL_
     98/*
     99 * Multi-threaded support
     100 * Group all global and static variables into a single spot.
     101 * This area will be allocated on a per-task basis
     102 */
     103struct rtems_rpc_task_variables {
     104        int             svc_svc_maxfd;
     105        fd_set          svc_svc_fdset;
     106        void            *svc_xports;
     107        int             svc_xportssize;
     108        int             svc__svc_fdsetsize;
     109        void            *svc__svc_fdset;
     110        void            *svc_svc_head;
     111
     112        void            *clnt_perror_buf;
     113
     114        void            *clnt_raw_private;
     115
     116        void            *call_rpc_private;
     117
     118        void            *svc_raw_private;
     119
     120        void            *svc_simple_proglst;
     121        void            *svc_simple_pl;
     122        void            *svc_simple_transp;
     123
     124        void            *rpcdname_default_domain;
     125
     126        void            *svc_auths_Auths;
     127};
     128extern void *rtems_rpc_task_variables;
     129
     130#define svc_maxfd (((struct rtems_rpc_task_variables *)rtems_rpc_task_variables)->svc_svc_maxfd)
     131#define svc_fdset (((struct rtems_rpc_task_variables *)rtems_rpc_task_variables)->svc_svc_fdset)
     132#define __svc_fdsetsize (((struct rtems_rpc_task_variables *)rtems_rpc_task_variables)->svc__svc_fdsetsize)
     133#define __svc_fdset (fd_set *)(((struct rtems_rpc_task_variables *)rtems_rpc_task_variables)->svc__svc_fdset)
     134
     135#endif /* _RTEMS_RPC_INTERNAL_ */
     136
     137#endif /* !_RPC_RPC_H */
  • c/src/exec/librpc/include/rpc/rpc_com.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 * Copyright (c) 1986 - 1991 by Sun Microsystems, Inc.
     31 */
     32
     33/*
     34 * rpc_com.h, Common definitions for both the server and client side.
     35 * All for the topmost layer of rpc
     36 *
     37 */
     38
     39#ifndef _RPC_RPCCOM_H
     40#define _RPC_RPCCOM_H
     41
     42/* From: #pragma ident  "@(#)rpc_com.h  1.11    93/07/05 SMI" */
     43
     44#ifdef __cplusplus
     45extern "C" {
     46#endif
     47
     48/*
     49 * File descriptor to be used on xxx_create calls to get default descriptor
     50 */
     51#define RPC_ANYSOCK     -1
     52#define RPC_ANYFD       RPC_ANYSOCK
     53/*
     54 * The max size of the transport, if the size cannot be determined
     55 * by other means.
     56 */
     57#define RPC_MAXDATASIZE 9000
     58#define RPC_MAXADDRSIZE 1024
     59
     60#if defined(__STDC__) || defined(__cplusplus)
     61extern u_int __rpc_get_t_size (int, long);
     62extern u_int __rpc_get_a_size (long);
     63extern int __rpc_dtbsize (void);
     64extern int _rpc_dtablesize (void);
     65extern  int  _rpc_get_default_domain(char **);
     66#else
     67extern u_int __rpc_get_t_size ();
     68extern u_int __rpc_get_a_size ();
     69extern int __rpc_dtbsize ();
     70extern int _rpc_dtablesize ();
     71extern  int _rpc_get_default_domain();
     72#endif
     73
     74#ifdef __cplusplus
     75}
     76#endif
     77
     78#endif /* _RPC_RPCCOM_H */
  • c/src/exec/librpc/include/rpc/rpc_msg.h

    r0ab65474 rdf49c60  
    1 #ifndef RPC_MSG_H
    2 #define RPC_MSG_H
    3 
    4 /* @(#)rpc_msg.h        2.1 88/07/29 4.0 RPCSRC */
    51/*
    62 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
     
    106 * to license or distribute it to anyone else except as part of a product or
    117 * program developed by the user.
    12  * 
     8 *
    139 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
    14  * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
     10 * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    1511 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
    16  * 
     12 *
    1713 * Sun RPC is provided with no support and without any obligation on the
    1814 * part of Sun Microsystems, Inc. to assist in its use, correction,
    1915 * modification or enhancement.
    20  * 
     16 *
    2117 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
    2218 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
    2319 * OR ANY PART THEREOF.
    24  * 
     20 *
    2521 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
    2622 * or profits or other special, indirect and consequential damages, even if
    2723 * Sun has been advised of the possibility of such damages.
    28  * 
     24 *
    2925 * Sun Microsystems, Inc.
    3026 * 2550 Garcia Avenue
    3127 * Mountain View, California  94043
     28 *
     29 *      from: @(#)rpc_msg.h 1.7 86/07/16 SMI
     30 *      from: @(#)rpc_msg.h     2.1 88/07/29 4.0 RPCSRC
     31 * $FreeBSD: src/include/rpc/rpc_msg.h,v 1.12 1999/08/27 23:45:05 peter Exp $
    3232 */
    33 /*      @(#)rpc_msg.h 1.7 86/07/16 SMI      */
    3433
    3534/*
     
    3938 * Copyright (C) 1984, Sun Microsystems, Inc.
    4039 */
     40
     41#ifndef _RPC_RPCMSG_H
     42#define _RPC_RPCMSG_H
    4143
    4244#define RPC_MSG_VERSION         ((u_long) 2)
     
    8789        union {
    8890                struct {
    89                         u_long  low;
    90                         u_long  high;
     91                        u_int32_t       low;
     92                        u_int32_t       high;
    9193                } AR_versions;
    9294                struct {
     
    107109        union {
    108110                struct {
    109                         u_long low;
    110                         u_long high;
     111                        u_int32_t low;
     112                        u_int32_t high;
    111113                } RJ_versions;
    112114                enum auth_stat RJ_why;  /* why authentication did not work */
     
    133135 */
    134136struct call_body {
    135         u_long cb_rpcvers;      /* must be equal to two */
    136         u_long cb_prog;
    137         u_long cb_vers;
    138         u_long cb_proc;
     137        u_int32_t cb_rpcvers;   /* must be equal to two */
     138        u_int32_t cb_prog;
     139        u_int32_t cb_vers;
     140        u_int32_t cb_proc;
    139141        struct opaque_auth cb_cred;
    140142        struct opaque_auth cb_verf; /* protocol specific - provided by client */
     
    145147 */
    146148struct rpc_msg {
    147         u_long                  rm_xid;
     149        u_int32_t               rm_xid;
    148150        enum msg_type           rm_direction;
    149151        union {
     
    157159#define rjcted_rply     ru.RM_rmb.ru.RP_dr
    158160
    159 
     161__BEGIN_DECLS
    160162/*
    161163 * XDR routine to handle a rpc message.
     
    164166 *      struct rpc_msg *cmsg;
    165167 */
    166 extern bool_t   xdr_callmsg();
     168extern bool_t   xdr_callmsg     __P((XDR *, struct rpc_msg *));
    167169
    168170/*
     
    172174 *      struct rpc_msg *cmsg;
    173175 */
    174 extern bool_t   xdr_callhdr();
     176extern bool_t   xdr_callhdr     __P((XDR *, struct rpc_msg *));
    175177
    176178/*
     
    180182 *      struct rpc_msg *rmsg;
    181183 */
    182 extern bool_t   xdr_replymsg();
     184extern bool_t   xdr_replymsg    __P((XDR *, struct rpc_msg *));
    183185
    184186/*
     
    188190 *      struct rpc_err *error;
    189191 */
    190 extern void     _seterr_reply();
     192struct rpc_err;
     193extern void     _seterr_reply   __P((struct rpc_msg *, struct rpc_err *));
     194__END_DECLS
    191195
    192 #endif /* RPC_MSG_H */
     196#endif /* !_RPC_RPCMSG_H */
  • c/src/exec/librpc/include/rpc/svc.h

    r0ab65474 rdf49c60  
    1 
    2 #ifndef RPC_SVC_H
    3 #define RPC_SVC_H
    4 
    5 /* @(#)svc.h    2.2 88/07/29 4.0 RPCSRC; from 1.20 88/02/08 SMI */
    61/*
    72 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
     
    116 * to license or distribute it to anyone else except as part of a product or
    127 * program developed by the user.
    13  * 
     8 *
    149 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
    15  * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
     10 * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    1611 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
    17  * 
     12 *
    1813 * Sun RPC is provided with no support and without any obligation on the
    1914 * part of Sun Microsystems, Inc. to assist in its use, correction,
    2015 * modification or enhancement.
    21  * 
     16 *
    2217 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
    2318 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
    2419 * OR ANY PART THEREOF.
    25  * 
     20 *
    2621 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
    2722 * or profits or other special, indirect and consequential damages, even if
    2823 * Sun has been advised of the possibility of such damages.
    29  * 
     24 *
    3025 * Sun Microsystems, Inc.
    3126 * 2550 Garcia Avenue
    3227 * Mountain View, California  94043
     28 *
     29 *      from: @(#)svc.h 1.20 88/02/08 SMI
     30 *      from: @(#)svc.h 2.2 88/07/29 4.0 RPCSRC
     31 * $FreeBSD: src/include/rpc/svc.h,v 1.16 1999/12/29 05:00:43 peter Exp $
    3332 */
    3433
     
    3938 */
    4039
    41 #ifndef __SVC_HEADER__
    42 #define __SVC_HEADER__
     40#ifndef _RPC_SVC_H
     41#define _RPC_SVC_H
     42#include <sys/cdefs.h>
    4343
    4444/*
     
    7070};
    7171
     72struct rpc_msg;
     73
    7274/*
    7375 * Server side transport handle
    7476 */
    75 typedef struct {
     77typedef struct __rpc_svcxprt {
    7678        int             xp_sock;
    7779        u_short         xp_port;         /* associated port number */
    7880        struct xp_ops {
    79             bool_t      (*xp_recv)();    /* receive incomming requests */
    80             enum xprt_stat (*xp_stat)(); /* get transport status */
    81             bool_t      (*xp_getargs)(); /* get arguments */
    82             bool_t      (*xp_reply)();   /* send reply */
    83             bool_t      (*xp_freeargs)();/* free mem allocated for args */
    84             void        (*xp_destroy)(); /* destroy this struct */
     81            /* receive incoming requests */
     82            bool_t      (*xp_recv) __P((struct __rpc_svcxprt *,
     83                                struct rpc_msg *));
     84            /* get transport status */
     85            enum xprt_stat (*xp_stat) __P((struct __rpc_svcxprt *));
     86            /* get arguments */
     87            bool_t      (*xp_getargs) __P((struct __rpc_svcxprt *, xdrproc_t,
     88                                caddr_t));
     89            /* send reply */
     90            bool_t      (*xp_reply) __P((struct __rpc_svcxprt *,
     91                                struct rpc_msg *));
     92            /* free mem allocated for args */
     93            bool_t      (*xp_freeargs) __P((struct __rpc_svcxprt *, xdrproc_t,
     94                                caddr_t));
     95            /* destroy this struct */
     96            void        (*xp_destroy) __P((struct __rpc_svcxprt *));
    8597        } *xp_ops;
    8698        int             xp_addrlen;      /* length of remote address */
     
    139151 */
    140152struct svc_req {
    141         u_long          rq_prog;        /* service program number */
    142         u_long          rq_vers;        /* service protocol version */
    143         u_long          rq_proc;        /* the desired procedure */
     153        u_int32_t       rq_prog;        /* service program number */
     154        u_int32_t       rq_vers;        /* service protocol version */
     155        u_int32_t       rq_proc;        /* the desired procedure */
    144156        struct opaque_auth rq_cred;     /* raw creds from the wire */
    145157        caddr_t         rq_clntcred;    /* read only cooked cred */
     
    156168 *      u_long vers;
    157169 *      void (*dispatch)();
    158  *      int protocol;  (like TCP or UDP, zero means do not register)
    159  */
    160 extern bool_t   svc_register();
     170 *      int protocol;        (like TCP or UDP, zero means do not register)
     171 */
     172__BEGIN_DECLS
     173extern bool_t   svc_register __P((SVCXPRT *, u_long, u_long,
     174                        void (*) __P((struct svc_req *, SVCXPRT *)), int));
     175__END_DECLS
    161176
    162177/*
     
    167182 *      u_long vers;
    168183 */
    169 extern void     svc_unregister();
     184__BEGIN_DECLS
     185extern void     svc_unregister __P((u_long, u_long));
     186__END_DECLS
    170187
    171188/*
     
    175192 *      SVCXPRT *xprt;
    176193 */
    177 extern void     xprt_register();
     194__BEGIN_DECLS
     195extern void     xprt_register   __P((SVCXPRT *));
     196__END_DECLS
    178197
    179198/*
     
    183202 *      SVCXPRT *xprt;
    184203 */
    185 extern void     xprt_unregister();
     204__BEGIN_DECLS
     205extern void     xprt_unregister __P((SVCXPRT *));
     206__END_DECLS
    186207
    187208
     
    191212 * When the service routine is called, it must first check to see if it
    192213 * knows about the procedure;  if not, it should call svcerr_noproc
    193  * and return.  If so, it should deserialize its arguments via 
     214 * and return.  If so, it should deserialize its arguments via
    194215 * SVC_GETARGS (defined above).  If the deserialization does not work,
    195216 * svcerr_decode should be called followed by a return.  Successful
     
    202223 *
    203224 * NB: In pure implementations of rpc, the caller always waits for a reply
    204  * msg.  This message is sent when svc_sendreply is called. 
     225 * msg.  This message is sent when svc_sendreply is called.
    205226 * Therefore pure service implementations should always call
    206227 * svc_sendreply even if the function logically returns void;  use
     
    214235 */
    215236
    216 extern bool_t   svc_sendreply();
    217 extern void     svcerr_decode();
    218 extern void     svcerr_weakauth();
    219 extern void     svcerr_noproc();
    220 extern void     svcerr_progvers();
    221 extern void     svcerr_auth();
    222 extern void     svcerr_noprog();
    223 extern void     svcerr_systemerr();
    224    
     237__BEGIN_DECLS
     238extern bool_t   svc_sendreply   __P((SVCXPRT *, xdrproc_t, char *));
     239extern void     svcerr_decode   __P((SVCXPRT *));
     240extern void     svcerr_weakauth __P((SVCXPRT *));
     241extern void     svcerr_noproc   __P((SVCXPRT *));
     242extern void     svcerr_progvers __P((SVCXPRT *, u_long, u_long));
     243extern void     svcerr_auth     __P((SVCXPRT *, enum auth_stat));
     244extern void     svcerr_noprog   __P((SVCXPRT *));
     245extern void     svcerr_systemerr __P((SVCXPRT *));
     246__END_DECLS
     247
    225248/*
    226249 * Lowest level dispatching -OR- who owns this process anyway.
     
    236259/*
    237260 * Global keeper of rpc service descriptors in use
    238  * dynamic; must be inspected before each call to select 
    239  */
    240 #ifdef FD_SETSIZE
     261 * dynamic; must be inspected before each call to select
     262 */
     263extern int svc_maxfd;
    241264extern fd_set svc_fdset;
    242265#define svc_fds svc_fdset.fds_bits[0]   /* compatibility */
    243 #else
    244 extern int svc_fds;
    245 #endif /* def FD_SETSIZE */
    246 
     266
     267#ifndef _KERNEL
    247268/*
    248269 * a small program implemented by the svc_rpc implementation itself;
     
    250271 */
    251272extern void rpctest_service();
    252 
    253 extern void     svc_getreq();
    254 extern void     svc_getreqset();        /* takes fdset instead of int */
    255 extern void     svc_run();       /* never returns */
     273#endif
     274
     275__BEGIN_DECLS
     276extern void     svc_getreq      __P((int));
     277extern void     svc_getreqset   __P((fd_set *));
     278extern void     svc_getreqset2  __P((fd_set *, int)); /* XXX: nonstd, undoc */
     279extern void     svc_run         __P((void));
     280__END_DECLS
    256281
    257282/*
     
    267292 * Memory based rpc for testing and timing.
    268293 */
    269 extern SVCXPRT *svcraw_create();
     294__BEGIN_DECLS
     295extern SVCXPRT *svcraw_create __P((void));
     296__END_DECLS
     297
    270298
    271299/*
    272300 * Udp based rpc.
    273301 */
    274 extern SVCXPRT *svcudp_create();
    275 extern SVCXPRT *svcudp_bufcreate();
    276 extern int svcudp_enablecache(SVCXPRT *transp, u_long size);
     302__BEGIN_DECLS
     303extern SVCXPRT *svcudp_create __P((int));
     304extern SVCXPRT *svcudp_bufcreate __P((int, u_int, u_int));
     305__END_DECLS
     306
    277307
    278308/*
    279309 * Tcp based rpc.
    280310 */
    281 extern SVCXPRT *svctcp_create();
    282 
    283 
    284 
    285 #endif /* !__SVC_HEADER__ */
    286 
    287 extern int _rpcsvccount;
    288 extern int _rpcsvcstate;
    289 extern int _SERVED;
    290 
    291 #endif /* RPC_SVC_H */
     311__BEGIN_DECLS
     312extern SVCXPRT *svctcp_create __P((int, u_int, u_int));
     313extern SVCXPRT *svcfd_create __P((int, u_int, u_int));
     314__END_DECLS
     315
     316/*
     317 * AF_UNIX socket based rpc.
     318 */
     319__BEGIN_DECLS
     320extern SVCXPRT *svcunix_create __P((int, u_int, u_int, char *));
     321extern SVCXPRT *svcunixfd_create __P((int, u_int, u_int));
     322__END_DECLS
     323
     324#endif /* !_RPC_SVC_H */
  • c/src/exec/librpc/include/rpc/svc_auth.h

    r0ab65474 rdf49c60  
    1 #ifndef RPC_SVC_AUTH_H
    2 #define RPC_SVC_AUTH_H
    3 
    4 /* @(#)svc_auth.h       2.1 88/07/29 4.0 RPCSRC */
    51/*
    62 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
     
    106 * to license or distribute it to anyone else except as part of a product or
    117 * program developed by the user.
    12  * 
     8 *
    139 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
    14  * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
     10 * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    1511 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
    16  * 
     12 *
    1713 * Sun RPC is provided with no support and without any obligation on the
    1814 * part of Sun Microsystems, Inc. to assist in its use, correction,
    1915 * modification or enhancement.
    20  * 
     16 *
    2117 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
    2218 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
    2319 * OR ANY PART THEREOF.
    24  * 
     20 *
    2521 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
    2622 * or profits or other special, indirect and consequential damages, even if
    2723 * Sun has been advised of the possibility of such damages.
    28  * 
     24 *
    2925 * Sun Microsystems, Inc.
    3026 * 2550 Garcia Avenue
    3127 * Mountain View, California  94043
     28 *
     29 *      from: @(#)svc_auth.h 1.6 86/07/16 SMI
     30 *      from: @(#)svc_auth.h    2.1 88/07/29 4.0 RPCSRC
     31 * $FreeBSD: src/include/rpc/svc_auth.h,v 1.12 1999/08/27 23:45:05 peter Exp $
    3232 */
    33 /*      @(#)svc_auth.h 1.6 86/07/16 SMI      */
    3433
    3534/*
    3635 * svc_auth.h, Service side of rpc authentication.
    37  * 
     36 *
    3837 * Copyright (C) 1984, Sun Microsystems, Inc.
    3938 */
    4039
     40#ifndef _RPC_SVCAUTH_H
     41#define _RPC_SVCAUTH_H
     42
     43struct rpc_msg;
     44struct svc_req;
    4145
    4246/*
    4347 * Server side authenticator
    4448 */
    45 extern enum auth_stat _authenticate();
     49__BEGIN_DECLS
     50extern enum auth_stat _authenticate __P((struct svc_req *, struct rpc_msg *));
     51extern int svc_auth_reg __P((int, enum auth_stat (*)(struct svc_req *,
     52                                                     struct rpc_msg *)));
     53extern enum auth_stat _svcauth_des __P((struct svc_req *, struct rpc_msg *));
     54__END_DECLS
    4655
    47 #endif /* SVC_AUTH_H */
     56#endif /* !_RPC_SVCAUTH_H */
  • c/src/exec/librpc/include/rpc/types.h

    r0ab65474 rdf49c60  
    1 #ifndef RPC_TYPES_H
    2 #define RPC_TYPES_H
    3 
    4 /* @(#)types.h  2.3 88/08/15 4.0 RPCSRC */
    51/*
    62 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
     
    106 * to license or distribute it to anyone else except as part of a product or
    117 * program developed by the user.
    12  * 
     8 *
    139 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
    14  * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
     10 * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    1511 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
    16  * 
     12 *
    1713 * Sun RPC is provided with no support and without any obligation on the
    1814 * part of Sun Microsystems, Inc. to assist in its use, correction,
    1915 * modification or enhancement.
    20  * 
     16 *
    2117 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
    2218 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
    2319 * OR ANY PART THEREOF.
    24  * 
     20 *
    2521 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
    2622 * or profits or other special, indirect and consequential damages, even if
    2723 * Sun has been advised of the possibility of such damages.
    28  * 
     24 *
    2925 * Sun Microsystems, Inc.
    3026 * 2550 Garcia Avenue
    3127 * Mountain View, California  94043
     28 *
     29 *      from: @(#)types.h 1.18 87/07/24 SMI
     30 *      from: @(#)types.h       2.3 88/08/15 4.0 RPCSRC
     31 * $FreeBSD: src/include/rpc/types.h,v 1.9 1999/08/27 23:45:06 peter Exp $
    3232 */
    33 /*      @(#)types.h 1.18 87/07/24 SMI      */
    3433
    3534/*
    3635 * Rpc additions to <sys/types.h>
    3736 */
    38 #ifndef __TYPES_RPC_HEADER__
    39 #define __TYPES_RPC_HEADER__
     37#ifndef _RPC_TYPES_H
     38#define _RPC_TYPES_H
    4039
    41 /*#include <network/types.h>*/
    42 typedef unsigned long u_int32; /* 32-bit unsigned integers */
     40#define bool_t  int32_t
     41#define enum_t  int32_t
     42#define __dontcare__    -1
    4343
    44 #define bool_t  int
    45 #define enum_t  int
    4644#ifndef FALSE
    47 #       define  FALSE   (0)
     45#       define FALSE    (0)
    4846#endif
    4947#ifndef TRUE
    50 #    define     TRUE    (1)
     48#       define TRUE     (1)
    5149#endif
    52 #define __dontcare__    -1
    5350#ifndef NULL
    54 #       define NULL 0
     51#       define NULL     0
    5552#endif
    5653
    57 void *malloc();
    5854#define mem_alloc(bsize)        malloc(bsize)
    5955#define mem_free(ptr, bsize)    free(ptr)
     
    6460#include <sys/time.h>
    6561
    66 #ifndef INADDR_LOOPBACK
    67 #define       INADDR_LOOPBACK         (u_long)0x7F000001
    68 #endif
    69 #ifndef MAXHOSTNAMELEN
    70 #define        MAXHOSTNAMELEN  64
    71 #endif
    72 
    73 #endif /* ndef __TYPES_RPC_HEADER__ */
    74 
    75 #endif /* RPC_TYPES_H */
     62#endif /* !_RPC_TYPES_H */
  • c/src/exec/librpc/include/rpc/xdr.h

    r0ab65474 rdf49c60  
    1 #ifndef RPC_XDR_H
    2 #define RPC_XDR_H
    3 
    4 /* @(#)xdr.h    2.2 88/07/29 4.0 RPCSRC */
    51/*
    62 * Sun RPC is a product of Sun Microsystems, Inc. and is provided for
     
    106 * to license or distribute it to anyone else except as part of a product or
    117 * program developed by the user.
    12  * 
     8 *
    139 * SUN RPC IS PROVIDED AS IS WITH NO WARRANTIES OF ANY KIND INCLUDING THE
    14  * WARRANTIES OF DESIGN, MERCHANTIBILITY AND FITNESS FOR A PARTICULAR
     10 * WARRANTIES OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR
    1511 * PURPOSE, OR ARISING FROM A COURSE OF DEALING, USAGE OR TRADE PRACTICE.
    16  * 
     12 *
    1713 * Sun RPC is provided with no support and without any obligation on the
    1814 * part of Sun Microsystems, Inc. to assist in its use, correction,
    1915 * modification or enhancement.
    20  * 
     16 *
    2117 * SUN MICROSYSTEMS, INC. SHALL HAVE NO LIABILITY WITH RESPECT TO THE
    2218 * INFRINGEMENT OF COPYRIGHTS, TRADE SECRETS OR ANY PATENTS BY SUN RPC
    2319 * OR ANY PART THEREOF.
    24  * 
     20 *
    2521 * In no event will Sun Microsystems, Inc. be liable for any lost revenue
    2622 * or profits or other special, indirect and consequential damages, even if
    2723 * Sun has been advised of the possibility of such damages.
    28  * 
     24 *
    2925 * Sun Microsystems, Inc.
    3026 * 2550 Garcia Avenue
    3127 * Mountain View, California  94043
    32  */
    33 /*      @(#)xdr.h 1.19 87/04/22 SMI      */
     28 *
     29 *      from: @(#)xdr.h 1.19 87/04/22 SMI
     30 *      from: @(#)xdr.h 2.2 88/07/29 4.0 RPCSRC
     31 * $FreeBSD: src/include/rpc/xdr.h,v 1.14 1999/12/29 05:00:44 peter Exp $
     32 */
    3433
    3534/*
     
    3938 */
    4039
    41 #ifndef __XDR_HEADER__
    42 #define __XDR_HEADER__
     40#ifndef _RPC_XDR_H
     41#define _RPC_XDR_H
     42#include <sys/cdefs.h>
    4343
    4444/*
     
    9191
    9292/*
    93  * A xdrproc_t exists for each data type which is to be encoded or decoded.
    94  *
    95  * The second argument to the xdrproc_t is a pointer to an opaque pointer.
    96  * The opaque pointer generally points to a structure of the data type
    97  * to be decoded.  If this pointer is 0, then the type routines should
    98  * allocate dynamic storage of the appropriate size and return it.
    99  * bool_t       (*xdrproc_t)(XDR *, caddr_t *);
    100  */
    101 typedef bool_t (*xdrproc_t)();
    102 
    103 /*
    10493 * The XDR handle.
    10594 * Contains operation which is being applied to the stream,
    106  * an operations vector for the paticular implementation (e.g. see xdr_mem.c),
    107  * and two private fields for the use of the particular impelementation.
    108  */
    109 typedef struct {
     95 * an operations vector for the particular implementation (e.g. see xdr_mem.c),
     96 * and two private fields for the use of the particular implementation.
     97 */
     98typedef struct __rpc_xdr {
    11099        enum xdr_op     x_op;           /* operation; fast additional param */
    111100        struct xdr_ops {
    112                 bool_t  (*x_getlong)(); /* get a long from underlying stream */
    113                 bool_t  (*x_putlong)(); /* put a long to " */
    114                 bool_t  (*x_getbytes)();/* get some bytes from " */
    115                 bool_t  (*x_putbytes)();/* put some bytes to " */
    116                 u_int   (*x_getpostn)();/* returns bytes off from beginning */
    117                 bool_t  (*x_setpostn)();/* lets you reposition the stream */
    118                 long *  (*x_inline)();  /* buf quick ptr to buffered data */
    119                 void    (*x_destroy)(); /* free privates of this xdr_stream */
     101                /* get a long from underlying stream */
     102                bool_t  (*x_getlong) __P((struct __rpc_xdr *, long *));
     103                /* put a long to underlying stream */
     104                bool_t  (*x_putlong) __P((struct __rpc_xdr *, long *));
     105                /* get some bytes from underlying stream */
     106                bool_t  (*x_getbytes) __P((struct __rpc_xdr *, caddr_t, u_int));
     107                /* put some bytes to underlying stream */
     108                bool_t  (*x_putbytes) __P((struct __rpc_xdr *, caddr_t, u_int));
     109                /* returns bytes off from beginning */
     110                u_int   (*x_getpostn) __P((struct __rpc_xdr *));
     111                /* lets you reposition the stream */
     112                bool_t  (*x_setpostn) __P((struct __rpc_xdr *, u_int));
     113                /* buf quick ptr to buffered data */
     114                int32_t *(*x_inline) __P((struct __rpc_xdr *, u_int));
     115                /* free privates of this xdr_stream */
     116                void    (*x_destroy) __P((struct __rpc_xdr *));
    120117        } *x_ops;
    121118        caddr_t         x_public;       /* users' data */
     
    124121        int             x_handy;        /* extra private word */
    125122} XDR;
     123
     124/*
     125 * A xdrproc_t exists for each data type which is to be encoded or decoded.
     126 *
     127 * The second argument to the xdrproc_t is a pointer to an opaque pointer.
     128 * The opaque pointer generally points to a structure of the data type
     129 * to be decoded.  If this pointer is 0, then the type routines should
     130 * allocate dynamic storage of the appropriate size and return it.
     131 */
     132#ifdef _KERNEL
     133typedef bool_t (*xdrproc_t) __P((XDR *, void *, u_int));
     134#else
     135/*
     136 * XXX can't actually prototype it, because some take two args!!!
     137 */
     138typedef bool_t (*xdrproc_t) __P((/* XDR *, void *, u_int */));
     139#endif
    126140
    127141/*
     
    193207
    194208/*
    195  * In-line routines for fast encode/decode of primitve data types.
     209 * In-line routines for fast encode/decode of primitive data types.
    196210 * Caveat emptor: these use single memory cycles to get the
    197211 * data from the underlying buffer, and will fail to operate
     
    225239 * These are the "generic" xdr routines.
    226240 */
    227 extern bool_t   xdr_void();
    228 extern bool_t   xdr_int();
    229 extern bool_t   xdr_u_int();
    230 extern bool_t   xdr_long();
    231 extern bool_t   xdr_u_long();
    232 extern bool_t   xdr_short();
    233 extern bool_t   xdr_u_short();
    234 extern bool_t   xdr_bool();
    235 extern bool_t   xdr_enum();
    236 extern bool_t   xdr_array();
    237 extern bool_t   xdr_bytes();
    238 extern bool_t   xdr_opaque();
    239 extern bool_t   xdr_string();
    240 extern bool_t   xdr_union();
    241 extern bool_t   xdr_char();
    242 extern bool_t   xdr_u_char();
    243 extern bool_t   xdr_vector();
    244 extern bool_t   xdr_float();
    245 extern bool_t   xdr_double();
    246 extern bool_t   xdr_reference();
    247 extern bool_t   xdr_pointer();
    248 extern bool_t   xdr_wrapstring();
     241__BEGIN_DECLS
     242extern bool_t   xdr_void        __P((void));
     243extern bool_t   xdr_int         __P((XDR *, int *));
     244extern bool_t   xdr_u_int       __P((XDR *, u_int *));
     245extern bool_t   xdr_long        __P((XDR *, long *));
     246extern bool_t   xdr_u_long      __P((XDR *, u_long *));
     247extern bool_t   xdr_short       __P((XDR *, short *));
     248extern bool_t   xdr_u_short     __P((XDR *, u_short *));
     249extern bool_t   xdr_int16_t     __P((XDR *, int16_t *));
     250extern bool_t   xdr_u_int16_t   __P((XDR *, u_int16_t *));
     251extern bool_t   xdr_int32_t     __P((XDR *, int32_t *));
     252extern bool_t   xdr_u_int32_t   __P((XDR *, u_int32_t *));
     253extern bool_t   xdr_int64_t     __P((XDR *, int64_t *));
     254extern bool_t   xdr_u_int64_t   __P((XDR *, u_int64_t *));
     255extern bool_t   xdr_bool        __P((XDR *, bool_t *));
     256extern bool_t   xdr_enum        __P((XDR *, enum_t *));
     257extern bool_t   xdr_array       __P((XDR *, char **, u_int *, u_int, u_int, xdrproc_t));
     258extern bool_t   xdr_bytes       __P((XDR *, char **, u_int *, u_int));
     259extern bool_t   xdr_opaque      __P((XDR *, caddr_t, u_int));
     260extern bool_t   xdr_string      __P((XDR *, char **, u_int));
     261extern bool_t   xdr_union       __P((XDR *, enum_t *, char *, struct xdr_discrim *, xdrproc_t));
     262extern unsigned long    xdr_sizeof __P((xdrproc_t, void *));
     263extern bool_t   xdr_char        __P((XDR *, char *));
     264extern bool_t   xdr_u_char      __P((XDR *, u_char *));
     265extern bool_t   xdr_vector      __P((XDR *, char *, u_int, u_int, xdrproc_t));
     266extern bool_t   xdr_float       __P((XDR *, float *));
     267extern bool_t   xdr_double      __P((XDR *, double *));
     268extern bool_t   xdr_reference   __P((XDR *, caddr_t *, u_int, xdrproc_t));
     269extern bool_t   xdr_pointer     __P((XDR *, caddr_t *, u_int, xdrproc_t));
     270extern bool_t   xdr_wrapstring  __P((XDR *, char **));
     271extern void     xdr_free        __P((xdrproc_t, char *));
     272__END_DECLS
    249273
    250274/*
     
    252276 * declared here due to commonality.
    253277 */
    254 #define MAX_NETOBJ_SZ 1024 
     278#define MAX_NETOBJ_SZ 1024
    255279struct netobj {
    256280        u_int   n_len;
     
    258282};
    259283typedef struct netobj netobj;
    260 extern bool_t   xdr_netobj();
     284extern bool_t   xdr_netobj __P((XDR *, struct netobj *));
    261285
    262286/*
     
    264288 * xdr streams.
    265289 */
    266 extern void   xdrmem_create();          /* XDR using memory buffers */
    267 extern void   xdrstdio_create();        /* XDR using stdio library */
    268 extern void   xdrrec_create();          /* XDR pseudo records for tcp */
    269 extern bool_t xdrrec_endofrecord();     /* make end of xdr record */
    270 extern bool_t xdrrec_skiprecord();      /* move to beginning of next record */
    271 extern bool_t xdrrec_eof();             /* true if no more input */
    272 
    273 #endif /* !__XDR_HEADER__ */
    274 
    275 #endif /* RPC_XDR_H */
     290__BEGIN_DECLS
     291/* XDR using memory buffers */
     292extern void   xdrmem_create     __P((XDR *, char *, u_int, enum xdr_op));
     293
     294#ifdef _STDIO_H_
     295/* XDR using stdio library */
     296extern void   xdrstdio_create   __P((XDR *, FILE *, enum xdr_op));
     297#endif
     298
     299/* XDR pseudo records for tcp */
     300extern void   xdrrec_create     __P((XDR *, u_int, u_int, char *,
     301                                int (*) __P((caddr_t, caddr_t, int)),
     302                                int (*) __P((caddr_t, caddr_t, int))));
     303
     304/* make end of xdr record */
     305extern bool_t xdrrec_endofrecord __P((XDR *, int));
     306
     307/* move to beginning of next record */
     308extern bool_t xdrrec_skiprecord __P((XDR *));
     309
     310/* true if no more input */
     311extern bool_t xdrrec_eof        __P((XDR *));
     312__END_DECLS
     313
     314#endif /* !_RPC_XDR_H */
  • c/src/exec/librpc/include/rpcsvc/.cvsignore

    r0ab65474 rdf49c60  
     1Makefile
     2Makefile.in
  • c/src/exec/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
  • c/src/exec/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;
  • c/src/exec/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;
  • c/src/exec/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
  • c/src/exec/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;
  • c/src/exec/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;
  • c/src/exec/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
  • c/src/exec/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
  • c/src/exec/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;
  • c/src/exec/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;
  • c/src/exec/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 */
  • c/src/exec/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
  • c/src/exec/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 */
  • c/src/exec/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 *);
     118exte