pcap_list_datalinks.html 3.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  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_list_datalinks, pcap_free_datalinks - get a list of link-layer header types supported by a capture device, and free that list <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_list_datalinks(pcap_t *p, int **dlt_buf);
  48. void pcap_free_datalinks(int *dlt_list);
  49. </pre>
  50. <p class="level0"><a name="DESCRIPTION"></a><h2 class="nroffsh">DESCRIPTION</h2>
  51. <p class="level0"><span Class="bold">pcap_list_datalinks</span>() is used to get a list of the supported link-layer header types of the interface associated with the pcap descriptor. <span Class="bold">pcap_list_datalinks</span>() allocates an array to hold the list and sets <span Class="emphasis">*dlt_buf</span> to point to that array.
  52. <p class="level0">The caller is responsible for freeing the array with <span Class="bold">pcap_free_datalinks</span>(), which frees the list of link-layer header types pointed to by <span Class="emphasis">dlt_list</span>.
  53. <p class="level0">It must not be called on a pcap descriptor created by <span Class="bold">\%pcap_create</span>(3PCAP) that has not yet been activated by <span Class="bold">\%pcap_activate</span>(3PCAP). <a name="RETURN"></a><h2 class="nroffsh">RETURN VALUE</h2>
  54. <p class="level0"><span Class="bold">pcap_list_datalinks</span>() returns the number of link-layer header types in the array on success, <span Class="bold">PCAP_ERROR_NOT_ACTIVATED</span> if called on a capture handle that has been created but not activated, and <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>
  55. <p class="level0"><a Class="bold" href="./pcap.html">pcap</a>(3PCAP), <a Class="bold" href="./pcap_datalink_val_to_name.html">pcap_datalink_val_to_name</a>(3PCAP), <a Class="bold" href="./pcap-linktype.html">pcap-linktype</a>(7) <p class="roffit">
  56. This HTML page was made with <a href="http://daniel.haxx.se/projects/roffit/">roffit</a>.
  57. </body></html>