aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorElliott Hughes <enh@google.com>2023-11-28 16:09:16 -0800
committerElliott Hughes <enh@google.com>2023-12-04 16:49:49 -0800
commit65468d9f2289b79ef40c9dbe6ab1e6ac2bba177c (patch)
tree8d00348672e24855a0a87e6098724056d36b0fbe
parent9f1ffdd3d97cb457f44a70c5fbe915e57b104d9c (diff)
downloadmusl-65468d9f2289b79ef40c9dbe6ab1e6ac2bba177c.tar.gz
Track bionic uapi header change.
Bug: http://b/236042740 Test: treehugger Change-Id: I5f31933a51b36ea775997179b86051266953871e
-rw-r--r--android/include/bits/tcphdr.h69
-rw-r--r--include/netinet/tcp.h60
2 files changed, 70 insertions, 59 deletions
diff --git a/android/include/bits/tcphdr.h b/android/include/bits/tcphdr.h
new file mode 100644
index 00000000..174e400b
--- /dev/null
+++ b/android/include/bits/tcphdr.h
@@ -0,0 +1,69 @@
+#pragma once
+
+#include <features.h>
+#include <stdint.h>
+#include <sys/types.h>
+
+#if defined(_GNU_SOURCE) || defined(_BSD_SOURCE)
+
+struct tcphdr {
+#ifdef _GNU_SOURCE
+#ifdef __GNUC__
+ __extension__
+#endif
+ union { struct {
+
+ uint16_t source;
+ uint16_t dest;
+ uint32_t seq;
+ uint32_t ack_seq;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+ uint16_t res1:4;
+ uint16_t doff:4;
+ uint16_t fin:1;
+ uint16_t syn:1;
+ uint16_t rst:1;
+ uint16_t psh:1;
+ uint16_t ack:1;
+ uint16_t urg:1;
+ uint16_t res2:2;
+#else
+ uint16_t doff:4;
+ uint16_t res1:4;
+ uint16_t res2:2;
+ uint16_t urg:1;
+ uint16_t ack:1;
+ uint16_t psh:1;
+ uint16_t rst:1;
+ uint16_t syn:1;
+ uint16_t fin:1;
+#endif
+ uint16_t window;
+ uint16_t check;
+ uint16_t urg_ptr;
+
+ }; struct {
+#endif
+
+ uint16_t th_sport;
+ uint16_t th_dport;
+ uint32_t th_seq;
+ uint32_t th_ack;
+#if __BYTE_ORDER == __LITTLE_ENDIAN
+ uint8_t th_x2:4;
+ uint8_t th_off:4;
+#else
+ uint8_t th_off:4;
+ uint8_t th_x2:4;
+#endif
+ uint8_t th_flags;
+ uint16_t th_win;
+ uint16_t th_sum;
+ uint16_t th_urp;
+
+#ifdef _GNU_SOURCE
+ }; };
+#endif
+};
+
+#endif
diff --git a/include/netinet/tcp.h b/include/netinet/tcp.h
index fad1d844..7ac938b8 100644
--- a/include/netinet/tcp.h
+++ b/include/netinet/tcp.h
@@ -112,65 +112,7 @@ typedef uint32_t tcp_seq;
#define TH_ACK 0x10
#define TH_URG 0x20
-struct tcphdr {
-#ifdef _GNU_SOURCE
-#ifdef __GNUC__
- __extension__
-#endif
- union { struct {
-
- uint16_t source;
- uint16_t dest;
- uint32_t seq;
- uint32_t ack_seq;
-#if __BYTE_ORDER == __LITTLE_ENDIAN
- uint16_t res1:4;
- uint16_t doff:4;
- uint16_t fin:1;
- uint16_t syn:1;
- uint16_t rst:1;
- uint16_t psh:1;
- uint16_t ack:1;
- uint16_t urg:1;
- uint16_t res2:2;
-#else
- uint16_t doff:4;
- uint16_t res1:4;
- uint16_t res2:2;
- uint16_t urg:1;
- uint16_t ack:1;
- uint16_t psh:1;
- uint16_t rst:1;
- uint16_t syn:1;
- uint16_t fin:1;
-#endif
- uint16_t window;
- uint16_t check;
- uint16_t urg_ptr;
-
- }; struct {
-#endif
-
- uint16_t th_sport;
- uint16_t th_dport;
- uint32_t th_seq;
- uint32_t th_ack;
-#if __BYTE_ORDER == __LITTLE_ENDIAN
- uint8_t th_x2:4;
- uint8_t th_off:4;
-#else
- uint8_t th_off:4;
- uint8_t th_x2:4;
-#endif
- uint8_t th_flags;
- uint16_t th_win;
- uint16_t th_sum;
- uint16_t th_urp;
-
-#ifdef _GNU_SOURCE
- }; };
-#endif
-};
+#include <bits/tcphdr.h>
#endif
#ifdef _GNU_SOURCE