From 541bdb97bb22a8179534244dbc2f75a91ef6bab4 Mon Sep 17 00:00:00 2001 From: Stephan Klatt Date: Fri, 28 Aug 2020 14:46:59 +0200 Subject: [PATCH] unix: add constants for raw CAN sockets Fixes golang/go#41091 --- unix/linux/types.go | 12 ++++++++++++ unix/mkerrors.sh | 1 + unix/zerrors_linux.go | 1 + unix/ztypes_linux.go | 9 +++++++++ 4 files changed, 23 insertions(+) diff --git a/unix/linux/types.go b/unix/linux/types.go index 1f9176bd..f3c23964 100644 --- a/unix/linux/types.go +++ b/unix/linux/types.go @@ -81,6 +81,7 @@ struct termios2 { #include #include #include +#include #include #include #include @@ -2481,3 +2482,14 @@ const ( NHA_GROUPS = C.NHA_GROUPS NHA_MASTER = C.NHA_MASTER ) + +// raw CAN sockets + +const ( + CAN_RAW_FILTER = C.CAN_RAW_FILTER + CAN_RAW_ERR_FILTER = C.CAN_RAW_ERR_FILTER + CAN_RAW_LOOPBACK = C.CAN_RAW_LOOPBACK + CAN_RAW_RECV_OWN_MSGS = C.CAN_RAW_RECV_OWN_MSGS + CAN_RAW_FD_FRAMES = C.CAN_RAW_FD_FRAMES + CAN_RAW_JOIN_FILTERS = C.CAN_RAW_JOIN_FILTERS +) diff --git a/unix/mkerrors.sh b/unix/mkerrors.sh index d46fb8a9..cab45604 100755 --- a/unix/mkerrors.sh +++ b/unix/mkerrors.sh @@ -194,6 +194,7 @@ struct ltchars { #include #include #include +#include #include #include #include diff --git a/unix/zerrors_linux.go b/unix/zerrors_linux.go index a274da7a..388050a0 100644 --- a/unix/zerrors_linux.go +++ b/unix/zerrors_linux.go @@ -2043,6 +2043,7 @@ const ( SOL_ATM = 0x108 SOL_CAIF = 0x116 SOL_CAN_BASE = 0x64 + SOL_CAN_RAW = 0x65 SOL_DCCP = 0x10d SOL_DECNET = 0x105 SOL_ICMPV6 = 0x3a diff --git a/unix/ztypes_linux.go b/unix/ztypes_linux.go index 953166c7..1879d578 100644 --- a/unix/ztypes_linux.go +++ b/unix/ztypes_linux.go @@ -2527,3 +2527,12 @@ const ( NHA_GROUPS = 0x9 NHA_MASTER = 0xa ) + +const ( + CAN_RAW_FILTER = 0x1 + CAN_RAW_ERR_FILTER = 0x2 + CAN_RAW_LOOPBACK = 0x3 + CAN_RAW_RECV_OWN_MSGS = 0x4 + CAN_RAW_FD_FRAMES = 0x5 + CAN_RAW_JOIN_FILTERS = 0x6 +)