[Mono-list] how to get subnet mask for IPv4 address?

danieru samuraidanieru at gmail.com
Thu Jun 4 16:07:29 EDT 2009

My end objective is to obtain the local broadcast address for each network
interface on a system. I've been poking around a bit and it looks like the
best route is to obtain the IP address and it's respective subnet mask, and
calculate the broadcast address.  I've tried using
System.Net.NetworkInformation.UnicastIPAddressInformation.IPv4 to fetch the
subnet mask, but it's not implemented yet in the mono version that comes
with Ubuntu Jaunty. Maybe it's implemented in 2.4, but I'd really like my
app to work out of the box on Ubuntu.

Are there any other ways to obtain the subnet mask? Or is there a better way
to obtain the broadcast address for each network interface?

Thanks for any help!
View this message in context: http://www.nabble.com/how-to-get-subnet-mask-for-IPv4-address--tp23876834p23876834.html
Sent from the Mono - General mailing list archive at Nabble.com.

More information about the Mono-list mailing list