File tree Expand file tree Collapse file tree 2 files changed +15
-0
lines changed Expand file tree Collapse file tree 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/).
99 ([ #1867 ] ( https://github.com/nix-rust/nix/pull/1867 ) )
1010- Added ` nix::ucontext ` module on ` aarch64-unknown-linux-gnu ` .
1111 (#[ 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 ) )
1214
1315### Changed
1416
Original file line number Diff line number Diff line change @@ -218,8 +218,21 @@ pub enum SockProtocol {
218218 #[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
219219 #[ cfg_attr( docsrs, doc( cfg( all( ) ) ) ) ]
220220 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 ,
221226}
222227
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+ }
223236#[ cfg( any( target_os = "linux" ) ) ]
224237libc_bitflags ! {
225238 /// Configuration flags for `SO_TIMESTAMPING` interface
You can’t perform that action at this time.
0 commit comments