[ECOS] Re: RE : [ECOS] Sending ARP packets without PF_PACKET support

Andrew Lunn andrew@lunn.ch
Sat Nov 8 12:29:00 GMT 2003

On Fri, Nov 07, 2003 at 06:02:28PM +0100, S?bastien COURET wrote:
> Thanks for your quick answer,

No problem, but please don't send mail to me directly without it also
going to the list. Some people make a business out of giving support
for eCos.

> My goal is to port an open source  DHCP server (udhcp) to eCOS.
OK. Watch out for the licence. Its GPL, so you will have to make your
whole system GPL.

> But this server is issuing ARP request to check that the IP adress it's
> going to lease is not used in the network. 
> This is originaly done through the PF_PACKET API, that's why i'm seeking
> an alternative to obtain the same result on eCOS.
> (FreeBSD is now providing this API but eCOS don't ...)

Are you sure FreeBSD has PF_PACKET? I just grep'd the FreeBSD CVS from
today for F_PACKET and there was no match!

What you want to do is look at the portable routines for doing stuff
like this, libpcap etc. But this will probably mean you need bpf, but
eCos currently does not have either. Having said that, it should not
be too hard to add this back since its a standard part of FreeBSD.

> By the way, do you know how to print routing tables and arp tables with
> eCOS ?
> Call to show_network_tables() is just blocking my application ... 

Have you debugged this at all. It has worked for me in the past. Where
does it block?

You sysctl code looks interesting. I want to try that out soon.


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

More information about the Ecos-discuss mailing list