[Winpcap-users] How can I get the IP address of gateway throughWinPcap

Tony Yang minsavage at gmail.com
Fri Jul 20 15:41:38 GMT 2007


thank you
but i used the windows command "ipconfig /all " to obtaine the information
of gateway
then redirect the output to the file
i get the info through reading this file
although this is not a good way, i think that this is a available one.


On 7/20/07, he tao <hetaozju at gmail.com> wrote:
>
> Agreed. Also the ip of gateway can be read from registry
>
> [HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters\Interfaces\{64B3C6C6-A3C4-4293-AC98-5BF7C17B467D}]\DefaultGateway
> (DHCPDefaultGateway if dhcp enabled)
> {64B3C6C6-A3C4-4293-AC98-5BF7C17B467D} can be get by parsing the
> device name of pcap_t. I was doing like this because I don't want to
> download win platform sdk:-)
>
> On 7/20/07, Gianluca Varenni <gianluca.varenni at cacetech.com> wrote:
> >
> > Tony,
> >
> > there's no API in WinPcap to obtain the gateway of an interface. You
> > probably need to use the IP helper API to obtain such information. In
> > particular, I think you need to use the Win32 function GetAdaptersInfo.
> >
> > Hope it helps
> > GV
> >
> >
> > ----- Original Message -----
> >
> > From: Tony Yang
> > To: winpcap-users at winpcap.org
> > Sent: Monday, July 16, 2007 11:50 PM
> > Subject: [Winpcap-users] How can I get the IP address of gateway
> > throughWinPcap
> >
> > How can I get the IP address of gateway through WinPcap
> > thanks very much
> >
> > ________________________________
> >
> >
> > _______________________________________________
> > Winpcap-users mailing list
> > Winpcap-users at winpcap.org
> > https://www.winpcap.org/mailman/listinfo/winpcap-users
> >
> >
> >
> > _______________________________________________
> > Winpcap-users mailing list
> > Winpcap-users at winpcap.org
> > https://www.winpcap.org/mailman/listinfo/winpcap-users
> >
> >
> _______________________________________________
> Winpcap-users mailing list
> Winpcap-users at winpcap.org
> https://www.winpcap.org/mailman/listinfo/winpcap-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://www.winpcap.org/pipermail/winpcap-users/attachments/20070720/af059560/attachment.htm


More information about the Winpcap-users mailing list