Edit File by line
/home/barbar84/public_h.../wp-conte.../plugins/sujqvwi/ShExBy/shex_roo.../usr/include/gssrpc
File: clnt.h
/* @(#)clnt.h 2.1 88/07/29 4.0 RPCSRC; from 1.31 88/02/08 SMI*/
[0] Fix | Delete
/*
[1] Fix | Delete
* Copyright (c) 2010, Oracle America, Inc.
[2] Fix | Delete
*
[3] Fix | Delete
* All rights reserved.
[4] Fix | Delete
*
[5] Fix | Delete
* Redistribution and use in source and binary forms, with or without
[6] Fix | Delete
* modification, are permitted provided that the following conditions are met:
[7] Fix | Delete
*
[8] Fix | Delete
* * Redistributions of source code must retain the above copyright
[9] Fix | Delete
* notice, this list of conditions and the following disclaimer.
[10] Fix | Delete
*
[11] Fix | Delete
* * Redistributions in binary form must reproduce the above copyright
[12] Fix | Delete
* notice, this list of conditions and the following disclaimer in
[13] Fix | Delete
* the documentation and/or other materials provided with the
[14] Fix | Delete
* distribution.
[15] Fix | Delete
*
[16] Fix | Delete
* * Neither the name of the "Oracle America, Inc." nor the names of
[17] Fix | Delete
* its contributors may be used to endorse or promote products
[18] Fix | Delete
* derived from this software without specific prior written permission.
[19] Fix | Delete
*
[20] Fix | Delete
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS
[21] Fix | Delete
* IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
[22] Fix | Delete
* TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
[23] Fix | Delete
* PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
[24] Fix | Delete
* HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
[25] Fix | Delete
* SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
[26] Fix | Delete
* TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
[27] Fix | Delete
* PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
[28] Fix | Delete
* LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
[29] Fix | Delete
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
[30] Fix | Delete
* SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
[31] Fix | Delete
*/
[32] Fix | Delete
[33] Fix | Delete
/*
[34] Fix | Delete
* clnt.h - Client side remote procedure call interface.
[35] Fix | Delete
*/
[36] Fix | Delete
[37] Fix | Delete
#ifndef GSSRPC_CLNT_H
[38] Fix | Delete
#define GSSRPC_CLNT_H
[39] Fix | Delete
[40] Fix | Delete
GSSRPC__BEGIN_DECLS
[41] Fix | Delete
/*
[42] Fix | Delete
* Rpc calls return an enum clnt_stat. This should be looked at more,
[43] Fix | Delete
* since each implementation is required to live with this (implementation
[44] Fix | Delete
* independent) list of errors.
[45] Fix | Delete
*/
[46] Fix | Delete
enum clnt_stat {
[47] Fix | Delete
RPC_SUCCESS=0, /* call succeeded */
[48] Fix | Delete
/*
[49] Fix | Delete
* local errors
[50] Fix | Delete
*/
[51] Fix | Delete
RPC_CANTENCODEARGS=1, /* can't encode arguments */
[52] Fix | Delete
RPC_CANTDECODERES=2, /* can't decode results */
[53] Fix | Delete
RPC_CANTSEND=3, /* failure in sending call */
[54] Fix | Delete
RPC_CANTRECV=4, /* failure in receiving result */
[55] Fix | Delete
RPC_TIMEDOUT=5, /* call timed out */
[56] Fix | Delete
/*
[57] Fix | Delete
* remote errors
[58] Fix | Delete
*/
[59] Fix | Delete
RPC_VERSMISMATCH=6, /* rpc versions not compatible */
[60] Fix | Delete
RPC_AUTHERROR=7, /* authentication error */
[61] Fix | Delete
RPC_PROGUNAVAIL=8, /* program not available */
[62] Fix | Delete
RPC_PROGVERSMISMATCH=9, /* program version mismatched */
[63] Fix | Delete
RPC_PROCUNAVAIL=10, /* procedure unavailable */
[64] Fix | Delete
RPC_CANTDECODEARGS=11, /* decode arguments error */
[65] Fix | Delete
RPC_SYSTEMERROR=12, /* generic "other problem" */
[66] Fix | Delete
[67] Fix | Delete
/*
[68] Fix | Delete
* callrpc & clnt_create errors
[69] Fix | Delete
*/
[70] Fix | Delete
RPC_UNKNOWNHOST=13, /* unknown host name */
[71] Fix | Delete
RPC_UNKNOWNPROTO=17, /* unknown protocol */
[72] Fix | Delete
[73] Fix | Delete
/*
[74] Fix | Delete
* _ create errors
[75] Fix | Delete
*/
[76] Fix | Delete
RPC_PMAPFAILURE=14, /* the pmapper failed in its call */
[77] Fix | Delete
RPC_PROGNOTREGISTERED=15, /* remote program is not registered */
[78] Fix | Delete
/*
[79] Fix | Delete
* unspecified error
[80] Fix | Delete
*/
[81] Fix | Delete
RPC_FAILED=16
[82] Fix | Delete
};
[83] Fix | Delete
[84] Fix | Delete
[85] Fix | Delete
/*
[86] Fix | Delete
* Error info.
[87] Fix | Delete
*/
[88] Fix | Delete
struct rpc_err {
[89] Fix | Delete
enum clnt_stat re_status;
[90] Fix | Delete
union {
[91] Fix | Delete
int RE_errno; /* realated system error */
[92] Fix | Delete
enum auth_stat RE_why; /* why the auth error occurred */
[93] Fix | Delete
struct {
[94] Fix | Delete
rpcvers_t low; /* lowest verion supported */
[95] Fix | Delete
rpcvers_t high; /* highest verion supported */
[96] Fix | Delete
} RE_vers;
[97] Fix | Delete
struct { /* maybe meaningful if RPC_FAILED */
[98] Fix | Delete
int32_t s1;
[99] Fix | Delete
int32_t s2;
[100] Fix | Delete
} RE_lb; /* life boot & debugging only */
[101] Fix | Delete
} ru;
[102] Fix | Delete
#define re_errno ru.RE_errno
[103] Fix | Delete
#define re_why ru.RE_why
[104] Fix | Delete
#define re_vers ru.RE_vers
[105] Fix | Delete
#define re_lb ru.RE_lb
[106] Fix | Delete
};
[107] Fix | Delete
[108] Fix | Delete
[109] Fix | Delete
/*
[110] Fix | Delete
* Client rpc handle.
[111] Fix | Delete
* Created by individual implementations, see e.g. rpc_udp.c.
[112] Fix | Delete
* Client is responsible for initializing auth, see e.g. auth_none.c.
[113] Fix | Delete
*/
[114] Fix | Delete
typedef struct CLIENT {
[115] Fix | Delete
AUTH *cl_auth; /* authenticator */
[116] Fix | Delete
struct clnt_ops {
[117] Fix | Delete
/* call remote procedure */
[118] Fix | Delete
enum clnt_stat (*cl_call)(struct CLIENT *,
[119] Fix | Delete
rpcproc_t, xdrproc_t, void *,
[120] Fix | Delete
xdrproc_t, void *,
[121] Fix | Delete
struct timeval);
[122] Fix | Delete
/* abort a call */
[123] Fix | Delete
void (*cl_abort)(struct CLIENT *);
[124] Fix | Delete
/* get specific error code */
[125] Fix | Delete
void (*cl_geterr)(struct CLIENT *,
[126] Fix | Delete
struct rpc_err *);
[127] Fix | Delete
/* frees results */
[128] Fix | Delete
bool_t (*cl_freeres)(struct CLIENT *,
[129] Fix | Delete
xdrproc_t, void *);
[130] Fix | Delete
/* destroy this structure */
[131] Fix | Delete
void (*cl_destroy)(struct CLIENT *);
[132] Fix | Delete
/* the ioctl() of rpc */
[133] Fix | Delete
/* XXX CITI makes 2nd arg take u_int */
[134] Fix | Delete
bool_t (*cl_control)(struct CLIENT *, int,
[135] Fix | Delete
void *);
[136] Fix | Delete
} *cl_ops;
[137] Fix | Delete
void *cl_private; /* private stuff */
[138] Fix | Delete
} CLIENT;
[139] Fix | Delete
[140] Fix | Delete
[141] Fix | Delete
/*
[142] Fix | Delete
* client side rpc interface ops
[143] Fix | Delete
*
[144] Fix | Delete
* Parameter types are:
[145] Fix | Delete
*
[146] Fix | Delete
*/
[147] Fix | Delete
[148] Fix | Delete
/*
[149] Fix | Delete
* enum clnt_stat
[150] Fix | Delete
* CLNT_CALL(rh, proc, xargs, argsp, xres, resp, timeout)
[151] Fix | Delete
* CLIENT *rh;
[152] Fix | Delete
* rpcproc_t proc;
[153] Fix | Delete
* xdrproc_t xargs;
[154] Fix | Delete
* caddr_t argsp;
[155] Fix | Delete
* xdrproc_t xres;
[156] Fix | Delete
* caddr_t resp;
[157] Fix | Delete
* struct timeval timeout;
[158] Fix | Delete
*/
[159] Fix | Delete
#define CLNT_CALL(rh, proc, xargs, argsp, xres, resp, secs) \
[160] Fix | Delete
((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs))
[161] Fix | Delete
#define clnt_call(rh, proc, xargs, argsp, xres, resp, secs) \
[162] Fix | Delete
((*(rh)->cl_ops->cl_call)(rh, proc, xargs, argsp, xres, resp, secs))
[163] Fix | Delete
[164] Fix | Delete
/*
[165] Fix | Delete
* void
[166] Fix | Delete
* CLNT_ABORT(rh);
[167] Fix | Delete
* CLIENT *rh;
[168] Fix | Delete
*/
[169] Fix | Delete
#define CLNT_ABORT(rh) ((*(rh)->cl_ops->cl_abort)(rh))
[170] Fix | Delete
#define clnt_abort(rh) ((*(rh)->cl_ops->cl_abort)(rh))
[171] Fix | Delete
[172] Fix | Delete
/*
[173] Fix | Delete
* struct rpc_err
[174] Fix | Delete
* CLNT_GETERR(rh);
[175] Fix | Delete
* CLIENT *rh;
[176] Fix | Delete
*/
[177] Fix | Delete
#define CLNT_GETERR(rh,errp) ((*(rh)->cl_ops->cl_geterr)(rh, errp))
[178] Fix | Delete
#define clnt_geterr(rh,errp) ((*(rh)->cl_ops->cl_geterr)(rh, errp))
[179] Fix | Delete
[180] Fix | Delete
[181] Fix | Delete
/*
[182] Fix | Delete
* bool_t
[183] Fix | Delete
* CLNT_FREERES(rh, xres, resp);
[184] Fix | Delete
* CLIENT *rh;
[185] Fix | Delete
* xdrproc_t xres;
[186] Fix | Delete
* caddr_t resp;
[187] Fix | Delete
*/
[188] Fix | Delete
#define CLNT_FREERES(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp))
[189] Fix | Delete
#define clnt_freeres(rh,xres,resp) ((*(rh)->cl_ops->cl_freeres)(rh,xres,resp))
[190] Fix | Delete
[191] Fix | Delete
/*
[192] Fix | Delete
* bool_t
[193] Fix | Delete
* CLNT_CONTROL(cl, request, info)
[194] Fix | Delete
* CLIENT *cl;
[195] Fix | Delete
* u_int request;
[196] Fix | Delete
* char *info;
[197] Fix | Delete
*/
[198] Fix | Delete
#define CLNT_CONTROL(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in))
[199] Fix | Delete
#define clnt_control(cl,rq,in) ((*(cl)->cl_ops->cl_control)(cl,rq,in))
[200] Fix | Delete
[201] Fix | Delete
/*
[202] Fix | Delete
* control operations that apply to both udp and tcp transports
[203] Fix | Delete
*/
[204] Fix | Delete
#define CLSET_TIMEOUT 1 /* set timeout (timeval) */
[205] Fix | Delete
#define CLGET_TIMEOUT 2 /* get timeout (timeval) */
[206] Fix | Delete
#define CLGET_SERVER_ADDR 3 /* get server's address (sockaddr) */
[207] Fix | Delete
/*
[208] Fix | Delete
* udp only control operations
[209] Fix | Delete
*/
[210] Fix | Delete
#define CLSET_RETRY_TIMEOUT 4 /* set retry timeout (timeval) */
[211] Fix | Delete
#define CLGET_RETRY_TIMEOUT 5 /* get retry timeout (timeval) */
[212] Fix | Delete
/*
[213] Fix | Delete
* new control operations
[214] Fix | Delete
*/
[215] Fix | Delete
#define CLGET_LOCAL_ADDR 6 /* get local address (sockaddr, getsockname)*/
[216] Fix | Delete
[217] Fix | Delete
/*
[218] Fix | Delete
* void
[219] Fix | Delete
* CLNT_DESTROY(rh);
[220] Fix | Delete
* CLIENT *rh;
[221] Fix | Delete
*/
[222] Fix | Delete
#define CLNT_DESTROY(rh) ((*(rh)->cl_ops->cl_destroy)(rh))
[223] Fix | Delete
#define clnt_destroy(rh) ((*(rh)->cl_ops->cl_destroy)(rh))
[224] Fix | Delete
[225] Fix | Delete
[226] Fix | Delete
/*
[227] Fix | Delete
* RPCTEST is a test program which is accessable on every rpc
[228] Fix | Delete
* transport/port. It is used for testing, performance evaluation,
[229] Fix | Delete
* and network administration.
[230] Fix | Delete
*/
[231] Fix | Delete
[232] Fix | Delete
#define RPCTEST_PROGRAM ((rpcprog_t)1)
[233] Fix | Delete
#define RPCTEST_VERSION ((rpcvers_t)1)
[234] Fix | Delete
#define RPCTEST_NULL_PROC ((rpcproc_t)2)
[235] Fix | Delete
#define RPCTEST_NULL_BATCH_PROC ((rpcproc_t)3)
[236] Fix | Delete
[237] Fix | Delete
/*
[238] Fix | Delete
* By convention, procedure 0 takes null arguments and returns them
[239] Fix | Delete
*/
[240] Fix | Delete
[241] Fix | Delete
#define NULLPROC ((rpcproc_t)0)
[242] Fix | Delete
[243] Fix | Delete
/*
[244] Fix | Delete
* Below are the client handle creation routines for the various
[245] Fix | Delete
* implementations of client side rpc. They can return NULL if a
[246] Fix | Delete
* creation failure occurs.
[247] Fix | Delete
*/
[248] Fix | Delete
[249] Fix | Delete
/*
[250] Fix | Delete
* Memory based rpc (for speed check and testing)
[251] Fix | Delete
* CLIENT *
[252] Fix | Delete
* clntraw_create(prog, vers)
[253] Fix | Delete
* rpcprog_t prog;
[254] Fix | Delete
* rpcvers_t vers;
[255] Fix | Delete
*/
[256] Fix | Delete
extern CLIENT *clntraw_create(rpcprog_t, rpcvers_t);
[257] Fix | Delete
[258] Fix | Delete
/*
[259] Fix | Delete
* Generic client creation routine. Supported protocols are "udp" and "tcp"
[260] Fix | Delete
*/
[261] Fix | Delete
extern CLIENT *clnt_create(char *, rpcprog_t, rpcvers_t, char *);
[262] Fix | Delete
[263] Fix | Delete
[264] Fix | Delete
/*
[265] Fix | Delete
* TCP based rpc
[266] Fix | Delete
* CLIENT *
[267] Fix | Delete
* clnttcp_create(raddr, prog, vers, sockp, sendsz, recvsz)
[268] Fix | Delete
* struct sockaddr_in *raddr;
[269] Fix | Delete
* rpcprog_t prog;
[270] Fix | Delete
* rpcvers_t version;
[271] Fix | Delete
* int *sockp;
[272] Fix | Delete
* u_int sendsz;
[273] Fix | Delete
* u_int recvsz;
[274] Fix | Delete
*/
[275] Fix | Delete
extern CLIENT *clnttcp_create(struct sockaddr_in *, rpcprog_t, rpcvers_t,
[276] Fix | Delete
int *, u_int, u_int);
[277] Fix | Delete
[278] Fix | Delete
/*
[279] Fix | Delete
* UDP based rpc.
[280] Fix | Delete
* CLIENT *
[281] Fix | Delete
* clntudp_create(raddr, program, version, wait, sockp)
[282] Fix | Delete
* struct sockaddr_in *raddr;
[283] Fix | Delete
* rpcprog_t program;
[284] Fix | Delete
* rpcvers_t version;
[285] Fix | Delete
* struct timeval wait;
[286] Fix | Delete
* int *sockp;
[287] Fix | Delete
*
[288] Fix | Delete
* Same as above, but you specify max packet sizes.
[289] Fix | Delete
* CLIENT *
[290] Fix | Delete
* clntudp_bufcreate(raddr, program, version, wait, sockp, sendsz, recvsz)
[291] Fix | Delete
* struct sockaddr_in *raddr;
[292] Fix | Delete
* rpcprog_t program;
[293] Fix | Delete
* rpcvers_t version;
[294] Fix | Delete
* struct timeval wait;
[295] Fix | Delete
* int *sockp;
[296] Fix | Delete
* u_int sendsz;
[297] Fix | Delete
* u_int recvsz;
[298] Fix | Delete
*/
[299] Fix | Delete
extern CLIENT *clntudp_create(struct sockaddr_in *, rpcprog_t,
[300] Fix | Delete
rpcvers_t, struct timeval, int *);
[301] Fix | Delete
extern CLIENT *clntudp_bufcreate(struct sockaddr_in *, rpcprog_t,
[302] Fix | Delete
rpcvers_t, struct timeval, int *,
[303] Fix | Delete
u_int, u_int);
[304] Fix | Delete
[305] Fix | Delete
/*
[306] Fix | Delete
* Print why creation failed
[307] Fix | Delete
*/
[308] Fix | Delete
void clnt_pcreateerror(char *); /* stderr */
[309] Fix | Delete
char *clnt_spcreateerror(char *); /* string */
[310] Fix | Delete
[311] Fix | Delete
/*
[312] Fix | Delete
* Like clnt_perror(), but is more verbose in its output
[313] Fix | Delete
*/
[314] Fix | Delete
void clnt_perrno(enum clnt_stat); /* stderr */
[315] Fix | Delete
[316] Fix | Delete
/*
[317] Fix | Delete
* Print an English error message, given the client error code
[318] Fix | Delete
*/
[319] Fix | Delete
void clnt_perror(CLIENT *, char *); /* stderr */
[320] Fix | Delete
char *clnt_sperror(CLIENT *, char *); /* string */
[321] Fix | Delete
[322] Fix | Delete
/*
[323] Fix | Delete
* If a creation fails, the following allows the user to figure out why.
[324] Fix | Delete
*/
[325] Fix | Delete
struct rpc_createerr {
[326] Fix | Delete
enum clnt_stat cf_stat;
[327] Fix | Delete
struct rpc_err cf_error; /* useful when cf_stat == RPC_PMAPFAILURE */
[328] Fix | Delete
};
[329] Fix | Delete
[330] Fix | Delete
extern struct rpc_createerr rpc_createerr;
[331] Fix | Delete
[332] Fix | Delete
[333] Fix | Delete
[334] Fix | Delete
/*
[335] Fix | Delete
* Copy error message to buffer.
[336] Fix | Delete
*/
[337] Fix | Delete
char *clnt_sperrno(enum clnt_stat num); /* string */
[338] Fix | Delete
[339] Fix | Delete
#define UDPMSGSIZE 8800 /* rpc imposed limit on udp msg size */
[340] Fix | Delete
#define RPCSMALLMSGSIZE 400 /* a more reasonable packet size */
[341] Fix | Delete
[342] Fix | Delete
GSSRPC__END_DECLS
[343] Fix | Delete
[344] Fix | Delete
#endif /* !defined(GSSRPC_CLNT_H) */
[345] Fix | Delete
[346] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function