[ECOS] raw sockets in bsd stack. . ..
dries
dries@irssystems.nl
Mon Aug 30 11:18:00 GMT 2004
Jörn Seger wrote :
> Hi Dries,
>
> Am Montag, 30. August 2004 20:39 schrieb dries:
> > I am trying to do raw-socket communication but the bsd networking stack
> > only supports raw IP-sockets. This means that an IP header is allways
> > prepended to the packet, i would like to send and receive real raw
> > packets. Is there anyway to receive and send 'real' raw packets without
> > modifying the network stack ..
>
> I would like to the same more or less.
> As far as I learned from this list and some webpages, there actually is no
> implementation on that in ecos. But there are some low level functions,
> which can do stuff like that, but look very different to standard open(),
> send(), receive() etc.
>
> Maybe we could share some code and experience.
>
> Regards - Jörn
Well, i've been diving in the network stack and came to the conclusion that
the best way to receive real raw packets is to make a ( i don't really know
if i use the right terminology) netisr that forewards the packets to a
thread. . (in our my case i could even filter on one specific type of
packet). For sending the low level functions could be used . . But the
amount of work involved would be rather big. .
have a look at ./net/bsd_tcpip/v2_0/src/sys/net/if_ethersubr.c the routine
'ether_demux' . This routine tries to find out what kind of packet is
received (IP ARP etc...) and starts a netisr..
I think the best way to receive 'raw' packets would be to make a netisr that
handles the 'default' case of the ether_demux routine . . .
hmmm . . .
Grtz Dries Pruimboom
--
01110111 01110111 01110111 00101110 01110000 01110010
01110101 01101001 01101101 01100010 01101111 01101111
01101101 00101110 01110100 01101011 <End of message>
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss
More information about the Ecos-discuss
mailing list