Results 1 to 2 of 2
Hi,
I want to read network configuration paramters like IP, Gateway and DNS from my C code.
Should I read the config file /etc/resolv.conf or Is there any "structure" which ...
- 02-08-2010 #1Just Joined!
- Join Date
- Feb 2008
- Posts
- 50
Reading network Config Paramters
Hi,
I want to read network configuration paramters like IP, Gateway and DNS from my C code.
Should I read the config file /etc/resolv.conf or Is there any "structure" which gives the current network configuration parameter values.
Please suggest.
- 02-08-2010 #2
I would recommend just using `ifconfig` and using `grep`or a simple Perl script to process the output. You could also use the "regex.h" header file but I've never used it myself.
If you'd like, I'd be willing to write a Perl script for you that does this.


Reply With Quote
