This is the mail archive of the
ecos-discuss@sources.redhat.com
mailing list for the eCos project.
Re: Temporary IP address assignment trick
On Thu, Mar 20, 2003 at 03:45:46PM +0000, Jonathan Larmour wrote:
> > It's not RARP. RARP requires that the device broadcast a RARP
> > request and then a server replies to that request (much like
> > BOOTP).
>
> Yep.
>
> > The devices I'm playing with just sit there silently
> > and if they receive _any_ non-broadcast IP packet with their
> > MAC address, they'll accept the IP address as their own. It
> > can be an ICMP ping, a TCP SYN, anything.
>
> Sure, although you still need a cleverly set up server to do
> this anyway (_something_ has to be listening for unfamiliar
> addresses),
In scenario that my competitors use, there is no server.
Nobody is listening for anything from the device. A person sits
down at a Unix or Windows command prompt and types:
# arp -s <IpAddr> <EtherAddr>
# telnet <IpAddr>
Then the user configures the device via the above telnet
session with a stack IP address (or enables DHCP).
[Alternatively you can use a web browser instead of a telnet
client.]
> When the stack starts up "properly" it always does an ARP
> request for itself anyway, one of the reasons being to check
> there aren't conflicts with people with the same IP. It
> certainly means that you can't just bring the stack up
> completely unless you already have its IP address sorted out,
> so you can't let it work "transparently".
So there's no way to open a raw socket if the stack doesn't
have an IP address?
> Instead you would have to do the same intermediate sortof-up
> stage that BOOTP etc. does with an explicit phase to await an
> IP address. ether_demux() in if_ethersubr.c will certainly drop
> stuff unless the interface is up.
>
> I would think RARP would fit easier into the way the stack is now.
Probably, but RARP doesn't do what I want. RARP requires a
server to be setup and configured. If we're going to require
a server, then we might as well just use DHCP, since it's more
common than RARP these days.
What is wanted is a nice, simple, configuration process
involving no servers and one or two commands by the user.
>>>As for getting the stacks to do it - I'd have thought it would
>>>be pretty simple - you only need to change
>>>init_all_network_interfaces.
>>
>> Is there a way to tell the stack to receive and turn over to
>> the application any packet with a matching MAC address?
>
> _Any_ packet? Probably not right now AFAICT. Again have a look
> at ether_demux() (called from ether_input()), that's where the
> fun is and certainly where IP and ARP packets go their separate
> ways.
It sounds like what I'm talking about would require
stack-hacking and not simply an application level hack. I'll
have to look into it in my spare time.
--
Grant Edwards
grante at visi dot com
--
Before posting, please read the FAQ: http://sources.redhat.com/fom/ecos
and search the list archive: http://sources.redhat.com/ml/ecos-discuss