[Winpcap-users] How can I get the IP address ofgatewaythroughWinPcap

Tony Yang minsavage at gmail.com
Sat Jul 21 11:33:52 GMT 2007


i get the mac address by means of  GetAdaptersInfo through studying the
example of WiinPcap.
But can you tell me how to do it for geting the ip of gateway.
thank you


On 7/21/07, Steighton_Haley at mcafee.com <Steighton_Haley at mcafee.com> wrote:
>
>  What he is saying is that you acknowledge that what you are doing is not
> a good way of doing it.
>
> You could use the function GetAdaptersInfo which gives you information
> about the adapter, all of it's IP address, and all of it's gateway
> information.
>
> Try that instead of this writing to a file kludge.
>
>
> ---
> Steighton Haley                          shaley at mcafee.com
> Software Engineer
>
> "In the beginning was the word.
> But by the time the second word was added to it, There was trouble.
> For with it came syntax ..."
>                 -- John Simon
>
>
>  ------------------------------
> *From:* winpcap-users-bounces at winpcap.org [mailto:
> winpcap-users-bounces at winpcap.org] *On Behalf Of *Tony Yang
> *Sent:* Friday, July 20, 2007 10:01 AM
> *To:* winpcap-users at winpcap.org
> *Subject:* Re: [Winpcap-users] How can I get the IP address
> ofgatewaythroughWinPcap
>
>
>  sorry fo my poor english
>
> "what's the big deal in using the IP helper API instead of these tricks of
> calling an external application and parse its output?"
>
> can u explain your words from which last email?
> i do not comprehend it
>
>
> On 7/21/07, Gianluca Varenni <gianluca.varenni at cacetech.com> wrote:
> >
> >  Uhm, out of curiosity, what's the big deal in using the IP helper API
> > instead of these tricks of calling an external application and parse its
> > output?
> >
> > Have a nice day
> > GV
> >
> >
> >
> >
> > ----- Original Message -----
> > *From:* Tony Yang <minsavage at gmail.com>
> > *To:* winpcap-users at winpcap.org
> >  *Sent:* Friday, July 20, 2007 8:41 AM
> > *Subject:* Re: [Winpcap-users] How can I get the IP address of
> > gatewaythroughWinPcap
> >
> >
> > 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
> > >
> >
> >  ------------------------------
> >
> > _______________________________________________
> > 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/20070721/a2a45084/attachment-0001.htm


More information about the Winpcap-users mailing list