diff options
author | Ralf Corsepius <ralf.corsepius@rtems.org> | 2005-09-16 06:11:06 +0000 |
---|---|---|
committer | Ralf Corsepius <ralf.corsepius@rtems.org> | 2005-09-16 06:11:06 +0000 |
commit | d74c13b7f445353e451db15ed14ad323985bc475 (patch) | |
tree | 6961bf6d2b769d75e2d4b6c07baace9c4706291a /cpukit/libnetworking | |
parent | 2005-09-16 Ralf Corsepius <ralf.corsepius@rtems.org> (diff) | |
download | rtems-d74c13b7f445353e451db15ed14ad323985bc475.tar.bz2 |
Partial update from FreeBSD.
Diffstat (limited to 'cpukit/libnetworking')
-rw-r--r-- | cpukit/libnetworking/netinet/in.h | 26 | ||||
-rw-r--r-- | cpukit/libnetworking/nfs/xdr_subs.h | 30 |
2 files changed, 27 insertions, 29 deletions
diff --git a/cpukit/libnetworking/netinet/in.h b/cpukit/libnetworking/netinet/in.h index 1c7786b4b9..48e53e9496 100644 --- a/cpukit/libnetworking/netinet/in.h +++ b/cpukit/libnetworking/netinet/in.h @@ -27,7 +27,7 @@ * SUCH DAMAGE. * * @(#)in.h 8.3 (Berkeley) 1/3/94 - * $FreeBSD: src/sys/netinet/in.h,v 1.90 2005/02/22 13:04:03 glebius Exp $ + * $FreeBSD: src/sys/netinet/in.h,v 1.91 2005/08/22 16:13:07 andre Exp $ */ /* @@ -59,7 +59,7 @@ typedef __sa_family_t sa_family_t; #define _SA_FAMILY_T_DECLARED #endif -/* Internet address (a structure for historical reasons) */ +/* Internet address (a structure for historical reasons). */ #ifndef _STRUCT_IN_ADDR_DECLARED struct in_addr { u_long s_addr; @@ -289,19 +289,17 @@ struct sockaddr_in { #define IN_EXPERIMENTAL(i) (((u_int32_t)(i) & 0xf0000000) == 0xf0000000) #define IN_BADCLASS(i) (((u_int32_t)(i) & 0xf0000000) == 0xf0000000) +#define INADDR_LOOPBACK (u_int32_t)0x7f000001 #ifndef _KERNEL #define INADDR_NONE 0xffffffff /* -1 return */ #endif -#define INADDR_UNSPEC_GROUP (u_long)0xe0000000 /* 224.0.0.0 */ -#define INADDR_ALLHOSTS_GROUP (u_long)0xe0000001 /* 224.0.0.1 */ -#define INADDR_ALLRTRS_GROUP (u_long)0xe0000002 /* 224.0.0.2 */ -#define INADDR_MAX_LOCAL_GROUP (u_long)0xe00000ff /* 224.0.0.255 */ +#define INADDR_UNSPEC_GROUP (u_int32_t)0xe0000000 /* 224.0.0.0 */ +#define INADDR_ALLHOSTS_GROUP (u_int32_t)0xe0000001 /* 224.0.0.1 */ +#define INADDR_ALLRTRS_GROUP (u_int32_t)0xe0000002 /* 224.0.0.2 */ +#define INADDR_MAX_LOCAL_GROUP (u_int32_t)0xe00000ff /* 224.0.0.255 */ #define IN_LOOPBACKNET 127 /* official! */ -#ifndef INADDR_LOOPBACK -#define INADDR_LOOPBACK (u_long)0x7F000001 /* 127.0.0.1 */ -#endif /* * Structure used to describe IP options. @@ -444,11 +442,11 @@ struct ip_mreq { #ifdef _KERNEL struct ifnet; struct mbuf; /* forward declarations for Standard C */ -int in_broadcast __P((struct in_addr, struct ifnet *)); -int in_canforward __P((struct in_addr)); -int in_cksum __P((struct mbuf *, int)); -int in_localaddr __P((struct in_addr)); -char *inet_ntoa __P((struct in_addr)); /* in libkern */ +int in_broadcast(struct in_addr, struct ifnet *); +int in_canforward(struct in_addr); +int in_cksum(struct mbuf *, int); +int in_localaddr(struct in_addr); +char *inet_ntoa(struct in_addr); /* in libkern */ /* Firewall hooks */ struct ip; diff --git a/cpukit/libnetworking/nfs/xdr_subs.h b/cpukit/libnetworking/nfs/xdr_subs.h index 874730378f..62358a57ea 100644 --- a/cpukit/libnetworking/nfs/xdr_subs.h +++ b/cpukit/libnetworking/nfs/xdr_subs.h @@ -13,10 +13,6 @@ * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in the * documentation and/or other materials provided with the distribution. - * 3. All advertising materials mentioning features or use of this software - * must display the following acknowledgement: - * This product includes software developed by the University of - * California, Berkeley and its contributors. * 4. Neither the name of the University nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. @@ -33,7 +29,11 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * @(#)xdr_subs.h 8.1 (Berkeley) 6/10/93 + * @(#)xdr_subs.h 8.3 (Berkeley) 3/30/95 + * $FreeBSD: src/sys/nfs/xdr_subs.h,v 1.15 2005/01/07 01:45:50 imp Exp $ + */ + +/* * $Id$ */ @@ -51,8 +51,8 @@ * but we cannot count on their alignment anyway. */ -#define fxdr_unsigned(t, v) ((t)ntohl((long)(v))) -#define txdr_unsigned(v) (htonl((long)(v))) +#define fxdr_unsigned(t, v) ((t)ntohl((int32_t)(v))) +#define txdr_unsigned(v) (htonl((int32_t)(v))) #define fxdr_nfsv2time(f, t) { \ (t)->tv_sec = ntohl(((struct nfsv2_time *)(f))->nfsv2_sec); \ @@ -78,13 +78,13 @@ ((struct nfsv3_time *)(t))->nfsv3_nsec = htonl((f)->tv_nsec); \ } -#define fxdr_hyper(f, t) { \ - ((long *)(t))[_QUAD_HIGHWORD] = ntohl(((long *)(f))[0]); \ - ((long *)(t))[_QUAD_LOWWORD] = ntohl(((long *)(f))[1]); \ -} -#define txdr_hyper(f, t) { \ - ((long *)(t))[0] = htonl(((long *)(f))[_QUAD_HIGHWORD]); \ - ((long *)(t))[1] = htonl(((long *)(f))[_QUAD_LOWWORD]); \ -} +#define fxdr_hyper(f) \ + ((((u_quad_t)ntohl(((u_int32_t *)(f))[0])) << 32) | \ + (u_quad_t)(ntohl(((u_int32_t *)(f))[1]))) +#define txdr_hyper(f, t) \ +do { \ + ((u_int32_t *)(t))[0] = htonl((u_int32_t)((f) >> 32)); \ + ((u_int32_t *)(t))[1] = htonl((u_int32_t)((f) & 0xffffffff)); \ +} while (0) #endif |