Board index » cppbuilder » How to get the configured subnet mask for this machine?
Mike Knoblock
![]() CBuilder Developer |
Mike Knoblock
![]() CBuilder Developer |
How to get the configured subnet mask for this machine?2006-04-13 05:41:53 AM cppbuilder39 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 |
JF Jolin
![]() CBuilder Developer |
2006-04-13 07:03:38 AM
Re:How to get the configured subnet mask for this machine?
12 Apr 2006 14:41:53 -0700, Mike Knoblock < XXXX@XXXXX.COM >wrote:
QuoteAnyone know how to use WINAPI to retrieve the subnet mask for a given interface? QuoteI can programmatically retrieve a list of IP addresses with gethostbyname, |
Mike Knoblock
![]() CBuilder Developer |
2006-04-13 07:13:13 AM
Re:How to get the configured subnet mask for this machine?
I looked; I swear!
Thanks!! JF Jolin wrote: Quote12 Apr 2006 14:41:53 -0700, Mike Knoblock < XXXX@XXXXX.COM >wrote: {smallsort} |
Remy Lebeau (TeamB)
![]() CBuilder Developer |
2006-04-13 08:59:13 AM
Re:How to get the configured subnet mask for this machine?
"Mike Knoblock" < XXXX@XXXXX.COM >wrote in message
QuoteAnyone know how to use WINAPI to retrieve the subnet mask 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. QuoteI can programmatically retrieve a list of IP addresses with |