Hi Rob,

On Wed, 2008-05-21 at 07:23 -0700, Rob Loefman wrote:
> I'm trying to read promiscuously with DLPI from a IP-in-Ip tunnel with bad 
> results.
> I have a Clerview BFUed SXDE and when binding i get error messages. 
> 
> Could someone help me with the following parameters when open() is used on 
> /dev/net/ip.tun1
> for instance:
> 
> in the dl_bind_req_t  struct:
> 
>   - dl_sap
>   - dl_max_conind
>   - service_mode
>   - xidtest_flg
> 
> so everything goes well opening and putting the interface into promiscuous 
> mode but the bind fails.

If you're going to place the DLPI provider in promiscuous mode
(DL_PROMISC_SAP right?), then the specific value that you use as a SAP
when issuing DL_BIND_REQ isn't really important as long as it's in the
SAP space of the provider.  The only thing that is important is that you
bind in order to place the provider in DL_IDLE state.  For convenience
to applications that are not interested in any one specific SAP value in
order to enable promiscuous mode, the SAP value 0 is in the SAP space
for IP tunnels (as well as most DLPI providers).

That said, libdlpi(3LIB) can make all of this much simpler in your
application.  You can call dlpi_open() to open a handle to the provider,
then use dlpi_bind() to bind to SAP 0, and then enable promiscuous mode
with dlpi_promiscon().  You can then use dlpi_recv() to receive on that
handle.

I hope this helps.

-Seb



Reply via email to