]> The Tcpdump Group git mirrors - libpcap/commitdiff
Rename DLT_IPMB to DLT_IPMB_KONTRON.
authorGuy Harris <[email protected]>
Sat, 23 Mar 2019 02:33:49 +0000 (19:33 -0700)
committerGuy Harris <[email protected]>
Sat, 23 Mar 2019 02:34:03 +0000 (19:34 -0700)
Apparently the Kontron person who said that the packets begin with the
I2C slave address didn't understand the question, because the Kontron
code adds a 2-byte pseudo-header before the I2C slave address.  Rename
the DLT_ and LINKTYPE_ values to reflect this, and update the comments.

Add support for the Linux/Pigeon Point pseudo-header in some places
where it was missing.

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

index 96344962d4f821da12d7c349a1da8b2850a206fc..a9ee050496128ee6c2590bd3598f67ef8eda69be 100644 (file)
--- a/gencode.c
+++ b/gencode.c
@@ -3592,7 +3592,8 @@ gen_linktype(compiler_state_t *cstate, bpf_u_int32 ll_proto)
        case DLT_RAIF1:
                bpf_error(cstate, "RAIF1 link-layer type filtering not implemented");
 
-       case DLT_IPMB:
+       case DLT_IPMB_KONTRON:
+       case DLT_IPMB_LINUX:
                bpf_error(cstate, "IPMB link-layer type filtering not implemented");
 
        case DLT_AX25_KISS:
index e5b041eacd99046f18d48a84c619731963a5fd6b..a539954352f7a0934d42f5fb978ee3e6f94d3160 100644 (file)
 #define LINKTYPE_RAIF1         198
 
 /*
- * IPMB packet for IPMI, beginning with the I2C slave address, followed
- * by the netFn and LUN, etc..  Requested by Chanthy Toeung
- */
-#define LINKTYPE_IPMB          199
+ * IPMB packet for IPMI, beginning with a 2-byte header, followed by
+ * the I2C slave address, followed by the netFn and LUN, etc..
+ * Requested by Chanthy Toeung <[email protected]>.
+ *
+ * XXX - its DLT_ value used to be called DLT_IPMB, back when we got the
+ * impression from the email thread requesting it that the packet
+ * had no extra 2-byte header.  We've renamed it; if anybody used
+ * DLT_IPMB and assumed no 2-byte header, this will cause the compile
+ * to fail, at which point we'll have to figure out what to do about
+ * the two header types using the same DLT_/LINKTYPE_ value.  If that
+ * doesn't happen, we'll assume nobody used it and that the redefinition
+ * is safe.
+ */
+#define LINKTYPE_IPMB_KONTRON  199
 
 /*
  * Juniper-private data link type, as per request from
diff --git a/pcap.c b/pcap.c
index da669c5e08cc6c40758b293faa830063628311af..c26b888be5cf2b0f3276a8be5a190512f0c84f10 100644 (file)
--- a/pcap.c
+++ b/pcap.c
@@ -3037,10 +3037,11 @@ static struct dlt_choice dlt_choices[] = {
        DLT_CHOICE(SITA, "SITA pseudo-header"),
        DLT_CHOICE(ERF, "Endace ERF header"),
        DLT_CHOICE(RAIF1, "Ethernet with u10 Networks pseudo-header"),
-       DLT_CHOICE(IPMB, "IPMB"),
+       DLT_CHOICE(IPMB_KONTRON, "IPMB with Kontron pseudo-header"),
        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(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 4c8b1178b704daa197928728ddf97e5c9f82d2c4..de8089b2307905b3084782cac056d97b78ae84c7 100644 (file)
 #define DLT_RAIF1              198
 
 /*
- * IPMB packet for IPMI, beginning with the I2C slave address, followed
- * by the netFn and LUN, etc..  Requested by Chanthy Toeung
- */
-#define DLT_IPMB               199
+ * IPMB packet for IPMI, beginning with a 2-byte header, followed by
+ * the I2C slave address, followed by the netFn and LUN, etc..
+ * Requested by Chanthy Toeung <[email protected]>.
+ *
+ * XXX - this used to be called DLT_IPMB, back when we got the
+ * impression from the email thread requesting it that the packet
+ * had no extra 2-byte header.  We've renamed it; if anybody used
+ * DLT_IPMB and assumed no 2-byte header, this will cause the compile
+ * to fail, at which point we'll have to figure out what to do about
+ * the two header types using the same DLT_/LINKTYPE_ value.  If that
+ * doesn't happen, we'll assume nobody used it and that the redefinition
+ * is safe.
+ */
+#define DLT_IPMB_KONTRON       199
 
 /*
  * Juniper-private data link type, as per request from