unix: add SetsockoptCanRawFilter for linux

Add the SetsockoptCanRawFilter func and CanFilter type to allow kernel
message filtering on AF_CAN sockets.

Fixes golang/go#29638

Change-Id: I4042825527ba2bc9aeb8dbe70d1960a06b15c29e
Reviewed-on: https://go-review.googlesource.com/c/163318
Run-TryBot: Tobias Klauser <tobias.klauser@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Tobias Klauser
2019-02-22 07:27:16 +00:00
committed by Tobias Klauser
parent ec7b60b042
commit a9d3bda3a2
15 changed files with 89 additions and 0 deletions
+3
View File
@@ -493,6 +493,8 @@ type Ucred C.struct_ucred
type TCPInfo C.struct_tcp_info
type CanFilter C.struct_can_filter
const (
SizeofSockaddrInet4 = C.sizeof_struct_sockaddr_in
SizeofSockaddrInet6 = C.sizeof_struct_sockaddr_in6
@@ -522,6 +524,7 @@ const (
SizeofICMPv6Filter = C.sizeof_struct_icmp6_filter
SizeofUcred = C.sizeof_struct_ucred
SizeofTCPInfo = C.sizeof_struct_tcp_info
SizeofCanFilter = C.sizeof_struct_can_filter
)
// Netlink routing and interface messages