]> The Tcpdump Group git mirrors - libpcap/blobdiff - pcap-common.c
Merge pull request #796 from ffainelli/dsa
[libpcap] / pcap-common.c
index e2bfbb2f704523dfdf6f4c981a25a70342ba7613..5b45f58d5e9ae5857a54f4e93f6bacee2f4fd940 100644 (file)
@@ -1306,18 +1306,30 @@ linktype_to_dlt(int linktype)
 /*
  * Return the maximum snapshot length for a given DLT_ value.
  *
- * For most link-layer types, we use MAXIMUM_SNAPLEN, but for DLT_DBUS,
- * the maximum is 134217728, as per
+ * For most link-layer types, we use MAXIMUM_SNAPLEN.
+ *
+ * For DLT_DBUS, the maximum is 134217728, as per
  *
  *    https://dbus.freedesktop.org/doc/dbus-specification.html#message-protocol-messages
+ *
+ * For DLT_EBHSCR, the maximum is 8MB, as per
+ *
+ *    https://www.elektrobit.com/ebhscr
  */
 u_int
 max_snaplen_for_dlt(int dlt)
 {
-       if (dlt == DLT_DBUS)
+       switch (dlt) {
+
+       case DLT_DBUS:
                return 134217728;
-       else
+
+       case DLT_EBHSCR:
+               return 8*1024*1024;
+
+       default:
                return MAXIMUM_SNAPLEN;
+       }
 }
 
 /*