Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 1 Jun 2007 17:38:35 -0600
From:      John E Hein <jhein@timing.com>
To:        bsenthil <bsenthil@adventnet.com>
Cc:        freebsd-questions@freebsd.org
Subject:   Re: get/set  ifconfig entries through by programmatically
Message-ID:  <18016.44539.641157.324860@gromit.timing.com>
In-Reply-To: <46607E95.4030409@adventnet.com>
References:  <46607E95.4030409@adventnet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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 1.2.3.4/24");

[cross-post to embedded@freebsd.org removed]



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?18016.44539.641157.324860>