pcap_setdirection.html 2.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
  2. "http://www.w3.org/TR/html4/loose.dtd">
  3. <html><head>
  4. <title>3PCAP man page</title>
  5. <meta name="generator" content="roffit">
  6. <STYLE type="text/css">
  7. pre {
  8. overflow: auto;
  9. margin: 0;
  10. }
  11. P.level0, pre.level0 {
  12. padding-left: 2em;
  13. }
  14. P.level1, pre.level1 {
  15. padding-left: 4em;
  16. }
  17. P.level2, pre.level2 {
  18. padding-left: 6em;
  19. }
  20. span.emphasis {
  21. font-style: italic;
  22. }
  23. span.bold {
  24. font-weight: bold;
  25. }
  26. span.manpage {
  27. font-weight: bold;
  28. }
  29. h2.nroffsh {
  30. background-color: #e0e0e0;
  31. }
  32. span.nroffip {
  33. font-weight: bold;
  34. font-size: 120%;
  35. font-family: monospace;
  36. }
  37. p.roffit {
  38. text-align: center;
  39. font-size: 80%;
  40. }
  41. </STYLE>
  42. </head><body>
  43. <p class="level0"><a name="NAME"></a><h2 class="nroffsh">NAME</h2>
  44. <p class="level0">pcap_setdirection - set the direction for which packets will be captured <a name="SYNOPSIS"></a><h2 class="nroffsh">SYNOPSIS</h2>
  45. <p class="level0"><pre class="level0">
  46. &#35;include &lt;pcap/pcap.h&gt;
  47. int pcap_setdirection(pcap_t *p, pcap_direction_t d);
  48. </pre>
  49. <p class="level0"><a name="DESCRIPTION"></a><h2 class="nroffsh">DESCRIPTION</h2>
  50. <p class="level0"><span Class="bold">pcap_setdirection</span>() is used to specify a direction that packets will be captured. <span Class="emphasis">d</span> is one of the constants <span Class="bold">PCAP_D_IN</span>, <span Class="bold">PCAP_D_OUT</span> or <span Class="bold">PCAP_D_INOUT</span>. <span Class="bold">PCAP_D_IN</span> will only capture packets received by the device, <span Class="bold">PCAP_D_OUT</span> will only capture packets sent by the device and <span Class="bold">PCAP_D_INOUT</span> will capture packets received by or sent by the device. <span Class="bold">PCAP_D_INOUT</span> is the default setting if this function is not called.
  51. <p class="level0"><span Class="bold">pcap_setdirection</span>() isn&#39;t necessarily fully supported on all platforms; some platforms might return an error for all values, and some other platforms might not support <span Class="bold">PCAP_D_OUT</span>.
  52. <p class="level0">This operation is not supported if a ``savefile&#39;&#39; is being read. <a name="RETURN"></a><h2 class="nroffsh">RETURN VALUE</h2>
  53. <p class="level0"><span Class="bold">pcap_setdirection</span>() returns <span Class="bold">0</span> on success, <span Class="bold">PCAP_ERROR_NOT_ACTIVATED</span> if called on a capture handle that has been created but not activated, or <span Class="bold">PCAP_ERROR</span> on other errors. If <span Class="bold">PCAP_ERROR</span> is returned, <a Class="bold" href="./pcap_geterr.html">pcap_geterr</a>(3PCAP) or <span Class="bold">pcap_perror</span>(3PCAP) may be called with <span Class="emphasis">p</span> as an argument to fetch or display the error text. <a name="SEE"></a><h2 class="nroffsh">SEE ALSO</h2>
  54. <p class="level0"><a Class="bold" href="./pcap.html">pcap</a>(3PCAP) <p class="roffit">
  55. This HTML page was made with <a href="http://daniel.haxx.se/projects/roffit/">roffit</a>.
  56. </body></html>