ReactOS  0.4.13-dev-99-g7e18b6d
rpc.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2009, Sun Microsystems, Inc.
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  * - Redistributions of source code must retain the above copyright notice,
8  * this list of conditions and the following disclaimer.
9  * - Redistributions in binary form must reproduce the above copyright notice,
10  * this list of conditions and the following disclaimer in the documentation
11  * and/or other materials provided with the distribution.
12  * - Neither the name of Sun Microsystems, Inc. nor the names of its
13  * contributors may be used to endorse or promote products derived
14  * from this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19  * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20  * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21  * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22  * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24  * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26  * POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 /*
30  * rpc.h, Just includes the billions of rpc header files necessary to
31  * do remote procedure calling.
32  *
33  * Copyright (C) 1984, Sun Microsystems, Inc.
34  */
35 #ifndef _TIRPC_RPC_H
36 #define _TIRPC_RPC_H
37 
38 #include <rpc/types.h> /* some typedefs */
39 #include "winsock2.h"
40 //#include <sys/socket.h>
41 //#include <netinet/in.h>
42 
43 /* external data representation interfaces */
44 #include <rpc/xdr.h> /* generic (de)serializer */
45 
46 /* Client side only authentication */
47 #include <rpc/auth.h> /* generic authenticator (client side) */
48 
49 /* Client side (mostly) remote procedure call */
50 #include <rpc/clnt.h> /* generic rpc stuff */
51 
52 /* semi-private protocol headers */
53 #include <rpc/rpc_msg.h> /* protocol for rpc messages */
54 #include <rpc/auth_unix.h> /* protocol for unix style cred */
55 
56 /*
57  * Uncomment-out the next line if you are building the rpc library with
58  * DES Authentication (see the README file in the secure_rpc/ directory).
59  */
60 #include <rpc/auth_des.h> /* protocol for des style cred */
61 
62 #ifdef HAVE_RPCSEC_GSS
63 #include <rpc/auth_gss.h> /* RPCSEC_GSS */
64 #endif
65 
66 /* Server side only remote procedure callee */
67 #include <rpc/svc_auth.h> /* service side authenticator */
68 #include <rpc/svc.h> /* service manager and multiplexer */
69 
70 /* Portmapper client, server, and protocol headers */
71 #include <rpc/pmap_clnt.h>
72 #include <rpc/pmap_prot.h>
73 
74 #ifndef _KERNEL
75 #include <rpc/rpcb_clnt.h> /* rpcbind interface functions */
76 #endif
77 #include <rpc/rpcent.h>
78 
79 #ifndef UDPMSGSIZE
80 #define UDPMSGSIZE 8800
81 #endif
82 
84 extern int get_myaddress(struct sockaddr_in *);
85 extern int bindresvport(SOCKET, struct sockaddr_in *) __THROW;
86 extern int registerrpc(int, int, int, char *(*)(char [UDPMSGSIZE]),
88 extern int callrpc(const char *, int, int, int, xdrproc_t, void *,
89  xdrproc_t , void *);
90 extern int getrpcport(char *, int, int, int);
91 
92 char *taddr2uaddr(const struct netconfig *, const struct netbuf *);
93 struct netbuf *uaddr2taddr(const struct netconfig *, const char *);
94 
95 void freeuaddr(char *); /* free memory allocated by taddr2uaddr */
96 void freenetbuf(struct netbuf *); /* free memory allocated by uaddr2taddr */
97 
98 struct sockaddr;
99 extern int bindresvport_sa(SOCKET, struct sockaddr *);
101 
102 /*
103  * The following are not exported interfaces, they are for internal library
104  * and rpcbind use only. Do not use, they may change without notice.
105  */
107 SOCKET __rpc_nconf2fd(const struct netconfig *);
108 int __rpc_nconf2sockinfo(const struct netconfig *, struct __rpc_sockinfo *);
110 u_int __rpc_get_t_size(int, int, int);
112 
113 #endif /* !_RPC_RPC_H */
int __rpc_fd2sockinfo(SOCKET, struct __rpc_sockinfo *)
Definition: rpc_generic.c:481
u_int __rpc_get_t_size(int, int, int)
Definition: rpc_generic.c:139
int bindresvport_sa(SOCKET, struct sockaddr *)
Definition: bindresvport.c:161
__END_DECLS __BEGIN_DECLS SOCKET __rpc_nconf2fd(const struct netconfig *)
Definition: rpc_generic.c:562
bool_t(* xdrproc_t)(XDR *,...)
Definition: xdr.h:144
int callrpc(const char *, int, int, int, xdrproc_t, void *, xdrproc_t, void *)
#define __END_DECLS
Definition: wintirpc.h:63
char * taddr2uaddr(const struct netconfig *, const struct netbuf *)
Definition: rpc_generic.c:609
int getrpcport(char *, int, int, int)
Definition: getrpcport.c:47
int __rpc_nconf2sockinfo(const struct netconfig *, struct __rpc_sockinfo *)
Definition: rpc_generic.c:540
void freenetbuf(struct netbuf *)
Definition: rpc_generic.c:633
int registerrpc(int, int, int, char *(*)(char [UDPMSGSIZE]), xdrproc_t, xdrproc_t)
struct netbuf * uaddr2taddr(const struct netconfig *, const char *)
Definition: rpc_generic.c:619
#define __THROW
Definition: wintirpc.h:64
__BEGIN_DECLS int get_myaddress(struct sockaddr_in *)
int bindresvport(SOCKET, struct sockaddr_in *) __THROW
Definition: bindresvport.c:53
void freeuaddr(char *)
Definition: rpc_generic.c:628
UINT32 u_int
Definition: types.h:82
Definition: types.h:144
#define __BEGIN_DECLS
Definition: wintirpc.h:62
UINT_PTR SOCKET
Definition: winsock.h:47
#define UDPMSGSIZE
Definition: rpc.h:80