netmask access from a c program

Larry Martell larry.martell@gmail.com
Fri May 16 15:38:00 GMT 2008


On Fri, May 16, 2008 at 5:11 AM, Vardhan, Sundara (GE Infra, Energy)
<sundara.vardhan@ge.com> 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.



More information about the Gcc-help mailing list