使用libnet_open_link_interface获取网卡信息的问题i
struct libnet_link_int *l;
char ebuf[PCAP_ERRBUF_SIZE];
l = libnet_open_link_interface((char *)szNicName, ebuf);
if (!l)
{
return;
}
// get the interface info
unsigned long ulIP = htonl(l->g_Info->LocalIp);
unsigned long ulMask = htonl(l->g_Info->NetMask);
unsigned long ulGateway = htonl(l->g_Info->DefaultGateway);
为啥获取到的DefaultGateway永远是0?请各位高手指教,谢谢!