On 6/13/07, wolfram <wolframarnold / gmail.com> wrote:
> I'm working on a Rails app that needs to restrict certain privileged
> operations/requests to only those requests that originate from within
> the local subnet.
>
> How can I find out the machine's netmask programmatically?

Hi,

what operating system? windows/linux(distribution?)/osx?
how many network adapters are in the machine?

on windows use `ipconfig /all` and parse output or WMI through Win32OLE
on unix `/sbin/ifconfig -a`

If there are more adapters, you have to choose the right one (or allow
all local nets).

J.