byte order changes for tahoe
authorMike Karels <karels@ucbvax.Berkeley.EDU>
Wed, 29 Oct 1986 14:53:37 +0000 (06:53 -0800)
committerMike Karels <karels@ucbvax.Berkeley.EDU>
Wed, 29 Oct 1986 14:53:37 +0000 (06:53 -0800)
SCCS-vsn: sys/netinet/ip.h 7.2
SCCS-vsn: sys/netinet/ip_output.c 7.2
SCCS-vsn: sys/netinet/ip_var.h 7.2
SCCS-vsn: sys/netinet/tcp.h 7.2

usr/src/sys/netinet/ip.h
usr/src/sys/netinet/ip_output.c
usr/src/sys/netinet/ip_var.h
usr/src/sys/netinet/tcp.h

index 477b6f3..2d559a6 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.
  *
- *     @(#)ip.h        7.1 (Berkeley) %G%
+ *     @(#)ip.h        7.2 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
  * against negative integers quite easily, and fail in subtle ways.
  */
 struct ip {
  * against negative integers quite easily, and fail in subtle ways.
  */
 struct ip {
-#ifdef vax
+#if ENDIAN == LITTLE
        u_char  ip_hl:4,                /* header length */
                ip_v:4;                 /* version */
        u_char  ip_hl:4,                /* header length */
                ip_v:4;                 /* version */
+#endif
+#if ENDIAN == BIG
+       u_char  ip_v:4,                 /* version */
+               ip_hl:4;                /* header length */
 #endif
        u_char  ip_tos;                 /* type of service */
        short   ip_len;                 /* total length */
 #endif
        u_char  ip_tos;                 /* type of service */
        short   ip_len;                 /* total length */
@@ -73,8 +77,14 @@ struct       ip_timestamp {
        u_char  ipt_code;               /* IPOPT_TS */
        u_char  ipt_len;                /* size of structure (variable) */
        u_char  ipt_ptr;                /* index of current entry */
        u_char  ipt_code;               /* IPOPT_TS */
        u_char  ipt_len;                /* size of structure (variable) */
        u_char  ipt_ptr;                /* index of current entry */
+#if ENDIAN == LITTLE
        u_char  ipt_flg:4,              /* flags, see below */
                ipt_oflw:4;             /* overflow counter */
        u_char  ipt_flg:4,              /* flags, see below */
                ipt_oflw:4;             /* overflow counter */
+#endif
+#if ENDIAN == BIG
+       u_char  ipt_oflw:4,             /* overflow counter */
+               ipt_flg:4;              /* flags, see below */
+#endif
        union {
                n_long  ipt_time[1];
                struct  ipt_ta {
        union {
                n_long  ipt_time[1];
                struct  ipt_ta {
index 94983ac..a40cf06 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.
  *
- *     @(#)ip_output.c 7.1 (Berkeley) %G%
+ *     @(#)ip_output.c 7.2 (Berkeley) %G%
  */
 
 #include "param.h"
  */
 
 #include "param.h"
@@ -24,7 +24,7 @@
 #include "ip_var.h"
 
 #ifdef vax
 #include "ip_var.h"
 
 #ifdef vax
-#include "../vax/mtpr.h"
+#include "../machine/mtpr.h"
 #endif
 
 struct mbuf *ip_insertoptions();
 #endif
 
 struct mbuf *ip_insertoptions();
index ebe3c4e..82bfe85 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.
  *
- *     @(#)ip_var.h    7.1 (Berkeley) %G%
+ *     @(#)ip_var.h    7.2 (Berkeley) %G%
  */
 
 /*
  */
 
 /*
@@ -40,9 +40,13 @@ struct ipq {
  * Note: ipf_next must be at same offset as ipq_next above
  */
 struct ipasfrag {
  * Note: ipf_next must be at same offset as ipq_next above
  */
 struct ipasfrag {
-#ifdef vax
+#if ENDIAN == LITTLE
        u_char  ip_hl:4,
                ip_v:4;
        u_char  ip_hl:4,
                ip_v:4;
+#endif
+#if ENDIAN == BIG
+       u_char  ip_v:4,
+               ip_hl:4;
 #endif
        u_char  ipf_mff;                /* copied from (ip_off&IP_MF) */
        short   ip_len;
 #endif
        u_char  ipf_mff;                /* copied from (ip_off&IP_MF) */
        short   ip_len;
index 922c906..03bbc4f 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.
  *
- *     @(#)tcp.h       7.1 (Berkeley) %G%
+ *     @(#)tcp.h       7.2 (Berkeley) %G%
  */
 
 typedef        u_long  tcp_seq;
  */
 
 typedef        u_long  tcp_seq;
@@ -16,9 +16,13 @@ struct tcphdr {
        u_short th_dport;               /* destination port */
        tcp_seq th_seq;                 /* sequence number */
        tcp_seq th_ack;                 /* acknowledgement number */
        u_short th_dport;               /* destination port */
        tcp_seq th_seq;                 /* sequence number */
        tcp_seq th_ack;                 /* acknowledgement number */
-#ifdef vax
+#if ENDIAN == LITTLE
        u_char  th_x2:4,                /* (unused) */
                th_off:4;               /* data offset */
        u_char  th_x2:4,                /* (unused) */
                th_off:4;               /* data offset */
+#endif
+#if ENDIAN == BIG
+       u_char  th_off:4,               /* data offset */
+               th_x2:4;                /* (unused) */
 #endif
        u_char  th_flags;
 #define        TH_FIN  0x01
 #endif
        u_char  th_flags;
 #define        TH_FIN  0x01