mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-09-13 02:42:09 +02:00
LocalIP: removes usage of htonl
This commit is contained in:
@@ -4,16 +4,16 @@
|
||||
#include "modules/localip/option.h"
|
||||
|
||||
#ifndef IN6_IS_ADDR_GLOBAL
|
||||
#define IN6_IS_ADDR_GLOBAL(a) \
|
||||
((((const uint32_t *) (a))[0] & htonl(0x70000000)) == htonl(0x20000000))
|
||||
/* Global Unicast: 2000::/3 (001...) */
|
||||
#define IN6_IS_ADDR_GLOBAL(a) (((a)->s6_addr[0] & 0xE0) == 0x20)
|
||||
#endif
|
||||
#ifndef IN6_IS_ADDR_UNIQUE_LOCAL
|
||||
#define IN6_IS_ADDR_UNIQUE_LOCAL(a) \
|
||||
((((const uint32_t *) (a))[0] & htonl(0xfe000000)) == htonl(0xfc000000))
|
||||
/* Unique Local: fc00::/7 (1111 110...) */
|
||||
#define IN6_IS_ADDR_UNIQUE_LOCAL(a) (((a)->s6_addr[0] & 0xFE) == 0xFC)
|
||||
#endif
|
||||
#ifndef IN6_IS_ADDR_LINKLOCAL
|
||||
#define IN6_IS_ADDR_LINKLOCAL(a) \
|
||||
((((const uint32_t *) (a))[0] & htonl(0xffc00000)) == htonl(0xfe800000))
|
||||
/* Link-Local: fe80::/10 (1111 1110 10...) */
|
||||
#define IN6_IS_ADDR_LINKLOCAL(a) (((a)->s6_addr[0] == 0xFE) && (((a)->s6_addr[1] & 0xC0) == 0x80))
|
||||
#endif
|
||||
|
||||
typedef struct FFLocalIpResult
|
||||
|
||||
Reference in New Issue
Block a user