Article View: borland.public.cppbuilder.nativeapi
Article #6155Re: get ip behind dchp
From: Remy Lebeau (TeamB)
Date: Mon, 06 Jun 2005 19:09
Date: Mon, 06 Jun 2005 19:09
22 lines
1849 bytes
1849 bytes
"Alan Bellingham" <alanb@episys.com> wrote in message
news:v859a1d4nhkdube160utpa5lhhu4ism5vc@4ax.com...
> Interesting. My reading was that he _did_ know the IP address, but
> wanted to know if that IP address was fixed, or was from DHCP.
If that is the case, gethostbyaddr() still won't help. If an IP is
assigned, valid host information will still be returned regardless of
whether the IP came from DHCP or not, and that host information will not say
anything about where the IP came from. Nick will have to query the OS for
the ethernet card's actual properties and see if a DHCP server is assigned
to the card or not. He can use GetAdpatersInfo() for that:
GetAdaptersInfo()
http://msdn.microsoft.com/library/en-us/iphlp/iphlp/getadaptersinfo.asp
The IP_ADAPTER_INFO structure has DhcpEnabled and DhcpServer members
available.
Gambit
Technical Details
Message-ID:
<42a49f31$1@newsgroups.borland.com>Path:
arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mailReferences:
<42a42712@newsgroups.borland.com> <42a444c7$1@newsgroups.borland.com> <42a4837a$1@newsgroups.borland.com> <v859a1d4nhkdube160utpa5lhhu4ism5vc@4ax.com>Show Full Headers
Complete Article Headers
X-Google-Thread: 10cc67,9c6ff63c205cc16d X-Google-Attributes: gid10cc67,public X-Google-Language: ENGLISH,ASCII-7-bit From: "Remy Lebeau \(TeamB\)" <no.spam@no.spam.com> Newsgroups: borland.public.cppbuilder.nativeapi References: <42a42712@newsgroups.borland.com> <42a444c7$1@newsgroups.borland.com> <42a4837a$1@newsgroups.borland.com> <v859a1d4nhkdube160utpa5lhhu4ism5vc@4ax.com> Subject: Re: get ip behind dchp Date: Mon, 6 Jun 2005 12:09:04 -0700 Lines: 24 X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2800.1409 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409 NNTP-Posting-Host: 68.69.17.41 Message-ID: <42a49f31$1@newsgroups.borland.com> X-Trace: newsgroups.borland.com 1118084913 68.69.17.41 (6 Jun 2005 12:08:33 -0700) Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news-out.nntp.be!propagator2-sterling.newsfeeds.com!in.nntp.be!caladan.landsraad.net!newsgroups.borland.com!not-for-mail