On Tue, 2008-05-27 at 17:51 +0300, rlofman at abo.fi wrote:
> > You shouldn't need to set any flags if your application is simply
> > sending and receiving IP packets through the tunnel.
> 
> dlpi_open() with only two arguments will not compile.

By "not set any flags", I mean passing an argument of 0, not omitting
the argument.

> > The constant DLPI_ANY_SAP should be used (its value happens to be 0,
> 
> Actually there is this intersting definition:
> #define       DLPI_ANY_SAP    (uint_t)-1

Again, the value is irrelevant.

> But the good news is that dlpi_send() works (my packet is  
> encapsulated)! That is,  when I set flags to DLPI_NATIVE in  
> dlpi_open(), dsi_sap = IPPROTO_ENCAP and destination address 0.0.0.0

DLPI_NATIVE has no effect for tunnels.  This mode only has an effect for
WiFi links which masquerade as DL_ETHER, but are really DL_WIFI
underneath.

> 
> Now I will have to see how the promiscuous read works.

Note that if you don't use DLPI_RAW, then the received data will start
with the inner IP header (which may be fine depending on what your
application does).  If you do use DLPI_RAW, then the received data will
start with the outer IP header.  Note, however, that if you use
DLPI_RAW, you'll need to include the outer IP header with your data in
dlpi_send().

-Seb



Reply via email to