Skip to content

Commit 40cfd1b

Browse files
committed
Auto merge of #2444 - djarek:linux-raw-can.h, r=JohnTitor
Define constants for CAN RAW socket options Add setsockopt constants from `linux/can/raw.h`, which allow configuring CAN_RAW sockets. Signed-off-by: Damian Jarek <damian.jarek93@gmail.com>
2 parents acc47b2 + 7d21f60 commit 40cfd1b

File tree

3 files changed

+17
-0
lines changed

3 files changed

+17
-0
lines changed

libc-test/build.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2568,6 +2568,7 @@ fn test_linux(target: &str) {
25682568
cfg:
25692569
"asm/mman.h",
25702570
"linux/can.h",
2571+
"linux/can/raw.h",
25712572
"linux/dccp.h",
25722573
"linux/errqueue.h",
25732574
"linux/falloc.h",

libc-test/semver/linux.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,6 +219,12 @@ CAN_SFF_ID_BITS
219219
CAN_SFF_MASK
220220
CAN_TP16
221221
CAN_TP20
222+
CAN_RAW_FILTER
223+
CAN_RAW_ERR_FILTER
224+
CAN_RAW_LOOPBACK
225+
CAN_RAW_RECV_OWN_MSGS
226+
CAN_RAW_FD_FRAMES
227+
CAN_RAW_JOIN_FILTERS
222228
CBAUD
223229
CBAUDEX
224230
CLD_CONTINUED
@@ -2025,6 +2031,7 @@ SOL_ALG
20252031
SOL_ATM
20262032
SOL_BLUETOOTH
20272033
SOL_CAN_BASE
2034+
SOL_CAN_RAW
20282035
SOL_DCCP
20292036
SOL_DECNET
20302037
SOL_ICMPV6

src/unix/linux_like/linux/mod.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3074,6 +3074,15 @@ pub const SOL_CAN_BASE: ::c_int = 100;
30743074
pub const CAN_INV_FILTER: canid_t = 0x20000000;
30753075
pub const CAN_RAW_FILTER_MAX: ::c_int = 512;
30763076

3077+
// linux/can/raw.h
3078+
pub const SOL_CAN_RAW: ::c_int = SOL_CAN_BASE + CAN_RAW;
3079+
pub const CAN_RAW_FILTER: ::c_int = 1;
3080+
pub const CAN_RAW_ERR_FILTER: ::c_int = 2;
3081+
pub const CAN_RAW_LOOPBACK: ::c_int = 3;
3082+
pub const CAN_RAW_RECV_OWN_MSGS: ::c_int = 4;
3083+
pub const CAN_RAW_FD_FRAMES: ::c_int = 5;
3084+
pub const CAN_RAW_JOIN_FILTERS: ::c_int = 6;
3085+
30773086
#[deprecated(
30783087
since = "0.2.102",
30793088
note = "Errnoeously uses c_int; should use c_short."

0 commit comments

Comments
 (0)