about summary refs log tree commit diff
path: root/sysdeps/gnu/netinet/tcp.h
diff options
context:
space:
mode:
authorJoseph Myers <joseph@codesourcery.com>2013-12-17 18:05:42 +0000
committerJoseph Myers <joseph@codesourcery.com>2013-12-17 18:05:57 +0000
commit7011c2622fe3e10a29dbe74f06aaebd07710127d (patch)
tree42987e63dc4500ac40585cba04f0392ea0ca3dc2 /sysdeps/gnu/netinet/tcp.h
parent0f197fe5b65c6df1a3a0b6b36383d4babec85bd1 (diff)
downloadglibc-7011c2622fe3e10a29dbe74f06aaebd07710127d.tar.gz
glibc-7011c2622fe3e10a29dbe74f06aaebd07710127d.tar.xz
glibc-7011c2622fe3e10a29dbe74f06aaebd07710127d.zip
Remove __FAVOR_BSD.
Diffstat (limited to 'sysdeps/gnu/netinet/tcp.h')
-rw-r--r--sysdeps/gnu/netinet/tcp.h120
1 files changed, 61 insertions, 59 deletions
diff --git a/sysdeps/gnu/netinet/tcp.h b/sysdeps/gnu/netinet/tcp.h
index b7bf9b38d4..f6602ecfde 100644
--- a/sysdeps/gnu/netinet/tcp.h
+++ b/sysdeps/gnu/netinet/tcp.h
@@ -66,7 +66,6 @@
 # include <sys/types.h>
 # include <sys/socket.h>
 
-# ifdef __FAVOR_BSD
 typedef	u_int32_t tcp_seq;
 /*
  * TCP header.
@@ -74,66 +73,69 @@ typedef	u_int32_t tcp_seq;
  */
 struct tcphdr
   {
-    u_int16_t th_sport;		/* source port */
-    u_int16_t th_dport;		/* destination port */
-    tcp_seq th_seq;		/* sequence number */
-    tcp_seq th_ack;		/* acknowledgement number */
-#  if __BYTE_ORDER == __LITTLE_ENDIAN
-    u_int8_t th_x2:4;		/* (unused) */
-    u_int8_t th_off:4;		/* data offset */
-#  endif
-#  if __BYTE_ORDER == __BIG_ENDIAN
-    u_int8_t th_off:4;		/* data offset */
-    u_int8_t th_x2:4;		/* (unused) */
-#  endif
-    u_int8_t th_flags;
-#  define TH_FIN	0x01
-#  define TH_SYN	0x02
-#  define TH_RST	0x04
-#  define TH_PUSH	0x08
-#  define TH_ACK	0x10
-#  define TH_URG	0x20
-    u_int16_t th_win;		/* window */
-    u_int16_t th_sum;		/* checksum */
-    u_int16_t th_urp;		/* urgent pointer */
+    __extension__ union
+    {
+      struct
+      {
+	u_int16_t th_sport;		/* source port */
+	u_int16_t th_dport;		/* destination port */
+	tcp_seq th_seq;		/* sequence number */
+	tcp_seq th_ack;		/* acknowledgement number */
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+	u_int8_t th_x2:4;		/* (unused) */
+	u_int8_t th_off:4;		/* data offset */
+# endif
+# if __BYTE_ORDER == __BIG_ENDIAN
+	u_int8_t th_off:4;		/* data offset */
+	u_int8_t th_x2:4;		/* (unused) */
+# endif
+	u_int8_t th_flags;
+# define TH_FIN	0x01
+# define TH_SYN	0x02
+# define TH_RST	0x04
+# define TH_PUSH	0x08
+# define TH_ACK	0x10
+# define TH_URG	0x20
+	u_int16_t th_win;		/* window */
+	u_int16_t th_sum;		/* checksum */
+	u_int16_t th_urp;		/* urgent pointer */
+      };
+      struct
+      {
+	u_int16_t source;
+	u_int16_t dest;
+	u_int32_t seq;
+	u_int32_t ack_seq;
+# if __BYTE_ORDER == __LITTLE_ENDIAN
+	u_int16_t res1:4;
+	u_int16_t doff:4;
+	u_int16_t fin:1;
+	u_int16_t syn:1;
+	u_int16_t rst:1;
+	u_int16_t psh:1;
+	u_int16_t ack:1;
+	u_int16_t urg:1;
+	u_int16_t res2:2;
+# elif __BYTE_ORDER == __BIG_ENDIAN
+	u_int16_t doff:4;
+	u_int16_t res1:4;
+	u_int16_t res2:2;
+	u_int16_t urg:1;
+	u_int16_t ack:1;
+	u_int16_t psh:1;
+	u_int16_t rst:1;
+	u_int16_t syn:1;
+	u_int16_t fin:1;
+# else
+#  error "Adjust your <bits/endian.h> defines"
+# endif
+	u_int16_t window;
+	u_int16_t check;
+	u_int16_t urg_ptr;
+      };
+    };
 };
 
-# else /* !__FAVOR_BSD */
-struct tcphdr
-  {
-    u_int16_t source;
-    u_int16_t dest;
-    u_int32_t seq;
-    u_int32_t ack_seq;
-#  if __BYTE_ORDER == __LITTLE_ENDIAN
-    u_int16_t res1:4;
-    u_int16_t doff:4;
-    u_int16_t fin:1;
-    u_int16_t syn:1;
-    u_int16_t rst:1;
-    u_int16_t psh:1;
-    u_int16_t ack:1;
-    u_int16_t urg:1;
-    u_int16_t res2:2;
-#  elif __BYTE_ORDER == __BIG_ENDIAN
-    u_int16_t doff:4;
-    u_int16_t res1:4;
-    u_int16_t res2:2;
-    u_int16_t urg:1;
-    u_int16_t ack:1;
-    u_int16_t psh:1;
-    u_int16_t rst:1;
-    u_int16_t syn:1;
-    u_int16_t fin:1;
-#  else
-#   error "Adjust your <bits/endian.h> defines"
-#  endif
-    u_int16_t window;
-    u_int16_t check;
-    u_int16_t urg_ptr;
-};
-# endif /* __FAVOR_BSD */
-
 enum
 {
   TCP_ESTABLISHED = 1,