[PATCH] Decode some PACKET_* socket options on Linux

Dmitry V. Levin ldv at altlinux.org
Fri Nov 6 18:40:52 UTC 2009


Hi,

On Sun, Oct 25, 2009 at 12:43:44PM +0100, Gabor Gombas wrote:
> 
> The following patch adds the names of all PACKET_* options that exist in
> Linux kernel v2.6.31. The patch also adds decoding of arguments for
> getsockopt(PACKET_STATISTICS) and setsockopt(PACKET_{RX,TX}_RING).

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".


-- 
ldv
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: not available
URL: <http://lists.strace.io/pipermail/strace-devel/attachments/20091106/05eed385/attachment.bin>


More information about the Strace-devel mailing list