This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Notes on static configuration of an eCos network inte
- To: Grant Edwards <grante at visi dot com>
- Subject: Re: [ECOS] Notes on static configuration of an eCos network inte
- From: Gary Thomas <gthomas at redhat dot com>
- Date: Mon, 17 Jul 2000 10:03:12 -0600 (MDT)
- Cc: ecos-discuss at sourceware dot cygnus dot com, Nick Barnes <Nick dot Barnes at pobox dot com>
On 17-Jul-2000 Grant Edwards wrote:
>
>> Notes on static configuration of an eCos network interface
>
>> The siaddr and giaddr fields of a BOOTP message are irrelevant to
>> configuring a network interface: they are used for talking to the
>> BOOTP server (e.g. for TFTPing a kernel).
>
> Aaargh. That's why my routing table isn't getting initialized.
>
>> init_net() should initialize the interface as follows:
>>
>> SIOCSIFADDR, yiaddr
>> SIOCSIFNETMASK, TAG_SUBNET_MASK
>> SIOCSIFBRDADDR, TAG_IP_BROADCAST
>> SIOCADDRT, 0, 0, TAG_GATEWAY
>
> Right now, I'm building a fake bootp record and passing it to
> init_net(). This seems to be way more work than it's worth
> (especially since it's not right), so I'm going to throw out
> all of the fake bootp stuff and just duplicate the code in
> net_init(), passing the right IP addresses in the ioctl() calls.
>
> It will end up being a lot smaller and simpler that way. Is
> there any reason I shouldn't do that?
The reason that init_net() is based on BOOTP now is for flexibility.
By having the numbers hard coded [somehow] in the routine, you loose
all of that.
I always vote for flexible; I've been bitten by "fixed" implementations
too many times in the past.
As for your pain:
* why do you think the current way of creating BOOTP data is more
work than coding the values directly?
* how is what you are using different than the code in "init_all_network..."
when non-BOOTP mode is selected?
* if things aren't working, ask for help. Nick [Barnes] seems to be
getting quite a lot [of feedback at least] by doing so.