These glibc headers conflicts with the corresponding linux headers (<linux/in.h> and <linux/if.h>) and impose an include order (the glibc one has to be included before any linux header is included). This makes sorting includes a royal pain so let's define our own versions of these headers using various linux headers to do all the work and filling in the missing bits ourselves.
20 lines
542 B
C
20 lines
542 B
C
/* SPDX-License-Identifier: LGPL-2.1-or-later */
|
|
#pragma once
|
|
|
|
#include <linux/in.h>
|
|
#include <linux/in6.h>
|
|
#include <linux/ipv6.h>
|
|
#include <stddef.h>
|
|
#include <stdint.h>
|
|
#include <sys/socket.h>
|
|
|
|
#define INET_ADDRSTRLEN 16
|
|
#define INET6_ADDRSTRLEN 46
|
|
|
|
extern const struct in6_addr in6addr_any; /* :: */
|
|
extern const struct in6_addr in6addr_loopback; /* ::1 */
|
|
#define IN6ADDR_ANY_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 } } }
|
|
#define IN6ADDR_LOOPBACK_INIT { { { 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1 } } }
|
|
|
|
typedef uint32_t in_addr_t;
|