mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-02-13 02:51:50 +00:00
19 lines
735 B
Diff
19 lines
735 B
Diff
--- a/include/mptcpd/private/sockaddr.h 2022-07-24 18:29:37.995613204 +0200
|
|
+++ b/include/mptcpd/private/sockaddr.h 2022-07-24 18:30:53.802312010 +0200
|
|
@@ -24,6 +24,16 @@
|
|
* These macros may be used in place of @c htons() or @c htonl() when
|
|
* initializing an IPv4 address or IP port constant at compile-time.
|
|
*/
|
|
+#ifndef __bswap_constant_16
|
|
+#define __bswap_constant_16(x) \
|
|
+ ((((x) >> 8) & 0xff) | (((x) & 0xff) << 8))
|
|
+#endif
|
|
+#ifndef __bswap_constant_32
|
|
+#define __bswap_constant_32(x) \
|
|
+ ((((x) & 0xff000000u) >> 24) | (((x) & 0x00ff0000u) >> 8) \
|
|
+ | (((x) & 0x0000ff00u) << 8) | (((x) & 0x000000ffu) << 24))
|
|
+#endif
|
|
+
|
|
///@{
|
|
#if __BYTE_ORDER == __LITTLE_ENDIAN
|
|
# define MPTCPD_CONSTANT_HTONS(hs) __bswap_constant_16(hs)
|