@@ -132,11 +132,6 @@ pub enum SockProtocol {
132132 Udp = libc:: IPPROTO_UDP ,
133133 /// Raw sockets ([raw(7)](https://man7.org/linux/man-pages/man7/raw.7.html))
134134 Raw = libc:: IPPROTO_RAW ,
135- /// Allows applications and other KEXTs to be notified when certain kernel events occur
136- /// ([ref](https://developer.apple.com/library/content/documentation/Darwin/Conceptual/NKEConceptual/control/control.html))
137- #[ cfg( any( target_os = "ios" , target_os = "macos" ) ) ]
138- #[ cfg_attr( docsrs, doc( cfg( all( ) ) ) ) ]
139- KextEvent = libc:: SYSPROTO_EVENT ,
140135 /// Allows applications to configure and control a KEXT
141136 /// ([ref](https://developer.apple.com/library/content/documentation/Darwin/Conceptual/NKEConceptual/control/control.html))
142137 #[ cfg( any( target_os = "ios" , target_os = "macos" ) ) ]
@@ -231,20 +226,33 @@ pub enum SockProtocol {
231226 #[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
232227 #[ cfg_attr( docsrs, doc( cfg( all( ) ) ) ) ]
233228 EthAll = ( libc:: ETH_P_ALL as u16 ) . to_be ( ) as i32 ,
229+ /// ICMP protocol ([icmp(7)](https://man7.org/linux/man-pages/man7/icmp.7.html))
230+ Icmp = libc:: IPPROTO_ICMP ,
231+ /// ICMPv6 protocol (ICMP over IPv6)
232+ IcmpV6 = libc:: IPPROTO_ICMPV6 ,
233+ }
234+
235+ impl SockProtocol {
234236 /// The Controller Area Network raw socket protocol
235237 /// ([ref](https://docs.kernel.org/networking/can.html#how-to-use-socketcan))
236238 #[ cfg( target_os = "linux" ) ]
237239 #[ cfg_attr( docsrs, doc( cfg( all( ) ) ) ) ]
238- CanRaw = libc :: CAN_RAW ,
239- }
240+ # [ allow ( non_upper_case_globals ) ]
241+ pub const CanRaw : SockProtocol = SockProtocol :: Icmp ; // Matches libc::CAN_RAW
240242
241- impl SockProtocol {
242243 /// The Controller Area Network broadcast manager protocol
243244 /// ([ref](https://docs.kernel.org/networking/can.html#how-to-use-socketcan))
244245 #[ cfg( target_os = "linux" ) ]
245246 #[ cfg_attr( docsrs, doc( cfg( all( ) ) ) ) ]
246247 #[ allow( non_upper_case_globals) ]
247248 pub const CanBcm : SockProtocol = SockProtocol :: NetlinkUserSock ; // Matches libc::CAN_BCM
249+
250+ /// Allows applications and other KEXTs to be notified when certain kernel events occur
251+ /// ([ref](https://developer.apple.com/library/content/documentation/Darwin/Conceptual/NKEConceptual/control/control.html))
252+ #[ cfg( any( target_os = "ios" , target_os = "macos" ) ) ]
253+ #[ cfg_attr( docsrs, doc( cfg( all( ) ) ) ) ]
254+ #[ allow( non_upper_case_globals) ]
255+ pub const KextEvent : SockProtocol = SockProtocol :: Icmp ; // Matches libc::SYSPROTO_EVENT
248256}
249257#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
250258libc_bitflags ! {
0 commit comments