#if __UAPI_DEF_IF_IFREQ struct ifreq { #define IFHWADDRLEN 6 union { char ifrn_name[IFNAMSIZ]; //网卡设备名:eth0,ens33等 } ifr_ifrn;
union { struct sockaddr ifru_addr; //ip地址 struct sockaddr ifru_dstaddr; //目标IP地址 struct sockaddr ifru_broadaddr; //广播地址 struct sockaddr ifru_netmask; //子网掩码 struct sockaddr ifru_hwaddr; //MAC地址 short ifru_flags; //网络接口标记 int ifru_ivalue; //请求不通含义不同 int ifru_mtu; //网卡地址映射 struct ifmap ifru_map; //最大传输单元 char ifru_slave[IFNAMSIZ]; //占位符 char ifru_newname[IFNAMSIZ];//新名称 void __user * ifru_data; //用户数据 struct if_settings ifru_settings; //设备协议设置 } ifr_ifru; }; #endif /* __UAPI_DEF_IF_IFREQ */