Prev: Off topic: Humor from the Linux manpages
Next: FC12 install gives init3, no Gnome, no network???
From: J.H.Kim on 19 Feb 2010 07:55 Hi, everyone I'm using linux in embedded system. I set the ip address using Kernel's ip auto configuration via u-boot boot parameter. But I have to change the ip address in user application program. How can an user application change the ip address and mac address? Please tell the hint. Thanks in advance. Best Regards, J.Hwan Kim
From: Philipp Pagel on 19 Feb 2010 09:02 J.H.Kim <frog1120(a)gmail.com> wrote: > Hi, everyone > I'm using linux in embedded system. > I set the ip address using Kernel's ip auto configuration via u-boot > boot parameter. > But I have to change the ip address in user application program. > How can an user application change the ip address and mac address? I have no clue about embedded LINUX but on a regular Linux system ifconfig would do the job. cu Philipp -- Dr. Philipp Pagel Lehrstuhl f. Genomorientierte Bioinformatik Technische Universit�t M�nchen http://webclu.bio.wzw.tum.de/~pagel/
From: Maxwell Lol on 19 Feb 2010 23:08 "J.H.Kim" <frog1120(a)gmail.com> writes: > Hi, everyone > > I'm using linux in embedded system. > I set the ip address using Kernel's ip auto configuration via u-boot > boot parameter. > But I have to change the ip address in user application program. > How can an user application change the ip address and mac address? > Please tell the hint. you can always execute a shell command from C.
From: The Natural Philosopher on 20 Feb 2010 05:25 Maxwell Lol wrote: > "J.H.Kim" <frog1120(a)gmail.com> writes: > >> Hi, everyone >> >> I'm using linux in embedded system. >> I set the ip address using Kernel's ip auto configuration via u-boot >> boot parameter. >> But I have to change the ip address in user application program. >> How can an user application change the ip address and mac address? >> Please tell the hint. > > you can always execute a shell command from C. > well that wont work without some kind of root permissions. http://en.wikipedia.org/wiki/Setuid basically. make ipconfig effectively root.
From: Grant Edwards on 20 Feb 2010 11:39 On 2010-02-19, J.H.Kim <frog1120(a)gmail.com> wrote: > Hi, everyone > > But I have to change the ip address in user application program. Use ioctl() with SIOCSIFADDR. If you need more details, I suggest you look at the source for ifconfig. > How can an user application change the ip address and mac address? You use SIOCGIFHWADDR to read the MAC addres, but IIRC, setting the MAC address is board-specific. -- Grant
|
Next
|
Last
Pages: 1 2 Prev: Off topic: Humor from the Linux manpages Next: FC12 install gives init3, no Gnome, no network??? |