@@ -132,11 +132,6 @@ pub enum SockProtocol {
132
132
Udp = libc:: IPPROTO_UDP ,
133
133
/// Raw sockets ([raw(7)](https://man7.org/linux/man-pages/man7/raw.7.html))
134
134
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 ,
140
135
/// Allows applications to configure and control a KEXT
141
136
/// ([ref](https://developer.apple.com/library/content/documentation/Darwin/Conceptual/NKEConceptual/control/control.html))
142
137
#[ cfg( any( target_os = "ios" , target_os = "macos" ) ) ]
@@ -231,20 +226,33 @@ pub enum SockProtocol {
231
226
#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
232
227
#[ cfg_attr( docsrs, doc( cfg( all( ) ) ) ) ]
233
228
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 {
234
236
/// The Controller Area Network raw socket protocol
235
237
/// ([ref](https://docs.kernel.org/networking/can.html#how-to-use-socketcan))
236
238
#[ cfg( target_os = "linux" ) ]
237
239
#[ 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
240
242
241
- impl SockProtocol {
242
243
/// The Controller Area Network broadcast manager protocol
243
244
/// ([ref](https://docs.kernel.org/networking/can.html#how-to-use-socketcan))
244
245
#[ cfg( target_os = "linux" ) ]
245
246
#[ cfg_attr( docsrs, doc( cfg( all( ) ) ) ) ]
246
247
#[ allow( non_upper_case_globals) ]
247
248
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
248
256
}
249
257
#[ cfg( any( target_os = "android" , target_os = "linux" ) ) ]
250
258
libc_bitflags ! {
0 commit comments