|
|
|
|
|
|
| Author |
Message |
Nils Koehler *nix forums beginner
Joined: 23 Feb 2005
Posts: 17
|
Posted: Thu Feb 17, 2005 7:37 am Post subject:
Change IP address through the application software with ElinOS embedded Linux compressed File system .
|
|
|
Hello,
We have an application running on Kontron Dimm-PC/Lite-IE whit embedded
Linux ELinOS.
We are working with a compressed rootfile system *.TGZ
To change the IP address we need to generate every time a new compressed
file system,with
the right IP address inside. We are looking for a solution how to change the
IP address through
our application, to make it easyer to change the IP address
I will be happy if anybody has a hint for us.
Kindest Regards
Nils Koehler
--
-----------------------------------------------
Nils Köhler
IBT Interfaces
Im Taubhaus 19
63322 Rödermark
Germany
Tel: +49-6074-6964-160
Fax: +49-6074-6964-161 |
|
| Back to top |
|
 |
Michael Schnell *nix forums Guru Wannabe
Joined: 21 Feb 2005
Posts: 110
|
Posted: Thu Feb 17, 2005 9:45 am Post subject:
Re: Change IP address through the application software with ElinOS embedded Linux compressed File system .
|
|
|
If the host network supports this, of course DHCP is the easiest way to
provide an appropriate IP address to an embedded box.
Additional Hardware could be used: a serial flash or dip switches.
Maybe the Dimm-PC has a CMOS RAM or a parameter Flash for the BIOS. Here
some bytes might be available.
You _could_ put the information in the BIOS code FLASH (if this is a
separate device) but who would dare to recommend this ?
Additional to the compressed file system, the Linux boot information
contains the Kernel command line. Supposedly it's easier to change this
than the internals of a compressed file. I don't know how to request
information off the Kernel command line from a user land program, but I
do believe that this is possible, at least when writing a device driver
for that purpose.
You could reserve an additional section in the flash Linux boots from
and access same directly (e.g. as a memory location) with a device driver.
-Michael |
|
| Back to top |
|
 |
Robert Kaiser *nix forums beginner
Joined: 22 Feb 2005
Posts: 34
|
Posted: Thu Feb 17, 2005 12:37 pm Post subject:
Re: Change IP address through the application software with ElinOS embedded Linux compressed File system .
|
|
|
In article <999ee2-f07.ln1@viruswall.lumino.de>,
Michael Schnell <mschnell_at_lumino_dot_de@hotmail.com> writes:
| Quote: | I don't know how to request
information off the Kernel command line from a user land program, but I
do believe that this is possible, at least when writing a device driver
for that purpose.
|
cat /proc/cmdline
:-)
Rob
--
Robert Kaiser email: rkaiser AT sysgo DOT com
SYSGO AG http://www.elinos.com
Klein-Winternheim / Germany http://www.sysgo.com |
|
| Back to top |
|
 |
Nils Koehler *nix forums beginner
Joined: 23 Feb 2005
Posts: 17
|
Posted: Thu Feb 17, 2005 12:45 pm Post subject:
Re: Change IP address through the application software with ElinOS embedded Linux compressed File system .
|
|
|
Hi Michael,
Thank you for your answer,
it is not our problem to store the IP address on the target, we have allot
of disk space.
DHCP is a good idea but our customer don't allow DHCP on his Network.
What we need to do is to change the ip address thought our software.
Ore there is any possibility by system commands I don't know?
But thanks for your time
"Michael Schnell" <mschnell_at_lumino_dot_de@hotmail.com> schrieb im
Newsbeitrag news:999ee2-f07.ln1@viruswall.lumino.de...
| Quote: | If the host network supports this, of course DHCP is the easiest way to
provide an appropriate IP address to an embedded box.
Additional Hardware could be used: a serial flash or dip switches.
Maybe the Dimm-PC has a CMOS RAM or a parameter Flash for the BIOS. Here
some bytes might be available.
You _could_ put the information in the BIOS code FLASH (if this is a
separate device) but who would dare to recommend this ?
Additional to the compressed file system, the Linux boot information
contains the Kernel command line. Supposedly it's easier to change this
than the internals of a compressed file. I don't know how to request
information off the Kernel command line from a user land program, but I
do believe that this is possible, at least when writing a device driver
for that purpose.
You could reserve an additional section in the flash Linux boots from
and access same directly (e.g. as a memory location) with a device driver.
-Michael |
|
|
| Back to top |
|
 |
