usb.h.html 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116
  1. <?xml version='1.0' encoding='iso-8859-1'?>
  2. <!doctype html public '-//W3C//DTD XHTML 1.0 Strict//EN' 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'>
  3. <html xmlns='http://www.w3c.org/1999/xhtml' lang='en-us'>
  4. <head>
  5. <title>
  6. usb.h
  7. </title>
  8. <meta http-equiv='content-type' content='text/html;iso-8859-1'/>
  9. <meta name='generator' content='motley-tools 1.9.4 13:40:33 Feb 18 2015'/>
  10. <meta name='author' content='cmaier@cmassoc.net'/>
  11. <meta name='robots' content='noindex,nofollow'/>
  12. <link href='toolkit.css' rel='stylesheet' type='text/css'/>
  13. </head>
  14. <body>
  15. <div class='headerlink'>
  16. [<a href='unistd.h.html' title=' unistd.h '>PREV</a>]
  17. [<a href='toolkit.html' title=' Index '>HOME</a>]
  18. [<a href='version.h.html' title=' version.h '>NEXT</a>]
  19. </div>
  20. <pre>
  21. /*
  22. * Copyright (c) 2006 Paolo Abeni (Italy)
  23. * All rights reserved.
  24. *
  25. * Redistribution and use in source and binary forms, with or without
  26. * modification, are permitted provided that the following conditions
  27. * are met:
  28. *
  29. * 1. Redistributions of source code must retain the above copyright
  30. * notice, this list of conditions and the following disclaimer.
  31. * 2. Redistributions in binary form must reproduce the above copyright
  32. * notice, this list of conditions and the following disclaimer in the
  33. * documentation and/or other materials provided with the distribution.
  34. * 3. The name of the author may not be used to endorse or promote
  35. * products derived from this software without specific prior written
  36. * permission.
  37. *
  38. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
  39. * &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  40. * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
  41. * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
  42. * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
  43. * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
  44. * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
  45. * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
  46. * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
  47. * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  48. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  49. *
  50. * Basic USB data struct
  51. * By Paolo Abeni &lt;paolo.abeni@email.it&gt;
  52. *
  53. * @(#) $Header: /tcpdump/master/libpcap/pcap/usb.h,v 1.6 2007/09/22 02:06:08 guy Exp $
  54. */
  55. #ifndef _PCAP_USB_STRUCTS_H__
  56. #define _PCAP_USB_STRUCTS_H__
  57. /*
  58. * possible transfer mode
  59. */
  60. #define URB_TRANSFER_IN 0x80
  61. #define URB_ISOCHRONOUS 0x0
  62. #define URB_INTERRUPT 0x1
  63. #define URB_CONTROL 0x2
  64. #define URB_BULK 0x3
  65. /*
  66. * possible event type
  67. */
  68. #define URB_SUBMIT 'S'
  69. #define URB_COMPLETE 'C'
  70. #define URB_ERROR 'E'
  71. /*
  72. * USB setup header as defined in USB specification.
  73. * Appears at the front of each packet in DLT_USB captures.
  74. */
  75. typedef struct _usb_setup {
  76. u_int8_t bmRequestType;
  77. u_int8_t bRequest;
  78. u_int16_t wValue;
  79. u_int16_t wIndex;
  80. u_int16_t wLength;
  81. } pcap_usb_setup;
  82. /*
  83. * Header prepended by linux kernel to each event.
  84. * Appears at the front of each packet in DLT_USB_LINUX captures.
  85. */
  86. typedef struct _usb_header {
  87. u_int64_t id;
  88. u_int8_t event_type;
  89. u_int8_t transfer_type;
  90. u_int8_t endpoint_number;
  91. u_int8_t device_address;
  92. u_int16_t bus_id;
  93. char setup_flag;/*if !=0 the urb setup header is not present*/
  94. char data_flag; /*if !=0 no urb data is present*/
  95. int64_t ts_sec;
  96. int32_t ts_usec;
  97. int32_t status;
  98. u_int32_t urb_len;
  99. u_int32_t data_len; /* amount of urb data really present in this event*/
  100. pcap_usb_setup setup;
  101. } pcap_usb_header;
  102. #endif
  103. </pre>
  104. <div class='footerlink'>
  105. [<a href='unistd.h.html' title=' unistd.h '>PREV</a>]
  106. [<a href='toolkit.html' title=' Index '>HOME</a>]
  107. [<a href='version.h.html' title=' version.h '>NEXT</a>]
  108. </div>
  109. </body>
  110. </html>