]> The Tcpdump Group git mirrors - libpcap/commitdiff
Rename {LINKTYPE,DLT}_IPMB_LINUX to {LINKTYPE,DLT}_I2C_LINUX.
authorGuy Harris <[email protected]>
Fri, 26 Apr 2024 06:48:11 +0000 (23:48 -0700)
committerGuy Harris <[email protected]>
Fri, 26 Apr 2024 06:48:45 +0000 (23:48 -0700)
The link-layer header just carries I2C information, and the initially
proposed names had I2C (first LINKTYPE_I2C, and then LINKTYPE_I2C_LINUX
as there was no guarantee that it would be the only I2C format used).

However, as using it as a general I2C header would require that packet
analyers have a knob to select what protocol the payload is using, and
it was requested for IPMB-over-I2C, so we decided to call it
LINKTYPE_IPMB_LINUX.

But it's now also used for HDMI Display Data Channel traffic, which also
runs over I2C, so it's no longer guaranteed to be IPMB traffic - and,
sure enough, Wireshark now has a "Decode As..." option to indicate what
protocol is being used.

So let's just go back to calling it by a name that reflects how it's
being used in practice, and leave DLT_IPMB_LINUX around as an alternate
name, for backwards source compatibility.

CHANGES
gencode.c
pcap-common.c
pcap.c
pcap/dlt.h

diff --git a/CHANGES b/CHANGES
index 2c4a5d514013e22b53cfcbea2b7de1619fb4b67b..f56b9562de76a2188e384a2b8390feddd090f4ad 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -19,6 +19,11 @@ DayOfTheWeek, Month DD, YYYY / The Tcpdump Group
       Add LINKTYPE_ZWAVE_TAP/DLT_ZWAVE_TAP.
       Add LINKTYPE_SILABS_DEBUG_CHANNEL/DLT_SILABS_DEBUG_CHANNEL.
       Add LINKTYPE_FIRA_UCI/DLT_FIRA_UCI.
+      Rename LINKTYPE_IPMB_LINUX/DLT_IPMB_LINUX to
+        LINKTYPE_I2C_LINUX/DLT_I2C_LINUX, as it's really just an
+        encapsulation of I2C, and is also being used for HDMI DDC.
+        Keep DLT_IPMB_LINUX around as a #define for backwards
+        compatibility.
     Packet filtering:
       Add support for Block Ack Req and Block Ack frame types (pull
         request #1039).
index 8cbc3c81d5674b0856f2c176e30f5b075fa89ad9..4c595e2cebde50b0f2595bf35f7b9d6b9630e8d9 100644 (file)
--- a/gencode.c
+++ b/gencode.c
@@ -3658,9 +3658,11 @@ gen_linktype(compiler_state_t *cstate, bpf_u_int32 ll_proto)
                bpf_error(cstate, "RAIF1 link-layer type filtering not implemented");
 
        case DLT_IPMB_KONTRON:
-       case DLT_IPMB_LINUX:
                bpf_error(cstate, "IPMB link-layer type filtering not implemented");
 
+       case DLT_I2C_LINUX:
+               bpf_error(cstate, "I2C link-layer type filtering not implemented");
+
        case DLT_AX25_KISS:
                bpf_error(cstate, "AX.25 link-layer type filtering not implemented");
 
index b69dcef72346c0d93737b4b596700af3a03d56c2..cae0ef728f2614f7ab9f8a701f76fc1d670cf2b8 100644 (file)
  */
 
 /*
- * IPMB with a Linux-specific pseudo-header; as requested by Alexey Neyman
+ * I2C with a Linux-specific pseudo-header; as requested by Alexey Neyman
+ *
+ * In the discussion, starting at
+ *
+ *     https://seclists.org/tcpdump/2007/q4/127
+ *
+ * the original idea that it was a link-layer type for I2C, but,
+ * as it was proposed as a way to capture IPMB-over-I2C, and
+ * the conclusion was that reserving it for IPMB-over-I2C meant
+ * that analyzers could just assume the traffic was IPMB.
+ *
+ * However, it was later used for HDMI DDC traffic, so there's
+ * no point in pretending that it's IPMB-only any more, so we
+ * renamed it to a name suggested earlier in the discussion,
+ * namely LINKTYPE_I2C_LINUX/DLT_I2C_LINUX, as the header was,
+ * at least originally, Linux-specific.
  */
-#define LINKTYPE_IPMB_LINUX    209
+#define LINKTYPE_I2C_LINUX     209
 
 /*
  * FlexRay automotive bus - http://www.flexray.com/ - as requested
diff --git a/pcap.c b/pcap.c
index a90e3ce1b7aa5de65195b8517ab1035c646c3ce1..e54fd3a797d8dc45b4fa9a3ffbedd0acbf16cce7 100644 (file)
--- a/pcap.c
+++ b/pcap.c
@@ -3299,7 +3299,7 @@ static struct dlt_choice dlt_choices[] = {
        DLT_CHOICE(JUNIPER_ST, "Juniper Secure Tunnel"),
        DLT_CHOICE(BLUETOOTH_HCI_H4_WITH_PHDR, "Bluetooth HCI UART transport layer plus pseudo-header"),
        DLT_CHOICE(AX25_KISS, "AX.25 with KISS header"),
-       DLT_CHOICE(IPMB_LINUX, "IPMB with Linux/Pigeon Point pseudo-header"),
+       DLT_CHOICE(I2C_LINUX, "I2C with Linux/Pigeon Point pseudo-header"),
        DLT_CHOICE(IEEE802_15_4_NONASK_PHY, "IEEE 802.15.4 with non-ASK PHY data"),
        DLT_CHOICE(MPLS, "MPLS with label as link-layer header"),
        DLT_CHOICE(LINUX_EVDEV, "Linux evdev events"),
index 32ac5b50d31694ec22effc8888c4620f77fb32ba..d0d9565e65fa491450cd67cd2b44d4df2d4a5ea9 100644 (file)
  */
 
 /*
- * IPMB with a Linux-specific pseudo-header; as requested by Alexey Neyman
+ * I2C with a Linux-specific pseudo-header; as requested by Alexey Neyman
  */
-#define DLT_IPMB_LINUX         209
+#define DLT_I2C_LINUX          209
+
+/*
+ * This was renamed as it's also used for other protocols, such as
+ * Display Data Channel as used by HDMI.
+ *
+ * We still define DLT_IPMB_LINUX for backwards source compatibility.
+ */
+#define DLT_IPMB_LINUX DLT_I2C_LINUX
 
 /*
  * FlexRay automotive bus - http://www.flexray.com/ - as requested