Nils Koehler *nix forums beginner
Joined: 23 Feb 2005
Posts: 17
|
Posted: Thu Feb 17, 2005 1:13 pm Post subject:
Re: Change IP address through the application software with ElinOS embedded Linux compressed File system .
|
|
|
Hi Rob,
with cat /proc/cmdline
I saw our onfiguration including the actual IP address, but how can I change
and activate it without booting?
Nils
thank you for the cat /proc/cmdline
"Robert Kaiser" <rob@localhost.net> schrieb im Newsbeitrag
news:cv26mb$evp$02$4@news.t-online.com...
| Quote: | In article <999ee2-f07.ln1@viruswall.lumino.de>,
Michael Schnell <mschnell_at_lumino_dot_de@hotmail.com> writes:
I don't know how to request
information off the Kernel command line from a user land program, but I
do believe that this is possible, at least when writing a device driver
for that purpose.
cat /proc/cmdline
:-)
Rob
--
Robert Kaiser email: rkaiser AT sysgo DOT com
SYSGO AG http://www.elinos.com
Klein-Winternheim / Germany http://www.sysgo.com |
|
|
| Back to top |
|
 |
Juergen Querengaesser *nix forums beginner
Joined: 05 Jul 2005
Posts: 5
|
Posted: Thu Feb 17, 2005 2:29 pm Post subject:
Re: Change IP address through the application software with ElinOS embedded Linux compressed File system .
|
|
|
Nils Koehler wrote:
| Quote: | Hello,
We have an application running on Kontron Dimm-PC/Lite-IE whit embedded
Linux ELinOS.
We are working with a compressed rootfile system *.TGZ
To change the IP address we need to generate every time a new compressed
file system,with
the right IP address inside. We are looking for a solution how to change
the IP address through
our application, to make it easyer to change the IP address
I will be happy if anybody has a hint for us.
Kindest Regards
Nils Koehler
|
Hi Nils Koehler,
I make it in this way (You know the IP-address in cIPAdr, the netmask in
cNetmask and maybe the default gateway in cGateWay):
-------------
#include <stdlib.h>
....
char cmd[128];
sprintf(cmd, "/sbin/ifconfig eth0 %s", cIPAdr);
system(cmd);
sprintf(cmd, "/sbin/ifconfig eth0 netmask %s", cNetmask);
system(cmd);
sprintf(cmd, "/sbin/route add default gw %s", cGateWay);
system(cmd);
--------------
Hope this helps you,
Juergen |
|
| Back to top |
|
 |
Michael Schnell *nix forums Guru Wannabe
Joined: 21 Feb 2005
Posts: 110
|
Posted: Thu Feb 17, 2005 2:51 pm Post subject:
Re: Change IP address through the application software with ElinOS embedded Linux compressed File system .
|
|
|
| Quote: |
DHCP is a good idea but our customer don't allow DHCP on his Network.
|
silly
| Quote: |
What we need to do is to change the ip address thought our software.
|
the ifconfig command.
Of course there also is an API call that is encapsulated in the standard
library. Supposedly "man ifconfig" gives all necessary information.
-Michael |
|
| Back to top |
|
 |
Nils Koehler *nix forums beginner
Joined: 23 Feb 2005
Posts: 17
|
Posted: Thu Feb 17, 2005 3:34 pm Post subject:
Re: Change IP address through the application software with ElinOS embedded Linux compressed File system .
|
|
|
Thank you,
IT WORKS )
"Jürgen Querengässer" <msg1000@web.de> schrieb im Newsbeitrag
news:37jriqF5eu1a1U1@individual.net...
| Quote: | Nils Koehler wrote:
Hello,
We have an application running on Kontron Dimm-PC/Lite-IE whit embedded
Linux ELinOS.
We are working with a compressed rootfile system *.TGZ
To change the IP address we need to generate every time a new compressed
file system,with
the right IP address inside. We are looking for a solution how to change
the IP address through
our application, to make it easyer to change the IP address
I will be happy if anybody has a hint for us.
Kindest Regards
Nils Koehler
Hi Nils Koehler,
I make it in this way (You know the IP-address in cIPAdr, the netmask in
cNetmask and maybe the default gateway in cGateWay):
-------------
#include <stdlib.h
...
char cmd[128];
sprintf(cmd, "/sbin/ifconfig eth0 %s", cIPAdr);
system(cmd);
sprintf(cmd, "/sbin/ifconfig eth0 netmask %s", cNetmask);
system(cmd);
sprintf(cmd, "/sbin/route add default gw %s", cGateWay);
system(cmd);
--------------
Hope this helps you,
Juergen |
|
|
| Back to top |
|
 |
Google
|
|
| Back to top |
|
 |
|
|
The time now is Fri Jan 09, 2009 8:05 am | All times are GMT
|
|
Debt Consolidation | Libro de autoayuda | Loans | Buy Anything On eBay | Overstock Coupons
|
|
Copyright © 2004-2005 DeniX Solutions SRL
|
|
|
|
Other DeniX Solutions sites:
Unix/Linux blog |
electronics forum |
medicine forum |
science forum |
|
|
Privacy Policy
|
Powered by phpBB © 2001, 2005 phpBB Group
|
|