diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2024-02-02 23:50:16 +0000 |
---|---|---|
committer | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2024-02-02 23:50:16 +0000 |
commit | d5266f5433a1c21f6d80f63c628434550c6c1b76 (patch) | |
tree | aa518d8caa939f46f861f56ea1c1555ab6439d99 | |
parent | 97bbc9605a9578e053bfc9aa29bd8d7dd64b995a (diff) | |
parent | bae07997ea3ac7646690d852a5820d5d4cd5aa94 (diff) | |
download | musl-simpleperf-release.tar.gz |
Snap for 11400057 from bae07997ea3ac7646690d852a5820d5d4cd5aa94 to simpleperf-releasesimpleperf-release
Change-Id: I01ac9af7e3185894c5c4d781744dccc0c5474366
-rw-r--r-- | android/include/bits/sockaddr_storage.h | 12 | ||||
-rw-r--r-- | android/include/bits/tcphdr.h | 69 | ||||
-rw-r--r-- | include/netinet/tcp.h | 60 | ||||
-rw-r--r-- | include/sys/socket.h | 6 |
4 files changed, 83 insertions, 64 deletions
diff --git a/android/include/bits/sockaddr_storage.h b/android/include/bits/sockaddr_storage.h new file mode 100644 index 00000000..0de9de1c --- /dev/null +++ b/android/include/bits/sockaddr_storage.h @@ -0,0 +1,12 @@ +#pragma once + +#include <features.h> + +#define __NEED_sa_family_t +#include <bits/alltypes.h> + +struct sockaddr_storage { + sa_family_t ss_family; + char __ss_padding[128-sizeof(long)-sizeof(sa_family_t)]; + unsigned long __ss_align; +}; 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 diff --git a/include/sys/socket.h b/include/sys/socket.h index 0b39d835..acbe63c4 100644 --- a/include/sys/socket.h +++ b/include/sys/socket.h @@ -371,11 +371,7 @@ struct sockaddr { char sa_data[14]; }; -struct sockaddr_storage { - sa_family_t ss_family; - char __ss_padding[128-sizeof(long)-sizeof(sa_family_t)]; - unsigned long __ss_align; -}; +#include <bits/sockaddr_storage.h> int socket (int, int, int); int socketpair (int, int, int, int [2]); |