Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
Forum Topic - Ether hook?: (3 Items)
   
Ether hook?  
On page 11 of the QNX Networking 6.4 Webinar presentation, TDP (qnet) is shown interfacing with the link layer using "
Ether Hook".

I googled Ether hook and came up with a VxWorks library that allows a direct interface to ethernet packets bypassing the
 protocol layers.

Does io-pkt implement ether hook?  What is the interface between drivers and protocol layers for sending and receiving 
ethernet packets?

Thanks,
Mike
RE: Ether hook?  
Hi Michael:
	The best way to understand how qnet hooks into the stack is to look
at the source here:

http://community.qnx.com/integration/viewcvs/viewcvs.cgi/trunk/sys/lsm/qnet/
l4_lite/l4_driver_en_iopkt.c?root=core_networking&rev=324&system=exsy1001&vi
ew=markup

This is the source that takes care of sending the packets up to the qnet
protocol layer.

We don't actually use "ether hook".  It's "ether_input" and "ip_input" in
the case of the BSD stack.  Unfortunately, this layer isn't documented at
this time since we've had so much else to get going with the rest of the
stack.

Look here:

http://community.qnx.com/integration/viewcvs/viewcvs.cgi/trunk/sys/lsm/qnet/
l4_lite/l4_resolver_ip_ionet.c?root=core_networking&rev=324&system=exsy1001&
view=markup

for hooking into the Ethernet layer.

Note the function l4_driver_init_en_iopkt which inserts a receive function
pointer for a specific ether type into the stack processing.

Look here:

http://community.qnx.com/integration/viewcvs/viewcvs.cgi/trunk/sys/lsm/qnet/
l4_lite/l4_driver_ip_iopkt.c?root=core_networking&rev=1&system=exsy1001&view
=markup

for hooking into the IP layer. 

The function l4_driver_init_ip_iopkt does the "hooking in".


There's some pretty tricky code in there to deal with.

One thing to be very careful of is that threads interacting with structures
within the stack have sharp limitations on what they can and can't do.
You'll notice that things get pulled into stack threads and independent qnet
protocol threads.



	Robert.

-----Original Message-----
From: Michael Li [mailto:mikeqnx@gmail.com] 
Sent: Tuesday, May 20, 2008 4:04 PM
To: technology-networking
Subject: Ether hook?

On page 11 of the QNX Networking 6.4 Webinar presentation, TDP (qnet) is
shown interfacing with the link layer using "Ether Hook".

I googled Ether hook and came up with a VxWorks library that allows a direct
interface to ethernet packets bypassing the protocol layers.

Does io-pkt implement ether hook?  What is the interface between drivers and
protocol layers for sending and receiving ethernet packets?

Thanks,
Mike

_______________________________________________
Technology
http://community.qnx.com/sf/go/post8280
Re: Ether hook?  
On Tue, May 20, 2008 at 04:04:20PM -0400, Michael Li wrote:
> On page 11 of the QNX Networking 6.4 Webinar presentation, TDP (qnet) is shown interfacing with the link layer using "
Ether Hook".
> 
> I googled Ether hook and came up with a VxWorks library that allows a direct interface to ethernet packets bypassing 
the protocol layers.
> 
> Does io-pkt implement ether hook?  What is the interface between drivers and protocol layers for sending and receiving
 ethernet packets?

There's eth_input_pfil_hook in ether_input which will let you
do your own filtering.  There's also etype_list_insert() which
will peel off a particular ethertype.

For sending there's (struct ifnet *)->if_output.

However if you're looking to port sctp I'd start with the
FreeBSD source or ask on a NetBSD list to see if one exists
(there was talk about starting one at some point).

-seanb