Praveen wrote:
> Hello,
> Can anybody tell me if there exists a way to programmatically change,
> retrieve the IP of a NIC and modifying the routes in Linux..
>
> I tried doing it with rtnetlink but since i din't get any good
> documentation on it other than man pages, have got stuck up.. any
> pointers to some good documentation on the same or some tutorials will
> be of gr8 help to me..
>
> Thanx in advance..
> -Praveen M Nair.
The ioctl system call is what you want. You need to open a socket and
call ioctl on the socket descriptior to issue the SIOCGIFADDR/
SIOCSIFADDR commands. These allow you to specify a data structure which
contains both an interface name and address to set or retrieve.
HTH
Neil
--
/************************************************** *
*Neil Horman
*Software Engineer
*Red Hat, Inc.,
http://people.redhat.com/nhorman
*gpg keyid: 1024D / 0x92A74FA1
*
http://www.keyserver.net
************************************************** */