🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

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

Re: How to get the configured subnet mask for this machine?

#2455
From: JF Jolin
Date: Wed, 12 Apr 2006 23:03
16 lines
1498 bytes
12 Apr 2006 14:41:53 -0700, Mike Knoblock <mknoblock@gmail.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.


-- 
JF Jolin
Technical Details
Message-ID: <ops7w3ocouz6rw7b@newsgroups.borland.com>
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail
References: <443d7421$1@newsgroups.borland.com>

Show Full Headers
Complete Article Headers
X-Google-Thread: 11508e,2192634693d412d8
X-Google-Attributes: gid11508e,public
X-Google-Language: ENGLISH,ASCII-7-bit
Newsgroups: borland.public.cppbuilder.internet.socket
Subject: Re: How to get the configured subnet mask for this machine?
References: <443d7421$1@newsgroups.borland.com>
Message-ID: <ops7w3ocouz6rw7b@newsgroups.borland.com>
Content-Type: text/plain; charset=iso-8859-15; format=flowed
From: JF Jolin <jfj@nospam.com>
MIME-Version: 1.0
Date: Wed, 12 Apr 2006 19:03:38 -0400
User-Agent: Opera7.11/Win32 M2 build 2887
NNTP-Posting-Host: 66.158.146.254
X-Trace: newsgroups.borland.com 1144883047 66.158.146.254 (12 Apr 2006 16:04:07 -0700)
Lines: 16
Path: arc1-ca.pugleaf.net!g2news1.google.com!news3.google.com!border1.nntp.dca.giganews.com!nntp.giganews.com!newsfeed00.sul.t-online.de!newsfeed01.sul.t-online.de!t-online.de!newsgroups.borland.com!not-for-mail