This is the mail archive of the ecos-discuss@sources.redhat.com mailing list for the eCos project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: Notes on static configuration of an eCos network inte



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

The numbers aren't hard-coded.  I have a structure that
contains the ip address, subnet mask, and default gateway. This
data was constructed by my boot loader code.

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

Perhaps I've misjudged, but at first glance it looked like
constructing a fake bootp frame and then parsing it is more
work than making the ioctl calls directly -- and then I don't
need to keep the routines to first assemble then dissassemble a
bootp frame (not that they're very big, but a few K here and
there add up).

>  * how is what you are using different than the code in "init_all_network..."
>    when non-BOOTP mode is selected?

It isn't. The code I'm using is mostly copied from
init_all_network and build_bootp_record. It looks like
build_bootp_record and init_all_network_interfaces don't
configure the default route based on the gateway address passed
to build_bootp_record().

>  * if things aren't working, ask for help.  Nick [Barnes] seems to be
>    getting quite a lot [of feedback at least] by doing so.

I realized that the routing wasn't working this morning.  By
the time I realized something was wrong, Nick had already
pointed out what it was (he must have borrowed Guido van
Rossum's time machine).

-- 
Grant Edwards
grante@visi.com

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]