get/set ifconfig entries through by programmatically

M. Warner Losh imp at bsdimp.com
Fri Jun 1 20:56:31 UTC 2007


In message: <46607E95.4030409 at adventnet.com>
            bsenthil <bsenthil at adventnet.com> writes:
: 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" .

To get the addresses, use the ifconfig-in-a-box interface
getifaddrs(3).  To set the address, you'll need to use the functions
described in networking(4), specifically the SIOCAIFADDR and
SIOCDIFADDR ioctls.

Warner


More information about the freebsd-questions mailing list