1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768 |
- <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
- "http://www.w3.org/TR/html4/loose.dtd">
- <html><head>
- <title>3PCAP man page</title>
- <meta name="generator" content="roffit">
- <STYLE type="text/css">
- pre {
- overflow: auto;
- margin: 0;
- }
- P.level0, pre.level0 {
- padding-left: 2em;
- }
- P.level1, pre.level1 {
- padding-left: 4em;
- }
- P.level2, pre.level2 {
- padding-left: 6em;
- }
- span.emphasis {
- font-style: italic;
- }
- span.bold {
- font-weight: bold;
- }
- span.manpage {
- font-weight: bold;
- }
- h2.nroffsh {
- background-color: #e0e0e0;
- }
- span.nroffip {
- font-weight: bold;
- font-size: 120%;
- font-family: monospace;
- }
- p.roffit {
- text-align: center;
- font-size: 80%;
- }
- </STYLE>
- </head><body>
- <p class="level0"><a name="NAME"></a><h2 class="nroffsh">NAME</h2>
- <p class="level0">pcap_set_protocol_linux - set capture protocol for a not-yet-activated capture handle <a name="SYNOPSIS"></a><h2 class="nroffsh">SYNOPSIS</h2>
- <p class="level0"><pre class="level0">
- #include <pcap/pcap.h>
- int pcap_set_protocol_linux(pcap_t *p, int protocol);
- </pre>
- <p class="level0"><a name="DESCRIPTION"></a><h2 class="nroffsh">DESCRIPTION</h2>
- <p class="level0">On network interface devices on Linux, <span Class="bold">pcap_set_protocol_linux</span>() sets the protocol to be used in the <span Class="bold">socket</span>(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 <span Class="bold"><linux/if_ether.h></span> header file, specified in host byte order. If <span Class="emphasis">protocol</span> 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, and, if it is used on any device other than a network interface, it will have no effect.
- <p class="level0">It should not be used in portable code; instead, a filter should be specified with <a Class="bold" href="./pcap_setfilter.html">pcap_setfilter</a>(3PCAP).
- <p class="level0">If a given network interface provides a standard link-layer header, with a standard packet type, but provides some packet types with a different socket-layer protocol type from the one in the link-layer header, that packet type cannot be filtered with a filter specified with <span Class="bold">pcap_setfilter</span>() but can be filtered by specifying the socket-layer protocol type using <span Class="bold">pcap_set_protocol_linux</span>(). <a name="RETURN"></a><h2 class="nroffsh">RETURN VALUE</h2>
- <p class="level0"><span Class="bold">pcap_set_protocol_linux</span>() returns <span Class="bold">0</span> on success or <span Class="bold">PCAP_ERROR_ACTIVATED</span> if called on a capture handle that has been activated. <a name="BACKWARD"></a><h2 class="nroffsh">BACKWARD COMPATIBILITY</h2>
- <p class="level0">This function became available in libpcap release 1.9.0. <a name="SEE"></a><h2 class="nroffsh">SEE ALSO</h2>
- <p class="level0"><a Class="bold" href="./pcap.html">pcap</a>(3PCAP), <a Class="bold" href="./pcap_create.html">pcap_create</a>(3PCAP), <a Class="bold" href="./pcap_activate.html">pcap_activate</a>(3PCAP) <p class="roffit">
- This HTML page was made with <a href="http://daniel.haxx.se/projects/roffit/">roffit</a>.
- </body></html>
|