]> The Tcpdump Group git mirrors - libpcap/commitdiff
More details.
authorGuy Harris <[email protected]>
Thu, 24 Aug 2017 20:56:31 +0000 (13:56 -0700)
committerGuy Harris <[email protected]>
Thu, 24 Aug 2017 20:56:31 +0000 (13:56 -0700)
Explicitly note that it's used when creating a capture socket.

Note that the values are typically values from <linux/if_ether.h>, and
that they are in host byte order.

Note that it does not work on devices other than network interfaces; for
example, it has no effect on Linux USB, Bluetooth, or netfilter devices.

pcap_set_protocol.3pcap

index 4ed3e62184262d202a5f4bc560133402529d59fd..878ba1a135e7050fbc0e427da8aaada4d22a1468 100644 (file)
@@ -32,13 +32,18 @@ int pcap_set_protocol(pcap_t *p, int protocol);
 .fi
 .SH DESCRIPTION
 .B pcap_set_protocol()
-sets the capture protocol to use on a capture handle when the handle
-is activated.
+sets the protocol to be used in the
+.BR socket (2)
+call to create a capture socket when the handle is activated.  The
+argument is a link-layer protocol value, such as the values in the
+.B <linux/if_ether.h>
+header file, specified in host byte order.
 If
 .I protocol
 is non-zero, packets of that protocol will be captured when the
 handle is activated, otherwise, all packets will be captured.  This
-function is only provided on Linux.
+function is only provided on Linux, and, if it is used on any device
+other than a network interface, it will have no effect.
 .SH RETURN VALUE
 .B pcap_set_protocol()
 returns 0 on success or