summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2012-06-06 14:06:48 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2012-06-06 14:06:48 +0200
commit87194f93b1b79346da5b074ee66be40ef962139a (patch)
tree09277304c432025ec48edd0b95923a9e3a5b7130
parentMerge branch 'upstream' (diff)
parentlibrpc: PR2066: Fix for short enums (diff)
downloadrtems-87194f93b1b79346da5b074ee66be40ef962139a.tar.bz2
Merge branch 'upstream'
-rw-r--r--cpukit/libnetworking/Makefile.am1
-rw-r--r--cpukit/libnetworking/nfs/bootp_subr.c18
-rw-r--r--cpukit/libnetworking/rtems/bootp.h41
-rw-r--r--cpukit/libnetworking/rtems/rtems_bootp.c2
-rw-r--r--cpukit/libnetworking/rtems/rtems_bsdnet_internal.h1
-rw-r--r--cpukit/libnetworking/rtems/rtems_dhcp.c26
-rw-r--r--cpukit/librpc/include/rpc/auth.h3
-rw-r--r--cpukit/librpc/include/rpc/clnt_stat.h3
-rw-r--r--cpukit/librpc/include/rpc/rpc_msg.h12
-rw-r--r--cpukit/librpc/include/rpc/svc.h3
-rw-r--r--cpukit/librpc/include/rpcsvc/nis_db.h6
-rw-r--r--cpukit/librpc/include/rpcsvc/yp_prot.h3
-rw-r--r--cpukit/librpc/src/xdr/xdr.c8
13 files changed, 74 insertions, 53 deletions
diff --git a/cpukit/libnetworking/Makefile.am b/cpukit/libnetworking/Makefile.am
index 1a990988c4..927245b3ad 100644
--- a/cpukit/libnetworking/Makefile.am
+++ b/cpukit/libnetworking/Makefile.am
@@ -4,6 +4,7 @@ include $(top_srcdir)/automake/compile.am
AM_CPPFLAGS += -I$(srcdir)
EXTRA_DIST = README
+EXTRA_DIST += rtems/bootp.h
# poll is not supported
UNUSED_FILES = poll.h
diff --git a/cpukit/libnetworking/nfs/bootp_subr.c b/cpukit/libnetworking/nfs/bootp_subr.c
index 75f6162aac..0645b89431 100644
--- a/cpukit/libnetworking/nfs/bootp_subr.c
+++ b/cpukit/libnetworking/nfs/bootp_subr.c
@@ -72,6 +72,8 @@
#include <rtems/bsdnet/servers.h>
#include <inttypes.h>
+#include "rtems/bootp.h"
+
#define BOOTP_MIN_LEN 300 /* Minimum size of bootp udp packet */
/*
@@ -136,20 +138,6 @@ void bootpboot_p_rtlist(void);
void bootpboot_p_iflist(void);
#endif
-int bootpc_call(struct bootp_packet *call,
- struct bootp_packet *reply,
- struct proc *procp);
-
-int bootpc_fakeup_interface(struct ifreq *ireq,struct socket *so,
- struct proc *procp);
-
-int
-bootpc_adjust_interface(struct ifreq *ireq,struct socket *so,
- struct sockaddr_in *myaddr,
- struct sockaddr_in *netmask,
- struct sockaddr_in *gw,
- struct proc *procp);
-
#ifdef BOOTP_DEBUG
void
bootpboot_p_sa(struct sockaddr *sa, struct sockaddr *ma)
@@ -269,7 +257,7 @@ bootpboot_p_iflist(void)
* - allocate or reallocate dst, so that string fits in
* - copy string from src to dest
*/
-static void *bootp_strdup_realloc(char *dst,const char *src)
+void *bootp_strdup_realloc(char *dst,const char *src)
{
size_t len;
diff --git a/cpukit/libnetworking/rtems/bootp.h b/cpukit/libnetworking/rtems/bootp.h
new file mode 100644
index 0000000000..d8eeb76f8f
--- /dev/null
+++ b/cpukit/libnetworking/rtems/bootp.h
@@ -0,0 +1,41 @@
+/* Subroutines from cpukit/libnetworking/nfs/bootp_subr.c */
+
+#if !defined (__RTEMS_BOOTP_H__)
+#define __RTEMS_BOOTP_H__
+
+#include <stdbool.h>
+
+#if __cplusplus
+extern "C"
+{
+#endif
+
+struct bootp_packet;
+struct proc;
+struct ifreq;
+struct socket;
+struct sockaddr_in;
+
+bool bootpc_init(bool, bool);
+
+int bootpc_call(
+ struct bootp_packet *call,
+ struct bootp_packet *reply,
+ struct proc *procp);
+int bootpc_fakeup_interface(struct ifreq *ireq,
+ struct socket *so,
+ struct proc *procp);
+int bootpc_adjust_interface(struct ifreq *ireq,
+ struct socket *so,
+ struct sockaddr_in *myaddr,
+ struct sockaddr_in *netmask,
+ struct sockaddr_in *gw,
+ struct proc *procp);
+
+void *bootp_strdup_realloc(char *dst, const char *src);
+
+#if __cplusplus
+}
+#endif
+
+#endif
diff --git a/cpukit/libnetworking/rtems/rtems_bootp.c b/cpukit/libnetworking/rtems/rtems_bootp.c
index 852d900a04..2743dc0a05 100644
--- a/cpukit/libnetworking/rtems/rtems_bootp.c
+++ b/cpukit/libnetworking/rtems/rtems_bootp.c
@@ -8,6 +8,8 @@
#include <rtems/rtems_bsdnet.h>
#include <rtems/rtems_bsdnet_internal.h>
+#include "rtems/bootp.h"
+
/*
* Perform a BOOTP request
*/
diff --git a/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h b/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h
index d9be5af2d3..b7f79cb9be 100644
--- a/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h
+++ b/cpukit/libnetworking/rtems/rtems_bsdnet_internal.h
@@ -173,7 +173,6 @@ void domaininit (void *);
void ifinit (void *);
void ipintr (void);
void arpintr (void);
-bool bootpc_init(bool, bool);
int socket (int, int, int);
int ioctl (int, ioctl_command_t, ...);
diff --git a/cpukit/libnetworking/rtems/rtems_dhcp.c b/cpukit/libnetworking/rtems/rtems_dhcp.c
index 951f74d565..4039a48200 100644
--- a/cpukit/libnetworking/rtems/rtems_dhcp.c
+++ b/cpukit/libnetworking/rtems/rtems_dhcp.c
@@ -99,6 +99,7 @@
#include <rtems/mkrootfs.h>
#include "rtems/dhcp.h"
+#include "rtems/bootp.h"
#ifndef EALEN
#define EALEN 6
@@ -167,25 +168,6 @@ struct dhcp_packet
};
/*
- * External Declarations for Functions found in
- * rtems/c/src/libnetworking/nfs/
- */
-extern int bootpc_call (struct dhcp_packet *call,
- struct dhcp_packet *reply,
- struct proc *procp);
-extern int bootpc_fakeup_interface (struct ifreq *ireq,
- struct socket *so,
- struct proc *procp);
-extern int bootpc_adjust_interface (struct ifreq *ireq,
- struct socket *so,
- struct sockaddr_in *myaddr,
- struct sockaddr_in *netmask,
- struct sockaddr_in *gw,
- struct proc *procp);
-extern void *bootp_strdup_realloc (char *dst,
- const char *src);
-
-/*
* Variables
*/
static int dhcp_option_overload = 0;
@@ -755,7 +737,7 @@ dhcp_task (rtems_task_argument _sdl)
/*
* Send the Request.
*/
- error = bootpc_call (&call, &dhcp_req, procp);
+ error = bootpc_call ((struct bootp_packet *)&call, (struct bootp_packet *)&dhcp_req, procp);
if (error) {
rtems_bsdnet_semaphore_release ();
printf ("DHCP call failed -- error %d", error);
@@ -960,7 +942,7 @@ dhcp_init (int update_files)
/*
* Send the Discover.
*/
- error = bootpc_call (&call, &reply, procp);
+ error = bootpc_call ((struct bootp_packet *)&call, (struct bootp_packet *)&reply, procp);
if (error) {
printf ("BOOTP call failed -- %s\n", strerror(error));
soclose (so);
@@ -989,7 +971,7 @@ dhcp_init (int update_files)
*/
dhcp_request_req (&call, &reply, sdl, true);
- error = bootpc_call (&call, &reply, procp);
+ error = bootpc_call ((struct bootp_packet *)&call, (struct bootp_packet *)&reply, procp);
if (error) {
printf ("BOOTP call failed -- %s\n", strerror(error));
soclose (so);
diff --git a/cpukit/librpc/include/rpc/auth.h b/cpukit/librpc/include/rpc/auth.h
index 1b4367c1da..13432bd5d0 100644
--- a/cpukit/librpc/include/rpc/auth.h
+++ b/cpukit/librpc/include/rpc/auth.h
@@ -67,7 +67,8 @@ enum auth_stat {
* failed locally
*/
AUTH_INVALIDRESP=6, /* bogus response verifier */
- AUTH_FAILED=7 /* some unknown reason */
+ AUTH_FAILED=7, /* some unknown reason */
+ _AUTH_STAT = 0xffffffff
};
union des_block {
diff --git a/cpukit/librpc/include/rpc/clnt_stat.h b/cpukit/librpc/include/rpc/clnt_stat.h
index 397bdbc596..2c68745407 100644
--- a/cpukit/librpc/include/rpc/clnt_stat.h
+++ b/cpukit/librpc/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/cpukit/librpc/include/rpc/rpc_msg.h b/cpukit/librpc/include/rpc/rpc_msg.h
index 1668fbf7ee..63a1f360a0 100644
--- a/cpukit/librpc/include/rpc/rpc_msg.h
+++ b/cpukit/librpc/include/rpc/rpc_msg.h
@@ -58,12 +58,14 @@ struct rpc_err; /* forward */
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 {
@@ -72,12 +74,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/cpukit/librpc/include/rpc/svc.h b/cpukit/librpc/include/rpc/svc.h
index 969d2c5dd6..0ef3b8c28e 100644
--- a/cpukit/librpc/include/rpc/svc.h
+++ b/cpukit/librpc/include/rpc/svc.h
@@ -72,7 +72,8 @@
enum xprt_stat {
XPRT_DIED,
XPRT_MOREREQS,
- XPRT_IDLE
+ XPRT_IDLE,
+ _XPRT_STAT = 0xffffffff
};
struct rpc_msg;
diff --git a/cpukit/librpc/include/rpcsvc/nis_db.h b/cpukit/librpc/include/rpcsvc/nis_db.h
index dbdee5aac8..71785b0fa8 100644
--- a/cpukit/librpc/include/rpcsvc/nis_db.h
+++ b/cpukit/librpc/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/cpukit/librpc/include/rpcsvc/yp_prot.h b/cpukit/librpc/include/rpcsvc/yp_prot.h
index 5abe0e2514..f29f3ce833 100644
--- a/cpukit/librpc/include/rpcsvc/yp_prot.h
+++ b/cpukit/librpc/include/rpcsvc/yp_prot.h
@@ -233,7 +233,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/cpukit/librpc/src/xdr/xdr.c b/cpukit/librpc/src/xdr/xdr.c
index 02631e60ef..80c29bbfa5 100644
--- a/cpukit/librpc/src/xdr/xdr.c
+++ b/cpukit/librpc/src/xdr/xdr.c
@@ -458,16 +458,14 @@ xdr_enum(
enum_t *ep)
{
#ifndef lint
- enum sizecheck { SIZEVAL }; /* used to find the size of an enum */
-
/*
* enums are treated as ints
*/
- if (sizeof (enum sizecheck) == sizeof (long)) {
+ if (sizeof (enum_t) == sizeof (long)) {
return (xdr_long(xdrs, (long *)ep));
- } else if (sizeof (enum sizecheck) == sizeof (int)) {
+ } else if (sizeof (enum_t) == sizeof (int)) {
return (xdr_int(xdrs, (int *)ep));
- } else if (sizeof (enum sizecheck) == sizeof (short)) {
+ } else if (sizeof (enum_t) == sizeof (short)) {
return (xdr_short(xdrs, (short *)ep));
} else {
return (FALSE);