public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] raw sockets in bsd stack. . ..
@ 2004-08-30 10:10 dries
  2004-08-30 10:32 ` Jörn Seger
  0 siblings, 1 reply; 6+ messages in thread
From: dries @ 2004-08-30 10:10 UTC (permalink / raw)
  To: ecos-discuss

Hello All,

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 think sending won't be the problem, but for receiving modifications seem to 
be needed. .  ?)

thanx . . . 

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ECOS] raw sockets in bsd stack. . ..
  2004-08-30 10:10 [ECOS] raw sockets in bsd stack. . dries
@ 2004-08-30 10:32 ` Jörn Seger
  2004-08-30 11:18   ` dries
  0 siblings, 1 reply; 6+ messages in thread
From: Jörn Seger @ 2004-08-30 10:32 UTC (permalink / raw)
  To: ecos-discuss

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

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ECOS] raw sockets in bsd stack. . ..
  2004-08-30 10:32 ` Jörn Seger
@ 2004-08-30 11:18   ` dries
  2004-08-30 12:07     ` Jörn Seger
  0 siblings, 1 reply; 6+ messages in thread
From: dries @ 2004-08-30 11:18 UTC (permalink / raw)
  To: ecos-discuss

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ECOS] raw sockets in bsd stack. . ..
  2004-08-30 11:18   ` dries
@ 2004-08-30 12:07     ` Jörn Seger
  2004-08-30 13:02       ` dries
  0 siblings, 1 reply; 6+ messages in thread
From: Jörn Seger @ 2004-08-30 12:07 UTC (permalink / raw)
  To: ecos-discuss

Am Montag, 30. August 2004 21:32 schrieb dries:
> 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. .

I believe so, too.

Maybe somebody can correct me, but I remember something like the io/eth/ 
directory, where you can "read" the packets directly from the network driver 
via some abstract functions like eth_drv_read()!?

But I haven't found any documentation on that up until now.

- Jörn

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [ECOS] raw sockets in bsd stack. . ..
  2004-08-30 12:07     ` Jörn Seger
@ 2004-08-30 13:02       ` dries
  2004-08-30 14:39         ` [ECOS] " Grant Edwards
  0 siblings, 1 reply; 6+ messages in thread
From: dries @ 2004-08-30 13:02 UTC (permalink / raw)
  To: ecos-discuss

Jörn Seger wrote :

>  Maybe somebody can correct me, but I remember something like the io/eth/
>  directory, where you can "read" the packets directly from the network
> driver via some abstract functions like eth_drv_read()!?
>
>  But I haven't found any documentation on that up until now.
>
>  - Jörn

the eth_drv_read function is a internal driver function, i don't think your 
allowed to call it directly . . . 

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [ECOS] Re: raw sockets in bsd stack. . ..
  2004-08-30 13:02       ` dries
@ 2004-08-30 14:39         ` Grant Edwards
  0 siblings, 0 replies; 6+ messages in thread
From: Grant Edwards @ 2004-08-30 14:39 UTC (permalink / raw)
  To: dries; +Cc: ecos-discuss

On Mon, Aug 30, 2004 at 02:07:45PM -0700, dries wrote:
> Jörn Seger wrote :
> 
> >  Maybe somebody can correct me, but I remember something like the io/eth/
> >  directory, where you can "read" the packets directly from the network
> > driver via some abstract functions like eth_drv_read()!?
> >
> >  But I haven't found any documentation on that up until now.
> >
> >  - Jörn
> 
> the eth_drv_read function is a internal driver function, i don't think your 
> allowed to call it directly . . . 

When I needed to do raw Ethernet, I ended up writing an
interface between my Ethernet driver and the normal
cyg_io_read()/cyg_io_write() API.  It existed in parallel with
the network driver API so that I could do both IP stuff and raw
stuff at the same time.  The main restriction was that it could
only be configured to send one Ethernet protocol type to the
cyg_io_read() API, the rest went to the network stack.

It wasn't particularly hard to do, but it did require a bit of
work.

-- 
Grant Edwards
grante@visi.com

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2004-08-30 14:31 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-08-30 10:10 [ECOS] raw sockets in bsd stack. . dries
2004-08-30 10:32 ` Jörn Seger
2004-08-30 11:18   ` dries
2004-08-30 12:07     ` Jörn Seger
2004-08-30 13:02       ` dries
2004-08-30 14:39         ` [ECOS] " Grant Edwards

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).