relibc: add Linux struct ifreq and ifconf to net/if.h
Qt 6.11.1 qtbase/qnetworkinterface_unix.cpp needs struct ifreq and struct ifconf for SIOCGIFMTU/SIOCGIFINDEX/SIOCGIFCONF ioctls. Define them in the cbindgen-generated net/if.h with sys/socket.h included.
This commit is contained in:
@@ -8,5 +8,48 @@ style = "Tag"
|
||||
no_includes = true
|
||||
cpp_compat = true
|
||||
|
||||
after_includes = """
|
||||
#include <sys/socket.h>
|
||||
|
||||
/* Nonstandard Linux netdevice structures used by ioctl (SIOCGIFMTU, etc.).
|
||||
See https://man7.org/linux/man-pages/man7/netdevice.7.html. */
|
||||
|
||||
struct ifmap {
|
||||
unsigned long mem_start;
|
||||
unsigned long mem_end;
|
||||
unsigned short base_addr;
|
||||
unsigned char irq;
|
||||
unsigned char dma;
|
||||
unsigned char port;
|
||||
};
|
||||
|
||||
struct ifreq {
|
||||
char ifr_name[16];
|
||||
union {
|
||||
struct sockaddr ifr_addr;
|
||||
struct sockaddr ifr_dstaddr;
|
||||
struct sockaddr ifr_broadaddr;
|
||||
struct sockaddr ifr_netmask;
|
||||
struct sockaddr ifr_hwaddr;
|
||||
short ifr_flags;
|
||||
int ifr_ifindex;
|
||||
int ifr_metric;
|
||||
int ifr_mtu;
|
||||
struct ifmap ifr_map;
|
||||
char ifr_slave[16];
|
||||
char ifr_newname[16];
|
||||
char *ifr_data;
|
||||
};
|
||||
};
|
||||
|
||||
struct ifconf {
|
||||
int ifc_len;
|
||||
union {
|
||||
char *ifc_buf;
|
||||
struct ifreq *ifreq;
|
||||
};
|
||||
};
|
||||
"""
|
||||
|
||||
[enum]
|
||||
prefix_with_name = true
|
||||
|
||||
Reference in New Issue
Block a user