@@ -277,6 +277,14 @@ s_no_extra_traits! {
277
277
pub vn_mode: u16 ,
278
278
pub vn_devname: [ :: c_char; :: SPECNAMELEN as usize + 1 ] ,
279
279
}
280
+
281
+ pub struct sockaddr_nl {
282
+ pub nl_len: :: c_uchar,
283
+ pub nl_family: :: sa_family_t,
284
+ nl_pad: :: c_ushort,
285
+ pub nl_pid: u32 ,
286
+ pub nl_groups: u32
287
+ }
280
288
}
281
289
282
290
cfg_if ! {
@@ -447,6 +455,34 @@ cfg_if! {
447
455
self_vn_devname. hash( state) ;
448
456
}
449
457
}
458
+
459
+ impl PartialEq for sockaddr_nl {
460
+ fn eq( & self , other: & sockaddr_nl) -> bool {
461
+ self . nl_len == other. nl_len &&
462
+ self . nl_family == other. nl_family &&
463
+ self . nl_pid == other. nl_pid &&
464
+ self . nl_groups == other. nl_groups
465
+ }
466
+ }
467
+ impl Eq for sockaddr_nl { }
468
+ impl :: fmt:: Debug for sockaddr_nl {
469
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
470
+ f. debug_struct( "sockaddr_nl" )
471
+ . field( "nl_len" , & self . nl_len)
472
+ . field( "nl_family" , & self . nl_family)
473
+ . field( "nl_pid" , & self . nl_pid)
474
+ . field( "nl_groups" , & self . nl_groups)
475
+ . finish( )
476
+ }
477
+ }
478
+ impl :: hash:: Hash for sockaddr_nl {
479
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
480
+ self . nl_len. hash( state) ;
481
+ self . nl_family. hash( state) ;
482
+ self . nl_pid. hash( state) ;
483
+ self . nl_groups. hash( state) ;
484
+ }
485
+ }
450
486
}
451
487
}
452
488
@@ -468,6 +504,42 @@ pub const DOMAINSET_POLICY_INTERLEAVE: ::c_int = 4;
468
504
469
505
pub const MINCORE_SUPER : :: c_int = 0x20 ;
470
506
507
+ /// netlink constants
508
+ pub const SOL_NETLINK : :: c_int = 270 ;
509
+ pub const NETLINK_ADD_MEMBERSHIP : :: c_int = 1 ;
510
+ pub const NETLINK_DROP_MEMBERSHIP : :: c_int = 2 ;
511
+ pub const NETLINK_PKTINFO : :: c_int = 3 ;
512
+ pub const NETLINK_BROADCAST_ERROR : :: c_int = 4 ;
513
+ pub const NETLINK_NO_ENOBUFS : :: c_int = 5 ;
514
+ pub const NETLINK_RX_RING : :: c_int = 6 ;
515
+ pub const NETLINK_TX_RING : :: c_int = 7 ;
516
+ pub const NETLINK_LISTEN_ALL_NSID : :: c_int = 8 ;
517
+ pub const NETLINK_LIST_MEMBERSHIPS : :: c_int = 9 ;
518
+ pub const NETLINK_CAP_ACK : :: c_int = 10 ;
519
+ pub const NETLINK_EXT_ACK : :: c_int = 11 ;
520
+ pub const NETLINK_GET_STRICT_CHK : :: c_int = 12 ;
521
+
522
+ pub const AF_NETLINK : :: c_int = 38 ;
523
+ pub const PF_NETLINK : :: c_int = AF_NETLINK ;
524
+
525
+ pub const NETLINK_ROUTE : :: c_int = 0 ;
526
+ pub const NETLINK_UNUSED : :: c_int = 1 ;
527
+ pub const NETLINK_USERSOCK : :: c_int = 2 ;
528
+ pub const NETLINK_FIREWALL : :: c_int = 3 ;
529
+ pub const NETLINK_SOCK_DIAG : :: c_int = 4 ;
530
+ pub const NETLINK_NFLOG : :: c_int = 5 ;
531
+ pub const NETLINK_XFRM : :: c_int = 6 ;
532
+ pub const NETLINK_SELINUX : :: c_int = 7 ;
533
+ pub const NETLINK_ISCSI : :: c_int = 8 ;
534
+ pub const NETLINK_AUDIT : :: c_int = 9 ;
535
+ pub const NETLINK_FIB_LOOKUP : :: c_int = 10 ;
536
+ pub const NETLINK_CONNECTOR : :: c_int = 11 ;
537
+ pub const NETLINK_NETFILTER : :: c_int = 12 ;
538
+ pub const NETLINK_IP6_FW : :: c_int = 13 ;
539
+ pub const NETLINK_DNRTMSG : :: c_int = 14 ;
540
+ pub const NETLINK_KOBJECT_UEVENT : :: c_int = 15 ;
541
+ pub const NETLINK_GENERIC : :: c_int = 16 ;
542
+
471
543
safe_f ! {
472
544
pub { const } fn makedev( major: :: c_uint, minor: :: c_uint) -> :: dev_t {
473
545
let major = major as :: dev_t;
0 commit comments