LibC: Add ifreq.ifr_{flags,mtu} and fix defines
compatibility defines for ifr_{netmask,gwaddr,hwaddr} were wrong
This commit is contained in:
parent
f3319016c4
commit
3acad7c911
|
|
@ -7,10 +7,11 @@
|
||||||
|
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
|
||||||
#define IF_NAMESIZE 16
|
|
||||||
|
|
||||||
__BEGIN_DECLS
|
__BEGIN_DECLS
|
||||||
|
|
||||||
|
#define IF_NAMESIZE 16
|
||||||
|
#define IFNAMSIZ IF_NAMESIZE
|
||||||
|
|
||||||
struct if_nameindex
|
struct if_nameindex
|
||||||
{
|
{
|
||||||
unsigned if_index; /* Numeric index of the interface. */
|
unsigned if_index; /* Numeric index of the interface. */
|
||||||
|
|
@ -28,23 +29,29 @@ struct ifreq
|
||||||
struct sockaddr ifru_netmask;
|
struct sockaddr ifru_netmask;
|
||||||
struct sockaddr ifru_gwaddr;
|
struct sockaddr ifru_gwaddr;
|
||||||
struct sockaddr ifru_hwaddr;
|
struct sockaddr ifru_hwaddr;
|
||||||
|
int ifru_flags;
|
||||||
|
int ifru_mtu;
|
||||||
unsigned char __min_storage[sizeof(struct sockaddr) + 6];
|
unsigned char __min_storage[sizeof(struct sockaddr) + 6];
|
||||||
} ifr_ifru;
|
} ifr_ifru;
|
||||||
};
|
};
|
||||||
#define ifr_name ifr_ifrn.ifrn_name
|
#define ifr_name ifr_ifrn.ifrn_name
|
||||||
#define ifr_addr ifr_ifru.ifru_addr
|
#define ifr_addr ifr_ifru.ifru_addr
|
||||||
#define ifr_netmask ifr_ifru.ifru_addrnetmask
|
#define ifr_netmask ifr_ifru.ifru_netmask
|
||||||
#define ifr_gwaddr ifr_ifru.ifru_addrgwaddr
|
#define ifr_gwaddr ifr_ifru.ifru_gwaddr
|
||||||
#define ifr_hwaddr ifr_ifru.ifru_addrhwaddr
|
#define ifr_hwaddr ifr_ifru.ifru_hwaddr
|
||||||
|
#define ifr_flags ifr_ifru.ifru_flags
|
||||||
|
#define ifr_mtu ifr_ifru.ifru_mtu
|
||||||
|
|
||||||
#define SIOCGIFADDR 1 /* Get interface address */
|
#define SIOCGIFADDR 1 /* Get interface address */
|
||||||
#define SIOCSIFADDR 2 /* Set interface address */
|
#define SIOCSIFADDR 2 /* Set interface address */
|
||||||
#define SIOCGIFNETMASK 3 /* Get network mask */
|
#define SIOCGIFNETMASK 3 /* Get network mask */
|
||||||
#define SIOCSIFNETMASK 4 /* Set network mask */
|
#define SIOCSIFNETMASK 4 /* Set network mask */
|
||||||
#define SIOCGIFGWADDR 5 /* Get gateway address */
|
#define SIOCGIFGWADDR 5 /* Get gateway address */
|
||||||
#define SIOCSIFGWADDR 6 /* Set gateway address */
|
#define SIOCSIFGWADDR 6 /* Set gateway address */
|
||||||
#define SIOCGIFHWADDR 7 /* Get hardware address */
|
#define SIOCGIFHWADDR 7 /* Get hardware address */
|
||||||
#define SIOCGIFNAME 8 /* Get interface name */
|
#define SIOCGIFNAME 8 /* Get interface name */
|
||||||
|
#define SIOCGIFFLAGS 9
|
||||||
|
#define SIOCGIFMTU 10
|
||||||
|
|
||||||
void if_freenameindex(struct if_nameindex* ptr);
|
void if_freenameindex(struct if_nameindex* ptr);
|
||||||
char* if_indextoname(unsigned ifindex, char* ifname);
|
char* if_indextoname(unsigned ifindex, char* ifname);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue