🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: borland.public.cppbuilder.internet.socket
Article #2453

How to get the configured subnet mask for this machine?

#2453
From: Mike Knoblock
Date: Wed, 12 Apr 2006 21:41
11 lines
1300 bytes
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
Technical Details
Message-ID: <443d7421$1@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news2.euro.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,2192634693d412d8,start
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
Date: Wed, 12 Apr 2006 14:41:53 -0700
From: Mike Knoblock <mknoblock@gmail.com>
User-Agent: Thunderbird 1.5 (Windows/20051201)
MIME-Version: 1.0
Newsgroups: borland.public.cppbuilder.internet.socket
Subject: How to get the configured subnet mask for this machine?
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
NNTP-Posting-Host: 4.36.224.14
Message-ID: <443d7421$1@newsgroups.borland.com>
X-Trace: newsgroups.borland.com 1144878113 4.36.224.14 (12 Apr 2006 14:41:53 -0700)
Lines: 11
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!news.glorb.com!news2.euro.net!newsfeed.freenet.de!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail