summaryrefslogtreecommitdiffstats
path: root/include/rpc
diff options
context:
space:
mode:
authorpfg <pfg@FreeBSD.org>2012-09-02 21:04:40 +0000
committerpfg <pfg@FreeBSD.org>2012-09-02 21:04:40 +0000
commit97adc861835d3d63fcfabaf559955e91c3bdd543 (patch)
tree15afb466c1616ef4f4e63a7ec1b8cc2128b9438c /include/rpc
parent70630d664ef4716dd247b13bdb90a3e2c77aef78 (diff)
downloadFreeBSD-src-97adc861835d3d63fcfabaf559955e91c3bdd543.zip
FreeBSD-src-97adc861835d3d63fcfabaf559955e91c3bdd543.tar.gz
Fix RPC headers for C++
C++ mangling will cause trouble with variables like __rpc_xdr in xdr.h so rename this to XDR. While here add proper C++ guards to RPC headers. PR: 137443 MFC after: 2 weeks
Diffstat (limited to 'include/rpc')
-rw-r--r--include/rpc/auth.h8
-rw-r--r--include/rpc/auth_unix.h8
-rw-r--r--include/rpc/clnt.h8
-rw-r--r--include/rpc/clnt_soc.h8
-rw-r--r--include/rpc/des_crypt.h8
-rw-r--r--include/rpc/nettype.h8
-rw-r--r--include/rpc/pmap_clnt.h8
-rw-r--r--include/rpc/pmap_rmt.h8
-rw-r--r--include/rpc/rpc_com.h10
-rw-r--r--include/rpc/rpc_msg.h8
-rw-r--r--include/rpc/rpcb_clnt.h8
-rw-r--r--include/rpc/rpcent.h7
-rw-r--r--include/rpc/rpcsec_gss.h8
-rw-r--r--include/rpc/svc.h7
-rw-r--r--include/rpc/svc_soc.h8
-rw-r--r--include/rpc/xdr.h28
16 files changed, 137 insertions, 11 deletions
diff --git a/include/rpc/auth.h b/include/rpc/auth.h
index 5833c02..1f97717 100644
--- a/include/rpc/auth.h
+++ b/include/rpc/auth.h
@@ -51,6 +51,10 @@
#include <sys/cdefs.h>
#include <sys/socket.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define MAX_AUTH_BYTES 400
#define MAXNETNAMELEN 255 /* maximum length of network user's name */
@@ -366,4 +370,8 @@ __END_DECLS
#define RPCSEC_GSS_KRB5I 390004
#define RPCSEC_GSS_KRB5P 390005
+#ifdef __cplusplus
+}
+#endif
+
#endif /* !_RPC_AUTH_H */
diff --git a/include/rpc/auth_unix.h b/include/rpc/auth_unix.h
index 08e1569..5a26c64 100644
--- a/include/rpc/auth_unix.h
+++ b/include/rpc/auth_unix.h
@@ -48,6 +48,10 @@
#define _RPC_AUTH_UNIX_H
#include <sys/cdefs.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* The machine name is part of a credential; it may not exceed 255 bytes */
#define MAX_MACHINE_NAME 255
@@ -81,4 +85,8 @@ struct short_hand_verf {
struct opaque_auth new_cred;
};
+#ifdef __cplusplus
+}
+#endif
+
#endif /* !_RPC_AUTH_UNIX_H */
diff --git a/include/rpc/clnt.h b/include/rpc/clnt.h
index 1c85a4a..46790c4 100644
--- a/include/rpc/clnt.h
+++ b/include/rpc/clnt.h
@@ -64,6 +64,10 @@
#include <netconfig.h>
#include <sys/un.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Well-known IPV6 RPC broadcast address.
*/
@@ -551,6 +555,10 @@ extern enum clnt_stat rpc_broadcast_exp(const rpcprog_t, const rpcvers_t,
const int, const char *);
__END_DECLS
+#ifdef __cplusplus
+}
+#endif
+
/* For backward compatibility */
#include <rpc/clnt_soc.h>
diff --git a/include/rpc/clnt_soc.h b/include/rpc/clnt_soc.h
index 1e7a0de..484dc7c 100644
--- a/include/rpc/clnt_soc.h
+++ b/include/rpc/clnt_soc.h
@@ -49,6 +49,10 @@
#include <sys/cdefs.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define UDPMSGSIZE 8800 /* rpc imposed limit on udp msg size */
/*
@@ -103,4 +107,8 @@ extern CLIENT *clntudp_bufcreate(struct sockaddr_in *, u_long, u_long,
struct timeval, int *, u_int, u_int);
__END_DECLS
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _RPC_CLNT_SOC_H */
diff --git a/include/rpc/des_crypt.h b/include/rpc/des_crypt.h
index a5df606..f38f4f4 100644
--- a/include/rpc/des_crypt.h
+++ b/include/rpc/des_crypt.h
@@ -47,6 +47,10 @@
#include <sys/cdefs.h>
#include <rpc/rpc.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define DES_MAXDATA 8192 /* max bytes encrypted in one call */
#define DES_DIRMASK (1 << 0)
#define DES_ENCRYPT (0*DES_DIRMASK) /* Encrypt */
@@ -103,4 +107,8 @@ __BEGIN_DECLS
void des_setparity( char *);
__END_DECLS
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _DES_DES_CRYPT_H */
diff --git a/include/rpc/nettype.h b/include/rpc/nettype.h
index 5e26268..e046b74 100644
--- a/include/rpc/nettype.h
+++ b/include/rpc/nettype.h
@@ -44,6 +44,10 @@
#include <netconfig.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define _RPC_NONE 0
#define _RPC_NETPATH 1
#define _RPC_VISIBLE 2
@@ -61,4 +65,8 @@ extern struct netconfig *__rpc_getconf(void *);
extern struct netconfig *__rpc_getconfip(const char *);
__END_DECLS
+#ifdef __cplusplus
+}
+#endif
+
#endif /* !_RPC_NETTYPE_H */
diff --git a/include/rpc/pmap_clnt.h b/include/rpc/pmap_clnt.h
index 89f1614..e2e5f79 100644
--- a/include/rpc/pmap_clnt.h
+++ b/include/rpc/pmap_clnt.h
@@ -66,6 +66,10 @@
#define _RPC_PMAP_CLNT_H_
#include <sys/cdefs.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
__BEGIN_DECLS
extern bool_t pmap_set(u_long, u_long, int, int);
extern bool_t pmap_unset(u_long, u_long);
@@ -83,4 +87,8 @@ extern u_short pmap_getport(struct sockaddr_in *,
u_long, u_long, u_int);
__END_DECLS
+#ifdef __cplusplus
+}
+#endif
+
#endif /* !_RPC_PMAP_CLNT_H_ */
diff --git a/include/rpc/pmap_rmt.h b/include/rpc/pmap_rmt.h
index 5c08066..9d5c00c 100644
--- a/include/rpc/pmap_rmt.h
+++ b/include/rpc/pmap_rmt.h
@@ -44,6 +44,10 @@
#define _RPC_PMAP_RMT_H
#include <sys/cdefs.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
struct rmtcallargs {
u_long prog, vers, proc, arglen;
caddr_t args_ptr;
@@ -62,4 +66,8 @@ extern bool_t xdr_rmtcall_args(XDR *, struct rmtcallargs *);
extern bool_t xdr_rmtcallres(XDR *, struct rmtcallres *);
__END_DECLS
+#ifdef __cplusplus
+}
+#endif
+
#endif /* !_RPC_PMAP_RMT_H */
diff --git a/include/rpc/rpc_com.h b/include/rpc/rpc_com.h
index 122fe7e..2060c3a 100644
--- a/include/rpc/rpc_com.h
+++ b/include/rpc/rpc_com.h
@@ -42,9 +42,13 @@
#ifndef _RPC_RPCCOM_H
#define _RPC_RPCCOM_H
+/* #pragma ident "@(#)rpc_com.h 1.11 93/07/05 SMI" */
+
#include <sys/cdefs.h>
-/* #pragma ident "@(#)rpc_com.h 1.11 93/07/05 SMI" */
+#ifdef __cplusplus
+extern "C" {
+#endif
/*
* The max size of the transport, if the size cannot be determined
@@ -80,4 +84,8 @@ char *_get_next_token(char *, int);
__END_DECLS
+#ifdef __cplusplus
+}
+#endif
+
#endif /* _RPC_RPCCOM_H */
diff --git a/include/rpc/rpc_msg.h b/include/rpc/rpc_msg.h
index 354b341..453d549 100644
--- a/include/rpc/rpc_msg.h
+++ b/include/rpc/rpc_msg.h
@@ -43,6 +43,10 @@
#ifndef _RPC_RPC_MSG_H
#define _RPC_RPC_MSG_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#define RPC_MSG_VERSION ((u_int32_t) 2)
#define RPC_SERVICE_PORT ((u_short) 2048)
@@ -211,4 +215,8 @@ extern bool_t xdr_rejected_reply(XDR *, struct rejected_reply *);
extern void _seterr_reply(struct rpc_msg *, struct rpc_err *);
__END_DECLS
+#ifdef __cplusplus
+}
+#endif
+
#endif /* !_RPC_RPC_MSG_H */
diff --git a/include/rpc/rpcb_clnt.h b/include/rpc/rpcb_clnt.h
index fa64a85..0cfa21f 100644
--- a/include/rpc/rpcb_clnt.h
+++ b/include/rpc/rpcb_clnt.h
@@ -61,6 +61,10 @@
#include <rpc/types.h>
#include <rpc/rpcb_prot.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
__BEGIN_DECLS
extern bool_t rpcb_set(const rpcprog_t, const rpcvers_t,
const struct netconfig *, const struct netbuf *);
@@ -82,4 +86,8 @@ extern char *rpcb_taddr2uaddr(struct netconfig *, struct netbuf *);
extern struct netbuf *rpcb_uaddr2taddr(struct netconfig *, char *);
__END_DECLS
+#ifdef __cplusplus
+}
+#endif
+
#endif /* !_RPC_RPCB_CLNT_H */
diff --git a/include/rpc/rpcent.h b/include/rpc/rpcent.h
index 876b488..0aea015 100644
--- a/include/rpc/rpcent.h
+++ b/include/rpc/rpcent.h
@@ -45,6 +45,9 @@
/* #pragma ident "@(#)rpcent.h 1.13 94/04/25 SMI" */
/* @(#)rpcent.h 1.1 88/12/06 SMI */
+#ifdef __cplusplus
+extern "C" {
+#endif
struct rpcent {
char *r_name; /* name of server for this rpc program */
@@ -64,4 +67,8 @@ extern void setrpcent(int);
extern void endrpcent(void);
__END_DECLS
+#ifdef __cplusplus
+}
+#endif
+
#endif /* !_RPC_CENT_H */
diff --git a/include/rpc/rpcsec_gss.h b/include/rpc/rpcsec_gss.h
index ccd346f..42b155f 100644
--- a/include/rpc/rpcsec_gss.h
+++ b/include/rpc/rpcsec_gss.h
@@ -29,6 +29,10 @@
#ifndef _RPCSEC_GSS_H
#define _RPCSEC_GSS_H
+#ifdef __cplusplus
+extern "C" {
+#endif
+
#include <gssapi/gssapi.h>
#ifndef MAX_GSS_MECH
@@ -176,4 +180,8 @@ bool_t __rpc_gss_set_error(int rpc_gss_error, int system_error);
__END_DECLS
+#ifdef __cplusplus
+}
+#endif
+
#endif /* !_RPCSEC_GSS_H */
diff --git a/include/rpc/svc.h b/include/rpc/svc.h
index 4a3833c..7625f6d 100644
--- a/include/rpc/svc.h
+++ b/include/rpc/svc.h
@@ -65,6 +65,10 @@
* parameters, struct svc_req * and SVCXPRT *, defined below.
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Service control requests
*/
@@ -467,6 +471,9 @@ int __rpc_get_local_uid(SVCXPRT *_transp, uid_t *_uid);
__END_DECLS
+#ifdef __cplusplus
+}
+#endif
/* for backward compatibility */
#include <rpc/svc_soc.h>
diff --git a/include/rpc/svc_soc.h b/include/rpc/svc_soc.h
index 6c528db..09704df4 100644
--- a/include/rpc/svc_soc.h
+++ b/include/rpc/svc_soc.h
@@ -49,6 +49,10 @@
* with TS-RPC
*/
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* Approved way of getting address of caller
*/
@@ -113,4 +117,8 @@ __BEGIN_DECLS
extern SVCXPRT *svcfd_create(int, u_int, u_int);
__END_DECLS
+#ifdef __cplusplus
+}
+#endif
+
#endif /* !_RPC_SVC_SOC_H */
diff --git a/include/rpc/xdr.h b/include/rpc/xdr.h
index 92116c0..1ef569a 100644
--- a/include/rpc/xdr.h
+++ b/include/rpc/xdr.h
@@ -43,6 +43,10 @@
#define _RPC_XDR_H
#include <sys/cdefs.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/*
* XDR provides a conventional way for converting between C data
* types and an external bit-string representation. Library supplied
@@ -97,26 +101,26 @@ enum xdr_op {
* an operations vector for the particular implementation (e.g. see xdr_mem.c),
* and two private fields for the use of the particular implementation.
*/
-typedef struct __rpc_xdr {
+typedef struct XDR {
enum xdr_op x_op; /* operation; fast additional param */
const struct xdr_ops {
/* get a long from underlying stream */
- bool_t (*x_getlong)(struct __rpc_xdr *, long *);
+ bool_t (*x_getlong)(struct XDR *, long *);
/* put a long to " */
- bool_t (*x_putlong)(struct __rpc_xdr *, const long *);
+ bool_t (*x_putlong)(struct XDR *, const long *);
/* get some bytes from " */
- bool_t (*x_getbytes)(struct __rpc_xdr *, char *, u_int);
+ bool_t (*x_getbytes)(struct XDR *, char *, u_int);
/* put some bytes to " */
- bool_t (*x_putbytes)(struct __rpc_xdr *, const char *, u_int);
+ bool_t (*x_putbytes)(struct XDR *, const char *, u_int);
/* returns bytes off from beginning */
- u_int (*x_getpostn)(struct __rpc_xdr *);
+ u_int (*x_getpostn)(struct XDR *);
/* lets you reposition the stream */
- bool_t (*x_setpostn)(struct __rpc_xdr *, u_int);
+ bool_t (*x_setpostn)(struct XDR *, u_int);
/* buf quick ptr to buffered data */
- int32_t *(*x_inline)(struct __rpc_xdr *, u_int);
+ int32_t *(*x_inline)(struct XDR *, u_int);
/* free privates of this xdr_stream */
- void (*x_destroy)(struct __rpc_xdr *);
- bool_t (*x_control)(struct __rpc_xdr *, int, void *);
+ void (*x_destroy)(struct XDR *);
+ bool_t (*x_control)(struct XDR *, int, void *);
} *x_ops;
char * x_public; /* users' data */
void * x_private; /* pointer to private data */
@@ -366,4 +370,8 @@ extern bool_t xdrrec_eof(XDR *);
extern u_int xdrrec_readbytes(XDR *, caddr_t, u_int);
__END_DECLS
+#ifdef __cplusplus
+}
+#endif
+
#endif /* !_RPC_XDR_H */
OpenPOWER on IntegriCloud