get/set ifconfig entries through by programmatically
John E Hein
jhein at timing.com
Sat Jun 2 00:16:37 UTC 2007
bsenthil wrote at 01:46 +0530 on Jun 2, 2007:
> Is it possible to get/set ifconfig entries through by programmatically.
> If yes, please send me the code snippet ...
> I am trying to get/set ipaddress by executing the command "ifconfig" .
- use SIOCAIFADDR ioctl; man netintro(4)
- see source code in /usr/src/sbin/ifconfig
- the hacky approach using system(3): system("ifconfig fxp0 126.96.36.199/24");
[cross-post to embedded at freebsd.org removed]
More information about the freebsd-questions