public inbox for ecos-discuss@sourceware.org
 help / color / mirror / Atom feed
* [ECOS] "really raw" sockets
@ 2001-11-15  4:35 David Webster
  2001-11-15  4:52 ` Grant Edwards
  2001-11-15  5:11 ` Andrew Lunn
  0 siblings, 2 replies; 3+ messages in thread
From: David Webster @ 2001-11-15  4:35 UTC (permalink / raw)
  To: ecos-discuss

Hi,
	I need to write some software to communicate with an Ethernet
device using a protocol that's not TCP/IP based. The devices use their
own 802.3 Ethernet Type. Can I use the sockets api to send/receive
Ethernet frames with the required Ethernet type and the (known)
destiniation MAC address of the device? I know there's a RAW socket type
but am I right in thinking this is raw IP frames rather than raw
Ethernet frames?
	If I can't use sockets I'll have to modify the Ethernet driver
(if_ethersubr.c ether_output() and ether_input()) to handle the new
Ethernet type and then call into my own protocol driver? I assume there
is no generic way to add support for additional Ethernet types?  If I
can do this it would obviously be preferable for me to integrate my new
protocol into the sockets api - so my application can use the standard
sockets api to send / receive the protocol - in effect defining a new
sockets protocol family. Can this be done? Can anybody point me at
documentation/information on how to do this?

	Many thanks
		Dave Webster

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

* Re: [ECOS] "really raw" sockets
  2001-11-15  4:35 [ECOS] "really raw" sockets David Webster
@ 2001-11-15  4:52 ` Grant Edwards
  2001-11-15  5:11 ` Andrew Lunn
  1 sibling, 0 replies; 3+ messages in thread
From: Grant Edwards @ 2001-11-15  4:52 UTC (permalink / raw)
  To: David Webster; +Cc: ecos-discuss

On Mon, Nov 26, 2001 at 12:03:53PM -0000, David Webster wrote:

> I need to write some software to communicate with an Ethernet
> device using a protocol that's not TCP/IP based. The devices
> use their own 802.3 Ethernet Type.

I've done this with my Ethernet driver by having it impliment
the standard IO device API (cyg_io_lookup/read/write/...) in
addition to the API used by the TCP/IP stack.  At the time I
did it, the raw packet interface was unsupported by the TCP/IP
stack, and I wanted my raw-mode to work even if the TCP/IP
stack wasn't installed.

I'm only interested in a single "custom" Ethernet proto number,
so I use cyg_io_set_config to select the proto number for
receive purposes, as well as optionally setting the MAC
address.  Raw frames are then sent/received with
cyg_io_read/write calls.

-- 
Grant Edwards
grante@visi.com

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

* Re: [ECOS] "really raw" sockets
  2001-11-15  4:35 [ECOS] "really raw" sockets David Webster
  2001-11-15  4:52 ` Grant Edwards
@ 2001-11-15  5:11 ` Andrew Lunn
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Lunn @ 2001-11-15  5:11 UTC (permalink / raw)
  To: David Webster; +Cc: eCos Disuss

Hi Dave

To do this you need bpf. Thats not currently part of the stack. I
think you have to properly integrate your protocol stack by adding in
support in ether_input and ether_output. 

As for documentation i suggest "TCP/IP Illustrated, Volume 2. The
Implementation." by Gary T Wright and W. R Stevens. This is The book
about the insides of the BSD network stack.

      Andrew


On Mon, Nov 26, 2001 at 12:03:53PM -0000, David Webster wrote:
> Hi,
> 	I need to write some software to communicate with an Ethernet
> device using a protocol that's not TCP/IP based. The devices use their
> own 802.3 Ethernet Type. Can I use the sockets api to send/receive
> Ethernet frames with the required Ethernet type and the (known)
> destiniation MAC address of the device? I know there's a RAW socket type
> but am I right in thinking this is raw IP frames rather than raw
> Ethernet frames?
> 	If I can't use sockets I'll have to modify the Ethernet driver
> (if_ethersubr.c ether_output() and ether_input()) to handle the new
> Ethernet type and then call into my own protocol driver? I assume there
> is no generic way to add support for additional Ethernet types?  If I
> can do this it would obviously be preferable for me to integrate my new
> protocol into the sockets api - so my application can use the standard
> sockets api to send / receive the protocol - in effect defining a new
> sockets protocol family. Can this be done? Can anybody point me at
> documentation/information on how to do this?
> 
> 	Many thanks
> 		Dave Webster
> 

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

end of thread, other threads:[~2001-11-26 20:57 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-11-15  4:35 [ECOS] "really raw" sockets David Webster
2001-11-15  4:52 ` Grant Edwards
2001-11-15  5:11 ` Andrew Lunn

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