niXforums Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   PreferencesPreferences   Log in to check your private messagesLog in to check your private messages   Log inLog in 
·  nixdoc.net ·  man pages ·  Linux HOWTOs ·  FreeBSD Tips ·  Forums
navigation Forum index » *nix » Linux » embedded
Change IP address through the application software with ElinOS embedded Linux compressed File system .
Post new topic   Reply to topic Page 1 of 1 [8 Posts] View previous topic :: View next topic
Author Message
Nils Koehler
*nix forums beginner


Joined: 23 Feb 2005
Posts: 17

PostPosted: Thu Feb 17, 2005 7:37 am    Post subject: Change IP address through the application software with ElinOS embedded Linux compressed File system . Reply with 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



--
-----------------------------------------------
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

PostPosted: Thu Feb 17, 2005 9:45 am    Post subject: Re: Change IP address through the application software with ElinOS embedded Linux compressed File system . Reply with 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
Robert Kaiser
*nix forums beginner


Joined: 22 Feb 2005
Posts: 34

PostPosted: Thu Feb 17, 2005 12:37 pm    Post subject: Re: Change IP address through the application software with ElinOS embedded Linux compressed File system . Reply with quote

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

PostPosted: Thu Feb 17, 2005 12:45 pm    Post subject: Re: Change IP address through the application software with ElinOS embedded Linux compressed File system . Reply with quote

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

PostPosted: Thu Feb 17, 2005 1:13 pm    Post subject: Re: Change IP address through the application software with ElinOS embedded Linux compressed File system . Reply with quote

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

PostPosted: Thu Feb 17, 2005 2:29 pm    Post subject: Re: Change IP address through the application software with ElinOS embedded Linux compressed File system . Reply with quote

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

PostPosted: Thu Feb 17, 2005 2:51 pm    Post subject: Re: Change IP address through the application software with ElinOS embedded Linux compressed File system . Reply with quote

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

PostPosted: Thu Feb 17, 2005 3:34 pm    Post subject: Re: Change IP address through the application software with ElinOS embedded Linux compressed File system . Reply with quote

Thank you,

IT WORKS Smile)



"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
Display posts from previous:   
Post new topic   Reply to topic Page 1 of 1 [8 Posts] View previous topic :: View next topic
The time now is Fri Jan 09, 2009 8:05 am | All times are GMT
navigation Forum index » *nix » Linux » embedded
Jump to:  

Similar Topics
Topic Author Forum Replies Last Post
No new posts Postfix ldap and Rewriting sender email address endfx Postfix 2 Thu Apr 17, 2008 9:34 pm
No new posts recipient address restriction 3dd13 Postfix 0 Wed Mar 26, 2008 1:46 pm
No new posts Help required for configuring the VPN Server in Linux SHERDIL security 0 Sun Nov 19, 2006 2:22 pm
No new posts Running php file everyday on scheduled time sachin PHP 1 Fri Jul 21, 2006 12:49 pm
No new posts Bug#379104: ITP: complearn-mpi -- parallel quartet tree s... Rudi Cilibrasi devel 0 Fri Jul 21, 2006 11:30 am

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
[ Time: 0.2517s ][ Queries: 16 (0.1580s) ][ GZIP on - Debug on ]