[PATCH] Decode some PACKET_* socket options on Linux

Gabor Gombas gombasg at sztaki.hu
Mon Nov 9 07:45:13 UTC 2009


Hi!

On Fri, Nov 06, 2009 at 09:40:52PM +0300, Dmitry V. Levin wrote:

> Thank you.  I have a couple of questions about your patch.
> 
> [...]
> > +#ifdef PACKET_STATISTICS
> > +			case PACKET_STATISTICS:
> > +				if (len == sizeof(struct tpacket_stats)) {
> > +					struct tpacket_stats stats;
> 
> Is "struct tpacket_stats" always defined along with PACKET_STATISTICS
> macro, or does it need additional configure test?
> 
> [...]
> > +		switch (name) {
> > +#ifdef PACKET_RX_RING
> > +		    case PACKET_RX_RING:
> > +#ifdef PACKET_TX_RING
> > +		    case PACKET_TX_RING:
> > +#endif
> > +			if (len == sizeof(struct tpacket_req)) {
> > +				struct tpacket_req req;
> 
> Same question about "struct tpacket_req".

PACKET_STATISTICS, PACKET_RX_RING, strcut tpacket_stats and struct
tpacket_req were all introduced in Linux 2.3.15 together. PACKET_RX_RING
is Linux-specific (at least so far). I found references that OpenSolaris
now also has the PACKET_STATISTICS interface (emulation?), but it also
seems to have introduced PACKET_STATISTICS/struct tpacket_stats
together. So I think it is safe to say there is no need for additional
configure tests.

Gabor

-- 
     ---------------------------------------------------------
     MTA SZTAKI Computer and Automation Research Institute
                Hungarian Academy of Sciences
     ---------------------------------------------------------




More information about the Strace-devel mailing list