----- Original Message -----
From: James Carlson <james.d.carl...@sun.com>
Date: Thursday, January 15, 2009 11:33 pm
Subject: Re: iftop [PSARC/2009/018 FastTrack timeout 01/20/2009]
To: Xiang Samuel Zhou <Xiang.Zhou at Sun.COM>
Cc: Edward Pilatowicz <Edward.Pilatowicz at Sun.COM>, PSARC-ext at sun.com, Jim 
Walker <James.Walker at Sun.COM>

> Xiang Samuel Zhou writes:
> > ----- Original Message -----
> > From: James Carlson <James.D.Carlson at Sun.COM>
> > > How does it open DLPI devices?
> > It first use "open" system call to open something like /dev/bge, 
> then send strbuf containing DL_ATTACH_REQ to the opened STREAMS. It 
> uses dlpi device to get the mac address.
> 
> If I'm reading that correctly, it doesn't even support DLPI Style 1.
> I'm hoping that's wrong, based on the description below, because it'd
> be a show-stopper of a bug.
iftop ONLY use these codes to get the mac address. For other operations on 
interface, it uses functions in libpcap.
I tried to remove the codes to get mac address. it works ok in global zone and 
non-global exclusive zone. Further, if I remove all the definations in dlpi.h 
and do not include dlpi.h in source code, the compiled binary works good for 
exclusive zone and vanity naming.

> 
> > > If it doesn't use libdlpi, does it have support for Solaris 
> "vanity> > naming," which requires looking in /dev/net/ for the 
> device first?
> > It doesn't looking in /dev/net/, but it seems works ok on renamed 
> link, e.g. the command "iftop -i e1kg1" shows the traffic on e1kg1 
> where e1kg1 is the renamed name of e1000g1. For capture packets, it 
> uses pcap_open_live to open the interface. It seems libpcap support 
> vanity naming.
> 
> OK.  As long as you're not either delivering your own copy or
> statically linking it in, you should be fine.  Solaris already comes
> with libpcap, and it (in turn) uses libdlpi and supports vanity
> naming.
> 
> > > If it doesn't do that, could a fix be contributed back 
> upstream?  It's
> > > usually about two lines of code.
> > Make sense. I will deliever the patch in a couple of days.
> 
> None should be needed if you're not dealing with the /dev entries
> directly, and are instead going through the normal system libpcap.
Right, could it be ok to fix the issue: removed the code dealing with /dev and 
/dev/net entries which is used for dlpi operation, do not use functions and 
definations in dlpi.h, and make all packet capture works depend on libpcap? 
Because the code just use dlpi.h interfaces to get mac address which is not an 
important information of iftop.

Thanks!
- Xiang
> 
> -- 
> James Carlson, Solaris Networking              
> <james.d.carlson at sun.com>Sun Microsystems / 35 Network Drive        
> 71.232W   Vox +1 781 442 2084
> MS UBUR02-212 / Burlington MA 01803-2757   42.496N   Fax +1 781 442 
> 1677

Reply via email to