aboutsummaryrefslogtreecommitdiff
path: root/pcap/dlt.h
diff options
context:
space:
mode:
authorTomasz Moń <desowin@gmail.com>2022-05-15 21:17:34 +0200
committerTomasz Moń <desowin@gmail.com>2022-05-15 21:17:34 +0200
commit3b9f5172a84caedf15f74d2ebc44cb98793b9224 (patch)
tree6ed642ecc67dc25ec81cd0936000df6c701bb1c7 /pcap/dlt.h
parent2a7fcca8954579e48b6ad93ac0a62469bcfc8fe2 (diff)
Add speed specific USB 2.0/1.1/1.0 linktypes
USB 2.0/1.1/1.0 devices (or 3.x and newer when connected to hosts that are not Super-Speed capable) operate at one of three speeds: * Low-Speed (1.5 Mbps) * Full-Speed (12 Mbps) * High-Speed (480 Mbps) While the packets are generally common to all three speeds, there are some differences that span across different layers. The capture speed should be available to analyzer and it makes sense to expose it via speed specific linktypes. Existing USB 2.0/1.1/1.0 captures can be manually, retroactively updated to speed specific linktype. Low-Speed device will always operate at Low-Speed, regardless of what host it is connected to. USB cable connected to Low-Speed device only ever carries packets sent at Low-Speed. High-Speed device will operate at High-Speed when connected to High-Speed capable host. If High-Speed Detection Handshake succeeds, the cable will only carry High-Speed packets. Full-Speed device will always operate at Full-Speed, regardless of what host it is connected to. High-Speed device connected to Full-Speed host or hub, will operate at Full-Speed. The cable connected to device operating at Full-Speed can only carry Full-Speed or Low-Speed packets preceded by Low-Speed preamble (PRE packet) sent at Full-Speed. Non-hub device operating at Full-Speed always ignores Low-Speed packets. The hub forwards the Low-Speed packets to downstream ports but does not act upon the actual Low-Speed packet contents. The packets intended for device operating at Full-Speed are always sent at Full-Speed.
Diffstat (limited to 'pcap/dlt.h')
-rw-r--r--pcap/dlt.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/pcap/dlt.h b/pcap/dlt.h
index 1d255d60..a83b4dcd 100644
--- a/pcap/dlt.h
+++ b/pcap/dlt.h
@@ -1544,6 +1544,8 @@
/*
* USB 2.0, 1.1, and 1.0 packets as transmitted over the cable.
+ * Deprecated in favor of speed specific DLTs: DLT_USB_2_0_LOW_SPEED,
+ * DLT_USB_2_0_FULL_SPEED and DLT_USB_2_0_HIGH_SPEED.
*/
#define DLT_USB_2_0 288
@@ -1579,6 +1581,13 @@
#define DLT_ZBOSS_NCP 292
/*
+ * USB 2.0, 1.1, and 1.0 packets as transmitted over the cable.
+ */
+#define DLT_USB_2_0_LOW_SPEED 293
+#define DLT_USB_2_0_FULL_SPEED 294
+#define DLT_USB_2_0_HIGH_SPEED 295
+
+/*
* In case the code that includes this file (directly or indirectly)
* has also included OS files that happen to define DLT_MATCHING_MAX,
* with a different value (perhaps because that OS hasn't picked up
@@ -1588,6 +1597,6 @@
#ifdef DLT_MATCHING_MAX
#undef DLT_MATCHING_MAX
#endif
-#define DLT_MATCHING_MAX 292 /* highest value in the "matching" range */
+#define DLT_MATCHING_MAX 295 /* highest value in the "matching" range */
#endif /* !defined(lib_pcap_dlt_h) */