options/posix: rework struct ifreq to match linux with support macros
@@ -26,24 +26,43 @@ struct ifmap {
};
struct ifreq {
- char ifr_name[IFNAMSIZ];
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[IFNAMSIZ];
- char ifr_newname[IFNAMSIZ];
- char *ifr_data;
- };
+ char ifrn_name[IFNAMSIZ];
+ } ifr_ifrn;
+
+ union {
+ struct sockaddr ifru_addr;
+ struct sockaddr ifru_dstaddr;
+ struct sockaddr ifru_broadaddr;
+ struct sockaddr ifru_netmask;
+ struct sockaddr ifru_hwaddr;
+ short int ifru_flags;
+ int ifru_ivalue;
+ int ifru_mtu;
+ struct ifmap ifru_map;
+ char ifru_slave[IFNAMSIZ];
+ char ifru_newname[IFNAMSIZ];
+ char *ifru_data;
+ } ifr_ifru;
};
+#define ifr_name ifr_ifrn.ifrn_name
+#define ifr_hwaddr ifr_ifru.ifru_hwaddr
+#define ifr_addr ifr_ifru.ifru_addr
+#define ifr_dstaddr ifr_ifru.ifru_dstaddr
+#define ifr_broadaddr ifr_ifru.ifru_broadaddr
+#define ifr_netmask ifr_ifru.ifru_netmask
+#define ifr_flags ifr_ifru.ifru_flags
+#define ifr_metric ifr_ifru.ifru_ivalue
+#define ifr_mtu ifr_ifru.ifru_mtu
+#define ifr_map ifr_ifru.ifru_map
+#define ifr_slave ifr_ifru.ifru_slave
+#define ifr_data ifr_ifru.ifru_data
+#define ifr_ifindex ifr_ifru.ifru_ivalue
+#define ifr_bandwidth ifr_ifru.ifru_ivalue
+#define ifr_qlen ifr_ifru.ifru_ivalue
+#define ifr_newname ifr_ifru.ifru_newname
+
struct ifconf {
int ifc_len;
union {
