02.03.2014 Views

BSP Developer's Guide

BSP Developer's Guide

BSP Developer's Guide

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

G<br />

Upgrading 4.3 BSD Network Drivers<br />

Figure G-1<br />

Packet Reception Call Graph<br />

etherInputHook( )<br />

[1]<br />

xxReceive( )<br />

[2]<br />

do_protocol_with_type( )<br />

xxHandleRecvInt( )<br />

xxInt( )<br />

[1] The xxReceive( ) first shows the packet to etherInputHook( ).<br />

[2] If etherInputHook( ) does not take delivery of the packet, xxReceive( ) hands<br />

the packet to do_protocol_with_type( ).<br />

Figure G-2<br />

Packet Transmission Call Graph<br />

xxOutput( )<br />

ether_output( )<br />

xxTxStartup( )<br />

G<br />

[1] [2]<br />

etherOutputHook( )<br />

transmit on medium<br />

[1] The xxTxStartup( ) first shows the packet to etherOutputHook( ).<br />

[2] If etherOutputHook( ) does not take delivery of the packet, xxTxStartup( )<br />

transmits the packet on the medium.<br />

G.1.2 Etherhook Routines Provide Access to Raw Packets<br />

You can use the etherInputHook( ) and etherOutputHook( ) routines to bypass the<br />

TCP/IP stack and thus get access to raw packets. On packet reception, if an<br />

etherInputHook( ) function is installed, it receives the packet just after the driver<br />

has completed reception but before the packet goes to the protocol. If<br />

259

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!