File tree 2 files changed +15
-0
lines changed
2 files changed +15
-0
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,8 @@ This project adheres to [Semantic Versioning](https://semver.org/).
9
9
([ #1867 ] ( https://github.com/nix-rust/nix/pull/1867 ) )
10
10
- Added ` nix::ucontext ` module on ` aarch64-unknown-linux-gnu ` .
11
11
(#[ 1662] ( https://github.com/nix-rust/nix/pull/1662 ) )
12
+ - Added ` CanRaw ` to ` SockProtocol ` and ` CanBcm ` as a separate ` SocProtocol ` constant.
13
+ ([ #1912 ] ( https://github.com/nix-rust/nix/pull/1912 ) )
12
14
13
15
### Changed
14
16
Original file line number Diff line number Diff line change @@ -218,8 +218,21 @@ pub enum SockProtocol {
218
218
#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
219
219
#[ cfg_attr( docsrs, doc( cfg( all( ) ) ) ) ]
220
220
EthAll = libc:: ETH_P_ALL . to_be ( ) ,
221
+ /// The Controller Area Network raw socket protocol
222
+ /// ([ref](https://docs.kernel.org/networking/can.html#how-to-use-socketcan))
223
+ #[ cfg( target_os = "linux" ) ]
224
+ #[ cfg_attr( docsrs, doc( cfg( all( ) ) ) ) ]
225
+ CanRaw = libc:: CAN_RAW ,
221
226
}
222
227
228
+ impl SockProtocol {
229
+ /// The Controller Area Network broadcast manager protocol
230
+ /// ([ref](https://docs.kernel.org/networking/can.html#how-to-use-socketcan))
231
+ #[ cfg( target_os = "linux" ) ]
232
+ #[ cfg_attr( docsrs, doc( cfg( all( ) ) ) ) ]
233
+ #[ allow( non_upper_case_globals) ]
234
+ pub const CanBcm : SockProtocol = SockProtocol :: NetlinkUserSock ; // Matches libc::CAN_BCM
235
+ }
223
236
#[ cfg( any( target_os = "linux" ) ) ]
224
237
libc_bitflags ! {
225
238
/// Configuration flags for `SO_TIMESTAMPING` interface
You can’t perform that action at this time.
0 commit comments