Linux SocketCAN.
off_nl = -1;
off_nl_nosnap = -1;
return;
+
+ case DLT_CAN_SOCKETCAN:
+ /*
+ * Currently, only raw "link[N:M]" filtering is supported.
+ */
+ off_linktype = -1;
+ off_macpl = -1;
+ off_nl = -1;
+ off_nl_nosnap = -1;
+ return;
}
bpf_error("unknown data link type %d", linktype);
/* NOTREACHED */
bpf_error("Bluetooth link-layer type filtering not implemented");
case DLT_CAN20B:
- bpf_error("CAN20B link-layer type filtering not implemented");
+ case DLT_CAN_SOCKETCAN:
+ bpf_error("CAN link-layer type filtering not implemented");
case DLT_IEEE802_15_4:
case DLT_IEEE802_15_4_LINUX:
DLT_CHOICE(DLT_IEEE802_15_4_NONASK_PHY, "IEEE 802.15.4 with non-ASK PHY data"),
DLT_CHOICE(DLT_MPLS, "MPLS with label as link-layer header"),
DLT_CHOICE(DLT_USB_LINUX_MMAPPED, "USB with padded Linux header"),
+ DLT_CHOICE(DLT_DECT, "DECT"),
+ DLT_CHOICE(DLT_AOS, "AOS Space Data Link protocol"),
+ DLT_CHOICE(DLT_WIHART, "Wireless HART"),
+ DLT_CHOICE(DLT_FC_2, "Fibre Channel FC-2"),
+ DLT_CHOICE(DLT_FC_2_WITH_FRAME_DELIMS, "Fibre Channel FC-2 with frame delimiters"),
+ DLT_CHOICE(DLT_IPNET, "Solaris ipnet"),
+ DLT_CHOICE(DLT_CAN_SOCKETCAN, "CAN-bus with SocketCAN headers"),
DLT_CHOICE_SENTINEL
};
*/
#define DLT_IPNET 226
+/*
+ * CAN (Controller Area Network) frames, with a pseudo-header as supplied
+ * by Linux SocketCAN. See Documentation/networking/can.txt in the Linux
+ * source.
+ *
+ */
+#define DLT_CAN_SOCKETCAN 227
+
/*
* DLT and savefile link type values are split into a class and
*/
#define LINKTYPE_IPNET 226
+/*
+ * CAN (Controller Area Network) frames, with a pseudo-header as supplied
+ * by Linux SocketCAN. See Documentation/networking/can.txt in the Linux
+ * source.
+ *
+ */
+#define LINKTYPE_CAN_SOCKETCAN 227
+
static struct linktype_map {
int dlt;
/* Solaris IPNET */
{ DLT_IPNET, LINKTYPE_IPNET },
+ /* CAN frames with SocketCAN headers */
+ { DLT_CAN_SOCKETCAN, LINKTYPE_CAN_SOCKETCAN },
+
{ -1, -1 }
};