pcap_activate.html 4.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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_activate - activate a capture handle <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_activate(pcap_t *p);
  48. </pre>
  49. <p class="level0"><a name="DESCRIPTION"></a><h2 class="nroffsh">DESCRIPTION</h2>
  50. <p class="level0"><span Class="bold">pcap_activate</span>() is used to activate a packet capture handle to look at packets on the network, with the options that were set on the handle being in effect. <a name="RETURN"></a><h2 class="nroffsh">RETURN VALUE</h2>
  51. <p class="level0"><span Class="bold">pcap_activate</span>() returns <span Class="bold">0</span> on success without warnings, a non-zero positive value on success with warnings, and a negative value on error. A non-zero return value indicates what warning or error condition occurred.
  52. <p class="level0">The possible warning values are:
  53. <p class="level0"><span Class="bold">PCAP_WARNING_PROMISC_NOTSUP</span> Promiscuous mode was requested, but the capture source doesn&#39;t support promiscuous mode.
  54. <p class="level0"><span Class="bold">PCAP_WARNING_TSTAMP_TYPE_NOTSUP</span> The time stamp type specified in a previous <a Class="bold" href="./pcap_set_tstamp_type.html">pcap_set_tstamp_type</a>(3PCAP) call isn&#39;t supported by the capture source (the time stamp type is left as the default),
  55. <p class="level0"><span Class="bold">PCAP_WARNING</span> Another warning condition occurred; <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 a message describing the warning condition.
  56. <p class="level0">The possible error values are:
  57. <p class="level0"><span Class="bold">PCAP_ERROR_ACTIVATED</span> The handle has already been activated.
  58. <p class="level0"><span Class="bold">PCAP_ERROR_NO_SUCH_DEVICE</span> The capture source specified when the handle was created doesn&#39;t exist.
  59. <p class="level0"><span Class="bold">PCAP_ERROR_PERM_DENIED</span> The process doesn&#39;t have permission to open the capture source.
  60. <p class="level0"><span Class="bold">PCAP_ERROR_PROMISC_PERM_DENIED</span> The process has permission to open the capture source but doesn&#39;t have permission to put it into promiscuous mode.
  61. <p class="level0"><span Class="bold">PCAP_ERROR_RFMON_NOTSUP</span> Monitor mode was specified but the capture source doesn&#39;t support monitor mode.
  62. <p class="level0"><span Class="bold">PCAP_ERROR_IFACE_NOT_UP</span> The capture source device is not up.
  63. <p class="level0"><span Class="bold">PCAP_ERROR</span> Another error occurred. <span Class="bold">pcap_geterr</span>() or <span Class="bold">pcap_perror</span>() may be called with <span Class="emphasis">p</span> as an argument to fetch or display a message describing the error.
  64. <p class="level0">If <span Class="bold">PCAP_WARNING_PROMISC_NOTSUP</span>, <span Class="bold">PCAP_ERROR_NO_SUCH_DEVICE</span>, or <span Class="bold">PCAP_ERROR_PERM_DENIED</span> is returned, <span Class="bold">pcap_geterr</span>() or <span Class="bold">pcap_perror</span>() may be called with <span Class="emphasis">p</span> as an argument to fetch or display an message giving additional details about the problem that might be useful for debugging the problem if it&#39;s unexpected.
  65. <p class="level0">Additional warning and error codes may be added in the future; a program should check for positive, negative, and zero return codes, and treat all positive return codes as warnings and all negative return codes as errors. <a Class="bold" href="./pcap_statustostr.html">pcap_statustostr</a>(3PCAP) can be called, with a warning or error code as an argument, to fetch a message describing the warning or error code.
  66. <p class="level0">If <span Class="bold">pcap_activate</span>() fails, the <span Class="emphasis">pcap_t *</span> is not closed and freed; it should be closed using <span Class="bold">pcap_close</span>(). <a name="SEE"></a><h2 class="nroffsh">SEE ALSO</h2>
  67. <p class="level0"><a Class="bold" href="./pcap.html">pcap</a>(3PCAP) <p class="roffit">
  68. This HTML page was made with <a href="http://daniel.haxx.se/projects/roffit/">roffit</a>.
  69. </body></html>