On Tue, 2008-05-27 at 02:57 -0700, Rob Loefman wrote: > Hi, > > I still cannot find documenation about the following when the device to open > is a tunnel (IP-in-IP or IPSEC): > > - which flag to use in dlpi_open() ?
You shouldn't need to set any flags if your application is simply sending and receiving IP packets through the tunnel. If your application needs to mess with the outer IP headers (i.e., send and receive them as part of the message data), then you'll need DLPI_RAW. > - how to set dlpi_sendinfo's dsi_sap for dlpi_send() ? If you're sending an IPv4 packet through the tunnel, then set the SAP to IPPROTO_ENCAP. If you're sending an IPv6 packet through the tunnel, then set the SAP to IPPROTO_IPv6. It looks like the design document isn't clear about this, and I'll fix that. > - how to set daddrp in dlpi_send() ? This is the destination link-layer address you're sending to. Since this address is pre-configured as the "tunnel destination", you can send down 0.0.0.0, and it should work. > when binding using DLPI_ANY_SAP (or should it be 0?) and promiscon() with > DL_PROMISC_SAP and tunnel devices. The constant DLPI_ANY_SAP should be used (its value happens to be 0, but your application shouldn't care about that.) Did you have a question regarding DL_PROMISC_SAP? -Seb
