summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2016-06-09 10:48:05 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2016-06-10 14:09:54 +0200
commit9880635f2e642380b69b85e00271649b3a2fc2de (patch)
treee2ac34d279c1bfd3df2694461d8e0e509da1ab24
parentRPC(3): Import from FreeBSD (diff)
downloadrtems-libbsd-9880635f2e642380b69b85e00271649b3a2fc2de.tar.bz2
RPC(3): Port to RTEMS
-rw-r--r--freebsd/include/rpc/clnt_stat.h3
-rw-r--r--freebsd/include/rpc/rpc_msg.h12
-rw-r--r--freebsd/include/rpc/svc.h3
-rw-r--r--freebsd/include/rpcsvc/nis_db.h6
-rw-r--r--freebsd/include/rpcsvc/yp_prot.h3
-rw-r--r--freebsd/lib/libc/include/namespace.h5
-rw-r--r--freebsd/lib/libc/rpc/rpcb_clnt.c2
-rwxr-xr-xlibbsd.py95
-rw-r--r--libbsd_waf.py55
9 files changed, 163 insertions, 21 deletions
diff --git a/freebsd/include/rpc/clnt_stat.h b/freebsd/include/rpc/clnt_stat.h
index 6148b4eb..a0cf01bb 100644
--- a/freebsd/include/rpc/clnt_stat.h
+++ b/freebsd/include/rpc/clnt_stat.h
@@ -73,7 +73,8 @@ enum clnt_stat {
RPC_STALERACHANDLE = 25,
RPC_CANTCONNECT = 26, /* couldn't make connection (cots) */
RPC_XPRTFAILED = 27, /* received discon from remote (cots) */
- RPC_CANTCREATESTREAM = 28 /* can't push rpc module (cots) */
+ RPC_CANTCREATESTREAM = 28, /* can't push rpc module (cots) */
+ _CLNT_STAT = 0xffffffff
};
#ifdef __cplusplus
diff --git a/freebsd/include/rpc/rpc_msg.h b/freebsd/include/rpc/rpc_msg.h
index 6e8d0745..fdde3875 100644
--- a/freebsd/include/rpc/rpc_msg.h
+++ b/freebsd/include/rpc/rpc_msg.h
@@ -53,12 +53,14 @@
enum msg_type {
CALL=0,
- REPLY=1
+ REPLY=1,
+ _MSG_TYPE = 0xffffffff
};
enum reply_stat {
MSG_ACCEPTED=0,
- MSG_DENIED=1
+ MSG_DENIED=1,
+ _REPLY_STAT = 0xffffffff
};
enum accept_stat {
@@ -67,12 +69,14 @@ enum accept_stat {
PROG_MISMATCH=2,
PROC_UNAVAIL=3,
GARBAGE_ARGS=4,
- SYSTEM_ERR=5
+ SYSTEM_ERR=5,
+ _ACCEPT_STAT = 0xffffffff
};
enum reject_stat {
RPC_MISMATCH=0,
- AUTH_ERROR=1
+ AUTH_ERROR=1,
+ _REJECT_STAT = 0xffffffff
};
/*
diff --git a/freebsd/include/rpc/svc.h b/freebsd/include/rpc/svc.h
index 2af5550f..51f278ae 100644
--- a/freebsd/include/rpc/svc.h
+++ b/freebsd/include/rpc/svc.h
@@ -81,7 +81,8 @@
enum xprt_stat {
XPRT_DIED,
XPRT_MOREREQS,
- XPRT_IDLE
+ XPRT_IDLE,
+ _XPRT_STAT = 0xffffffff
};
/*
diff --git a/freebsd/include/rpcsvc/nis_db.h b/freebsd/include/rpcsvc/nis_db.h
index 9dcc7837..ff5e64f2 100644
--- a/freebsd/include/rpcsvc/nis_db.h
+++ b/freebsd/include/rpcsvc/nis_db.h
@@ -69,7 +69,8 @@ enum db_status {
DB_BADOBJECT = 5,
DB_MEMORY_LIMIT = 6,
DB_STORAGE_LIMIT = 7,
- DB_INTERNAL_ERROR = 8
+ DB_INTERNAL_ERROR = 8,
+ _DB_STATUS = 0xffffffff
};
typedef enum db_status db_status;
@@ -80,7 +81,8 @@ enum db_action {
DB_FIRST = 3,
DB_NEXT = 4,
DB_ALL = 5,
- DB_RESET_NEXT = 6
+ DB_RESET_NEXT = 6,
+ _DB_ACTION = 0xffffffff
};
typedef enum db_action db_action;
diff --git a/freebsd/include/rpcsvc/yp_prot.h b/freebsd/include/rpcsvc/yp_prot.h
index 960cab63..6b2e28af 100644
--- a/freebsd/include/rpcsvc/yp_prot.h
+++ b/freebsd/include/rpcsvc/yp_prot.h
@@ -235,7 +235,8 @@ struct dom_binding {
/* error code in ypbind_resp.ypbind_status */
enum ypbind_resptype {
YPBIND_SUCC_VAL = 1,
- YPBIND_FAIL_VAL = 2
+ YPBIND_FAIL_VAL = 2,
+ _YPBIND_RESPTYPE = 0xffffffff
};
/* network order, of course */
diff --git a/freebsd/lib/libc/include/namespace.h b/freebsd/lib/libc/include/namespace.h
index 83be334e..8b2f04b1 100644
--- a/freebsd/lib/libc/include/namespace.h
+++ b/freebsd/lib/libc/include/namespace.h
@@ -67,5 +67,10 @@
#define _getpeername getpeername
#define _getprogname getprogname
#define _getsockname getsockname
+#ifdef __rtems__
+#define _pthread_mutex_lock pthread_mutex_lock
+#define _getsockopt getsockopt
+#define _bind bind
+#endif /* __rtems__ */
#endif /* _NAMESPACE_H_ */
diff --git a/freebsd/lib/libc/rpc/rpcb_clnt.c b/freebsd/lib/libc/rpc/rpcb_clnt.c
index 120b792c..ffee9659 100644
--- a/freebsd/lib/libc/rpc/rpcb_clnt.c
+++ b/freebsd/lib/libc/rpc/rpcb_clnt.c
@@ -1038,7 +1038,7 @@ done:
*
* Assuming that the address is all properly allocated
*/
-int
+bool_t
rpcb_getaddr(program, version, nconf, address, host)
rpcprog_t program;
rpcvers_t version;
diff --git a/libbsd.py b/libbsd.py
index 1a4e8089..5f21bf40 100755
--- a/libbsd.py
+++ b/libbsd.py
@@ -1772,6 +1772,8 @@ def user_space(mm):
'include/arpa/nameser.h',
'include/db.h',
'include/err.h',
+ 'include/gssapi/gssapi.h',
+ 'include/gssapi.h',
'include/ifaddrs.h',
'include/mpool.h',
'include/netconfig.h',
@@ -1780,27 +1782,36 @@ def user_space(mm):
'include/nsswitch.h',
'include/resolv.h',
'include/res_update.h',
- 'include/rpc/auth_des.h',
- 'include/rpc/auth.h',
- 'include/rpc/auth_unix.h',
'include/rpc/clnt.h',
- 'include/rpc/clnt_soc.h',
+ 'include/rpc/pmap_rmt.h',
+ 'include/rpc/svc_soc.h',
+ 'include/rpc/nettype.h',
+ 'include/rpc/xdr.h',
+ 'include/rpc/svc.h',
+ 'include/rpc/rpc_msg.h',
+ 'include/rpc/rpcsec_gss.h',
+ 'include/rpc/raw.h',
'include/rpc/clnt_stat.h',
- 'include/rpc/pmap_clnt.h',
- 'include/rpc/pmap_prot.h',
+ 'include/rpc/auth.h',
+ 'include/rpc/svc_dg.h',
+ 'include/rpc/auth_kerb.h',
+ 'include/rpc/auth_des.h',
'include/rpc/rpcb_clnt.h',
- 'include/rpc/rpcent.h',
'include/rpc/rpc.h',
- 'include/rpc/rpc_msg.h',
+ 'include/rpc/des.h',
+ 'include/rpc/des_crypt.h',
'include/rpc/svc_auth.h',
- 'include/rpc/svc.h',
+ 'include/rpc/pmap_clnt.h',
+ 'include/rpc/clnt_soc.h',
+ 'include/rpc/pmap_prot.h',
+ 'include/rpc/auth_unix.h',
+ 'include/rpc/rpc_com.h',
+ 'include/rpc/rpcent.h',
'include/rpcsvc/nis_db.h',
'include/rpcsvc/nislib.h',
'include/rpcsvc/nis_tags.h',
- 'include/rpc/svc_soc.h',
'include/rpcsvc/ypclnt.h',
'include/rpcsvc/yp_prot.h',
- 'include/rpc/xdr.h',
'include/sysexits.h',
'lib/libc/db/btree/btree.h',
'lib/libc/db/btree/extern.h',
@@ -1824,6 +1835,8 @@ def user_space(mm):
'lib/libc/net/res_config.h',
'lib/libc/resolv/res_debug.h',
'lib/libc/resolv/res_private.h',
+ 'lib/libc/rpc/mt_misc.h',
+ 'lib/libc/rpc/rpc_com.h',
'lib/libc/stdio/local.h',
'lib/libipsec/ipsec_strerror.h',
'lib/libipsec/libpfkey.h',
@@ -1846,6 +1859,11 @@ def user_space(mm):
mm.generator['convert'](),
mm.generator['convert'](),
mm.generator['rpc-gen']()))
+ mod.addFile(mm.generator['file']('include/rpcsvc/nis.x',
+ mm.generator['freebsd-path'](),
+ mm.generator['convert'](),
+ mm.generator['convert'](),
+ mm.generator['rpc-gen']()))
mod.addFile(mm.generator['file']('sbin/route/keywords',
mm.generator['freebsd-path'](),
mm.generator['convert'](),
@@ -1955,6 +1973,61 @@ def user_space(mm):
'lib/libc/resolv/res_send.c',
'lib/libc/resolv/res_state.c',
'lib/libc/resolv/res_update.c',
+ 'lib/libc/rpc/auth_des.c',
+ 'lib/libc/rpc/authdes_prot.c',
+ 'lib/libc/rpc/auth_none.c',
+ 'lib/libc/rpc/auth_time.c',
+ 'lib/libc/rpc/auth_unix.c',
+ 'lib/libc/rpc/authunix_prot.c',
+ 'lib/libc/rpc/bindresvport.c',
+ 'lib/libc/rpc/clnt_bcast.c',
+ 'lib/libc/rpc/clnt_dg.c',
+ 'lib/libc/rpc/clnt_generic.c',
+ 'lib/libc/rpc/clnt_perror.c',
+ 'lib/libc/rpc/clnt_raw.c',
+ 'lib/libc/rpc/clnt_simple.c',
+ 'lib/libc/rpc/clnt_vc.c',
+ 'lib/libc/rpc/crypt_client.c',
+ 'lib/libc/rpc/des_crypt.c',
+ 'lib/libc/rpc/des_soft.c',
+ 'lib/libc/rpc/getnetconfig.c',
+ 'lib/libc/rpc/getnetpath.c',
+ 'lib/libc/rpc/getpublickey.c',
+ 'lib/libc/rpc/getrpcent.c',
+ 'lib/libc/rpc/getrpcport.c',
+ 'lib/libc/rpc/key_call.c',
+ 'lib/libc/rpc/key_prot_xdr.c',
+ 'lib/libc/rpc/mt_misc.c',
+ 'lib/libc/rpc/netname.c',
+ 'lib/libc/rpc/netnamer.c',
+ 'lib/libc/rpc/pmap_clnt.c',
+ 'lib/libc/rpc/pmap_getmaps.c',
+ 'lib/libc/rpc/pmap_getport.c',
+ 'lib/libc/rpc/pmap_prot2.c',
+ 'lib/libc/rpc/pmap_prot.c',
+ 'lib/libc/rpc/pmap_rmt.c',
+ 'lib/libc/rpc/rpcb_clnt.c',
+ 'lib/libc/rpc/rpcb_prot.c',
+ 'lib/libc/rpc/rpcb_st_xdr.c',
+ 'lib/libc/rpc/rpc_callmsg.c',
+ 'lib/libc/rpc/rpc_commondata.c',
+ 'lib/libc/rpc/rpcdname.c',
+ 'lib/libc/rpc/rpc_dtablesize.c',
+ 'lib/libc/rpc/rpc_generic.c',
+ 'lib/libc/rpc/rpc_prot.c',
+ 'lib/libc/rpc/rpcsec_gss_stub.c',
+ 'lib/libc/rpc/rpc_soc.c',
+ 'lib/libc/rpc/rtime.c',
+ 'lib/libc/rpc/svc_auth.c',
+ 'lib/libc/rpc/svc_auth_des.c',
+ 'lib/libc/rpc/svc_auth_unix.c',
+ 'lib/libc/rpc/svc.c',
+ 'lib/libc/rpc/svc_dg.c',
+ 'lib/libc/rpc/svc_generic.c',
+ 'lib/libc/rpc/svc_raw.c',
+ 'lib/libc/rpc/svc_run.c',
+ 'lib/libc/rpc/svc_simple.c',
+ 'lib/libc/rpc/svc_vc.c',
'lib/libc/stdio/fgetln.c',
'lib/libc/stdlib/strtoimax.c',
'lib/libc/stdlib/strtonum.c',
diff --git a/libbsd_waf.py b/libbsd_waf.py
index 16ff863a..64a68108 100644
--- a/libbsd_waf.py
+++ b/libbsd_waf.py
@@ -282,6 +282,61 @@ def build(bld):
'freebsd/lib/libc/resolv/res_send.c',
'freebsd/lib/libc/resolv/res_state.c',
'freebsd/lib/libc/resolv/res_update.c',
+ 'freebsd/lib/libc/rpc/auth_des.c',
+ 'freebsd/lib/libc/rpc/auth_none.c',
+ 'freebsd/lib/libc/rpc/auth_time.c',
+ 'freebsd/lib/libc/rpc/auth_unix.c',
+ 'freebsd/lib/libc/rpc/authdes_prot.c',
+ 'freebsd/lib/libc/rpc/authunix_prot.c',
+ 'freebsd/lib/libc/rpc/bindresvport.c',
+ 'freebsd/lib/libc/rpc/clnt_bcast.c',
+ 'freebsd/lib/libc/rpc/clnt_dg.c',
+ 'freebsd/lib/libc/rpc/clnt_generic.c',
+ 'freebsd/lib/libc/rpc/clnt_perror.c',
+ 'freebsd/lib/libc/rpc/clnt_raw.c',
+ 'freebsd/lib/libc/rpc/clnt_simple.c',
+ 'freebsd/lib/libc/rpc/clnt_vc.c',
+ 'freebsd/lib/libc/rpc/crypt_client.c',
+ 'freebsd/lib/libc/rpc/des_crypt.c',
+ 'freebsd/lib/libc/rpc/des_soft.c',
+ 'freebsd/lib/libc/rpc/getnetconfig.c',
+ 'freebsd/lib/libc/rpc/getnetpath.c',
+ 'freebsd/lib/libc/rpc/getpublickey.c',
+ 'freebsd/lib/libc/rpc/getrpcent.c',
+ 'freebsd/lib/libc/rpc/getrpcport.c',
+ 'freebsd/lib/libc/rpc/key_call.c',
+ 'freebsd/lib/libc/rpc/key_prot_xdr.c',
+ 'freebsd/lib/libc/rpc/mt_misc.c',
+ 'freebsd/lib/libc/rpc/netname.c',
+ 'freebsd/lib/libc/rpc/netnamer.c',
+ 'freebsd/lib/libc/rpc/pmap_clnt.c',
+ 'freebsd/lib/libc/rpc/pmap_getmaps.c',
+ 'freebsd/lib/libc/rpc/pmap_getport.c',
+ 'freebsd/lib/libc/rpc/pmap_prot.c',
+ 'freebsd/lib/libc/rpc/pmap_prot2.c',
+ 'freebsd/lib/libc/rpc/pmap_rmt.c',
+ 'freebsd/lib/libc/rpc/rpc_callmsg.c',
+ 'freebsd/lib/libc/rpc/rpc_commondata.c',
+ 'freebsd/lib/libc/rpc/rpc_dtablesize.c',
+ 'freebsd/lib/libc/rpc/rpc_generic.c',
+ 'freebsd/lib/libc/rpc/rpc_prot.c',
+ 'freebsd/lib/libc/rpc/rpc_soc.c',
+ 'freebsd/lib/libc/rpc/rpcb_clnt.c',
+ 'freebsd/lib/libc/rpc/rpcb_prot.c',
+ 'freebsd/lib/libc/rpc/rpcb_st_xdr.c',
+ 'freebsd/lib/libc/rpc/rpcdname.c',
+ 'freebsd/lib/libc/rpc/rpcsec_gss_stub.c',
+ 'freebsd/lib/libc/rpc/rtime.c',
+ 'freebsd/lib/libc/rpc/svc.c',
+ 'freebsd/lib/libc/rpc/svc_auth.c',
+ 'freebsd/lib/libc/rpc/svc_auth_des.c',
+ 'freebsd/lib/libc/rpc/svc_auth_unix.c',
+ 'freebsd/lib/libc/rpc/svc_dg.c',
+ 'freebsd/lib/libc/rpc/svc_generic.c',
+ 'freebsd/lib/libc/rpc/svc_raw.c',
+ 'freebsd/lib/libc/rpc/svc_run.c',
+ 'freebsd/lib/libc/rpc/svc_simple.c',
+ 'freebsd/lib/libc/rpc/svc_vc.c',
'freebsd/lib/libc/stdio/fgetln.c',
'freebsd/lib/libc/stdlib/strtoimax.c',
'freebsd/lib/libc/stdlib/strtonum.c',