public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] Can I switch from DHCP mode to STATIC IP mode during run time to  attain IP
@ 2005-10-28  6:18 JUFAIL KAPOOR
  2005-10-28  7:41 ` Andrew Lunn
  0 siblings, 1 reply; 3+ messages in thread
From: JUFAIL KAPOOR @ 2005-10-28  6:18 UTC (permalink / raw)
  To: 'ecos-discuss@ecos.sourceware.org'


Hi
Please help me to clarify my doubts.
I had read that we can configure ecos to attain IP either by DHCP/BOOTP or
by statically by specifying through configuration tool.

Can i change the mode from DHCP/BOOTP to Static mode uring run time.

My requirement is during runtime I want to Configure the interface to a
static IP, but at the same time I may need to switch back to DHCP also(vise
versa also). Does ecos supports this switching?.

Thank you.





---------------------------------------------------------------------------
       "This e-mail and any files transmitted with it are for the sole use
of the intended recipient(s) and may contain confidential and privileged
information. If you are not the intended recipient, please contact the
sender by reply e-mail and destroy all copies of the original message.

       Any unauthorized review, use, disclosure, dissemination, forwarding,
printing or copying of this email or any action taken upon this e-mail is
strictly prohibited and may be unlawful."
---------------------------------------------------------------------------

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ECOS] Can I switch from DHCP mode to STATIC IP mode during run time to attain IP
  2005-10-28  6:18 [ECOS] Can I switch from DHCP mode to STATIC IP mode during run time to attain IP JUFAIL KAPOOR
@ 2005-10-28  7:41 ` Andrew Lunn
  2005-10-28 15:30   ` [ECOS] " Grant Edwards
  0 siblings, 1 reply; 3+ messages in thread
From: Andrew Lunn @ 2005-10-28  7:41 UTC (permalink / raw)
  To: JUFAIL KAPOOR; +Cc: 'ecos-discuss@ecos.sourceware.org'

On Fri, Oct 28, 2005 at 11:48:16AM +0530, JUFAIL KAPOOR wrote:
> 
> Hi
> Please help me to clarify my doubts.
> I had read that we can configure ecos to attain IP either by DHCP/BOOTP or
> by statically by specifying through configuration tool.
> 
> Can i change the mode from DHCP/BOOTP to Static mode uring run time.
> 
> My requirement is during runtime I want to Configure the interface to a
> static IP, but at the same time I may need to switch back to DHCP also(vise
> versa also). Does ecos supports this switching?.

Looking at the source code is the easiest way to answer this question.

Currently there is no clean way to stop the DHCP client. But it looks
very easy for you to add this functionality. You need to extend
dhcp_mgt_entry() in dhcp_support.c to allow you to break the thread
out and exit. Once the thread is dead you can then call init_net with
a bootp record you create using your static IP addresses.

        Andrew

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 3+ messages in thread

* [ECOS] Re: Can I switch from DHCP mode to STATIC IP mode during run time to attain IP
  2005-10-28  7:41 ` Andrew Lunn
@ 2005-10-28 15:30   ` Grant Edwards
  0 siblings, 0 replies; 3+ messages in thread
From: Grant Edwards @ 2005-10-28 15:30 UTC (permalink / raw)
  To: ecos-discuss

In gmane.os.ecos.general, you wrote:

>> Can i change the mode from DHCP/BOOTP to Static mode uring run time.
>> 
>> My requirement is during runtime I want to Configure the
>> interface to a static IP, but at the same time I may need to
>> switch back to DHCP also(vise versa also). Does ecos supports
>> this switching?.

If you're allowed to re-boot when the mode is changed, it's
trivial.

> Looking at the source code is the easiest way to answer this
> question.
>
> Currently there is no clean way to stop the DHCP client. But
> it looks very easy for you to add this functionality. You need
> to extend dhcp_mgt_entry() in dhcp_support.c to allow you to
> break the thread out and exit. Once the thread is dead you can
> then call init_net with a bootp record you create using your
> static IP addresses.

Yup, that should work.  When I did a product that could use
either DHCP or a static address, I started out by doing the
easiest thing: The configuration is only checked at boot-time.
I either start the DHCP client or I configure the network stack
statically.  

This means that when you change the IP address configuration
(either DHCP<->static or change the static address) it doesn't
take effect until the device is restarted. Nobody has ever
complained about the restart requirement.  But, the devices in
question are typically set up once and then just left alone.

-- 
Grant Edwards                   grante             Yow!  Now KEN is having
                                  at               a MENTAL CRISIS beacuse
                               visi.com            his "R.V." PAYMENTS are
                                                   OVER-DUE!!

-- 
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2005-10-28 15:30 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-10-28  6:18 [ECOS] Can I switch from DHCP mode to STATIC IP mode during run time to attain IP JUFAIL KAPOOR
2005-10-28  7:41 ` Andrew Lunn
2005-10-28 15:30   ` [ECOS] " Grant Edwards

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).