On Fri, May 16, 2008 at 5:11 AM, Vardhan, Sundara (GE Infra, Energy) <sundara.vardhan@xxxxxx> wrote: > Hi All > > Is there any way to access netmask given the IP address from within c program. I have an ip address for which I need to get the netmask and broadcast addresses and also set route for them. Your help will be greatly appreciated. > > With Regards > > Vardhan > If you have access to the machine you could run ifconfig and parse the output.