share ntoh? definitions
authorMike Karels <karels@ucbvax.Berkeley.EDU>
Sat, 17 Jan 1987 04:58:50 +0000 (20:58 -0800)
committerMike Karels <karels@ucbvax.Berkeley.EDU>
Sat, 17 Jan 1987 04:58:50 +0000 (20:58 -0800)
SCCS-vsn: sys/tahoe/include/param.h 1.5
SCCS-vsn: sys/vax/include/param.h 7.3
SCCS-vsn: sys/netinet/in.h 7.2
SCCS-vsn: sys/netns/ns.h 7.2

usr/src/sys/netinet/in.h
usr/src/sys/netns/ns.h
usr/src/sys/tahoe/include/param.h
usr/src/sys/vax/include/param.h

index 992e211..eb1dc62 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)in.h        7.1 (Berkeley) %G%
+ *     @(#)in.h        7.2 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -74,6 +74,9 @@ struct in_addr {
 
 #define        INADDR_ANY              (u_long)0x00000000
 #define        INADDR_BROADCAST        (u_long)0xffffffff      /* must be masked */
 
 #define        INADDR_ANY              (u_long)0x00000000
 #define        INADDR_BROADCAST        (u_long)0xffffffff      /* must be masked */
+#ifndef KERNEL
+#define        INADDR_NONE             0xffffffff              /* -1 return */
+#endif
 
 /*
  * Socket address, internet style.
 
 /*
  * Socket address, internet style.
@@ -90,21 +93,6 @@ struct sockaddr_in {
  */
 #define        IP_OPTIONS      1               /* set/get IP per-packet options */
 
  */
 #define        IP_OPTIONS      1               /* set/get IP per-packet options */
 
-#if !defined(vax) && !defined(ntohl) && !defined(lint)
-/*
- * Macros for number representation conversion.
- */
-#define        ntohl(x)        (x)
-#define        ntohs(x)        (x)
-#define        htonl(x)        (x)
-#define        htons(x)        (x)
-#endif
-
-#if !defined(ntohl) && (defined(vax) || defined(lint))
-u_short        ntohs(), htons();
-u_long ntohl(), htonl();
-#endif
-
 #ifdef KERNEL
 extern struct domain inetdomain;
 extern struct protosw inetsw[];
 #ifdef KERNEL
 extern struct domain inetdomain;
 extern struct protosw inetsw[];
index 83966b8..895847d 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)ns.h        7.1 (Berkeley) %G%
+ *     @(#)ns.h        7.2 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -103,21 +103,6 @@ struct sockaddr_ns {
 #define ns_nullhost(x) (((x).x_host.s_host[0]==0) && \
        ((x).x_host.s_host[1]==0) && ((x).x_host.s_host[2]==0))
 
 #define ns_nullhost(x) (((x).x_host.s_host[0]==0) && \
        ((x).x_host.s_host[1]==0) && ((x).x_host.s_host[2]==0))
 
-#if !defined(vax) && !defined(ntohl) && !defined(lint)
-/*
- * Macros for number representation conversion.
- */
-#define        ntohl(x)        (x)
-#define        ntohs(x)        (x)
-#define        htonl(x)        (x)
-#define        htons(x)        (x)
-#endif
-
-#if !defined(ntohl) && (defined(vax) || defined(lint))
-u_short        ntohs(), htons();
-u_long ntohl(), htonl();
-#endif
-
 #ifdef KERNEL
 extern struct domain nsdomain;
 union ns_host ns_thishost;
 #ifdef KERNEL
 extern struct domain nsdomain;
 union ns_host ns_thishost;
index 7c6980a..420179b 100644 (file)
@@ -1,4 +1,4 @@
-/*     param.h 1.4     86/11/03        */
+/*     param.h 1.5     87/01/16        */
 
 /*
  * Machine dependent constants for TAHOE.
 
 /*
  * Machine dependent constants for TAHOE.
 #define        PDP     3412            /* LSB first in word, MSW first in long (pdp) */
 #define        ENDIAN  BIG             /* byte order on tahoe */
 
 #define        PDP     3412            /* LSB first in word, MSW first in long (pdp) */
 #define        ENDIAN  BIG             /* byte order on tahoe */
 
+/*
+ * Macros for network/external number representation conversion.
+ */
+#if ENDIAN == BIG && !defined(lint)
+#define        ntohl(x)        (x)
+#define        ntohs(x)        (x)
+#define        htonl(x)        (x)
+#define        htons(x)        (x)
+#else
+u_short        ntohs(), htons();
+u_long ntohl(), htonl();
+#endif
+
 #define        NBPG    1024            /* bytes/page */
 #define        PGOFSET (NBPG-1)        /* byte offset into page */
 #define        PGSHIFT 10              /* LOG2(NBPG) */
 #define        NBPG    1024            /* bytes/page */
 #define        PGOFSET (NBPG-1)        /* byte offset into page */
 #define        PGSHIFT 10              /* LOG2(NBPG) */
index 8905500..01fd39e 100644 (file)
@@ -3,7 +3,7 @@
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
  * All rights reserved.  The Berkeley software License Agreement
  * specifies the terms and conditions for redistribution.
  *
- *     @(#)param.h     7.2 (Berkeley) %G%
+ *     @(#)param.h     7.3 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
 #define        PDP     3412            /* LSB first in word, MSW first in long (pdp) */
 #define        ENDIAN  LITTLE          /* byte order on vax */
 
 #define        PDP     3412            /* LSB first in word, MSW first in long (pdp) */
 #define        ENDIAN  LITTLE          /* byte order on vax */
 
+/*
+ * Macros for network/external number representation conversion.
+ */
+#if ENDIAN == BIG && !defined(lint)
+#define        ntohl(x)        (x)
+#define        ntohs(x)        (x)
+#define        htonl(x)        (x)
+#define        htons(x)        (x)
+#else
+u_short        ntohs(), htons();
+u_long ntohl(), htonl();
+#endif
+
 #define        NBPG    512             /* bytes/page */
 #define        PGOFSET (NBPG-1)        /* byte offset into page */
 #define        PGSHIFT 9               /* LOG2(NBPG) */
 #define        NBPG    512             /* bytes/page */
 #define        PGOFSET (NBPG-1)        /* byte offset into page */
 #define        PGSHIFT 9               /* LOG2(NBPG) */
@@ -65,4 +78,4 @@ int   cpuspeed;
 #else KERNEL
 #define        DELAY(n)        { register int N = (n); while (--N > 0); }
 #endif KERNEL
 #else KERNEL
 #define        DELAY(n)        { register int N = (n); while (--N > 0); }
 #endif KERNEL
-#endif
+#endif ENDIAN