BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

How to get the configured subnet mask for this machine?

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Internet Socket)
View previous topic :: View next topic  
Author Message
Mike Knoblock
Guest





PostPosted: Wed Apr 12, 2006 11:03 pm    Post subject: How to get the configured subnet mask for this machine? Reply with quote



Anyone know how to use WINAPI to retrieve the subnet mask for a given
interface? I can programmatically retrieve a list of IP addresses with
gethostbyname, but this doesn't deal with configured subnets.

What's behind all this is I need an application to send a subnet
broadcast message on startup to find other instances of itself. Running
IPCONFIG from a shell is messy, and I can't find anything on MSDN.

TIA

Mike
Back to top
Mike Knoblock
Guest





PostPosted: Thu Apr 13, 2006 1:03 am    Post subject: Re: How to get the configured subnet mask for this machine? Reply with quote



I looked; I swear!

Thanks!!


JF Jolin wrote:
Quote:
12 Apr 2006 14:41:53 -0700, Mike Knoblock <mknoblock (AT) gmail (DOT) com> wrote:

Anyone know how to use WINAPI to retrieve the subnet mask for a given
interface?

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iphlp/iphlp/getadaptersinfo.asp


I can programmatically retrieve a list of IP addresses with
gethostbyname,
but this doesn't deal with configured subnets.

What's behind all this is I need an application to send a subnet
broadcast message
on startup to find other instances of itself. Running IPCONFIG from a
shell is messy,
and I can't find anything on MSDN.

Back to top
JF Jolin
Guest





PostPosted: Thu Apr 13, 2006 1:03 am    Post subject: Re: How to get the configured subnet mask for this machine? Reply with quote



12 Apr 2006 14:41:53 -0700, Mike Knoblock <mknoblock (AT) gmail (DOT) com> wrote:

Quote:
Anyone know how to use WINAPI to retrieve the subnet mask for a given interface?

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/iphlp/iphlp/getadaptersinfo.asp

Quote:
I can programmatically retrieve a list of IP addresses with gethostbyname,
but this doesn't deal with configured subnets.

What's behind all this is I need an application to send a subnet broadcast message
on startup to find other instances of itself. Running IPCONFIG from a shell is messy,
and I can't find anything on MSDN.


--
JF Jolin
Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Thu Apr 13, 2006 2:03 am    Post subject: Re: How to get the configured subnet mask for this machine? Reply with quote

"Mike Knoblock" <mknoblock (AT) gmail (DOT) com> wrote in message
news:443d7421$1 (AT) newsgroups (DOT) borland.com...

Quote:
Anyone know how to use WINAPI to retrieve the subnet mask
for a given interface?

Look at the GetAdaptersInfo() function in the IPHLR API:

GetAdaptersInfo
http://msdn.microsoft.com/library/en-us/iphlp/iphlp/getadaptersinfo.asp

The IP_ADAPTER_INFO structure has several members that deal with IP
addresses and masks. They are all of type IP_ADDR_STRING, which has an
IpMask member.

Quote:
I can programmatically retrieve a list of IP addresses with
gethostbyname, but this doesn't deal with configured subnets.

There is nothing in the WinSock API for what you ask.


Gambit
Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Internet Socket) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.