Hi,

Could someone give me an example of how to get and display the selected 
network adapter's IP address?  I have to be doing something wrong 
somewhere...  here's what I'm doing (psuedo-code)

    Options::device = AdapterDlg::GetAdapterName();
    int ret = pcap_lookupnet(Options::device, &(Options::ip), 
&(Options::netmask), error);

GetAdapterName returns a valid adapter (I'm able to capture packets via 
the name it returns, if nothing else), and everything is the appropriate 
type and seems like it wants to work, but the problem is that both the 
netmask and ip returned are backwards and don't include the last 
digit...  if IP was 192.168.0.1, it returns 0.0.168.192 (according to 
inet_ntoa) and I have to reverse it myself... but I must be doing 
something wrong?  It does this both on my LinkSys and RealTek cards.

I'm running XP Pro with the new 2.3 winpcap drivers (and not using 
packet.dll at all).  Any help would be appreciated.  The good thing 
though, the beta version was returning 0.0.0.0 for the realtek and I 
don't remember what for the linksys.

-Antyrg


Reply via email to