@@ -533,6 +533,14 @@ s! {
533
533
pub key: * mut :: c_char,
534
534
pub data: * mut :: c_void,
535
535
}
536
+
537
+ pub struct ifreq {
538
+ pub ifr_name: [ :: c_char; :: IFNAMSIZ ] ,
539
+ #[ cfg( libc_union) ]
540
+ pub ifr_ifru: __c_anonymous_ifr_ifru,
541
+ #[ cfg( not( libc_union) ) ]
542
+ pub ifr_ifru: :: sockaddr,
543
+ }
536
544
}
537
545
538
546
impl siginfo_t {
@@ -608,6 +616,18 @@ s_no_extra_traits! {
608
616
align: [ :: c_char; 160 ] ,
609
617
}
610
618
619
+ #[ cfg( libc_union) ]
620
+ pub union __c_anonymous_ifr_ifru {
621
+ pub ifru_addr: :: sockaddr,
622
+ pub ifru_dstaddr: :: sockaddr,
623
+ pub ifru_broadaddr: :: sockaddr,
624
+ pub ifru_flags: :: c_short,
625
+ pub ifru_metric: :: c_int,
626
+ pub ifru_vnetid: i64 ,
627
+ pub ifru_media: u64 ,
628
+ pub ifru_data: * mut :: c_char,
629
+ pub ifru_index: :: c_uint,
630
+ }
611
631
}
612
632
613
633
cfg_if ! {
@@ -814,6 +834,60 @@ cfg_if! {
814
834
unsafe { self . align. hash( state) } ;
815
835
}
816
836
}
837
+
838
+ #[ cfg( libc_union) ]
839
+ impl PartialEq for __c_anonymous_ifr_ifru {
840
+ fn eq( & self , other: & __c_anonymous_ifr_ifru) -> bool {
841
+ unsafe {
842
+ self . ifru_addr == other. ifru_addr
843
+ && self . ifru_dstaddr == other. ifru_dstaddr
844
+ && self . ifru_broadaddr == other. ifru_broadaddr
845
+ && self . ifru_flags == other. ifru_flags
846
+ && self . ifru_metric == other. ifru_metric
847
+ && self . ifru_vnetid == other. ifru_vnetid
848
+ && self . ifru_media == other. ifru_media
849
+ && self . ifru_data == other. ifru_data
850
+ && self . ifru_index == other. ifru_index
851
+ }
852
+ }
853
+ }
854
+
855
+ #[ cfg( libc_union) ]
856
+ impl Eq for __c_anonymous_ifr_ifru { }
857
+
858
+ #[ cfg( libc_union) ]
859
+ impl :: fmt:: Debug for __c_anonymous_ifr_ifru {
860
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
861
+ f. debug_struct( "__c_anonymous_ifr_ifru" )
862
+ . field( "ifru_addr" , unsafe { & self . ifru_addr } )
863
+ . field( "ifru_dstaddr" , unsafe { & self . ifru_dstaddr } )
864
+ . field( "ifru_broadaddr" , unsafe { & self . ifru_broadaddr } )
865
+ . field( "ifru_flags" , unsafe { & self . ifru_flags } )
866
+ . field( "ifru_metric" , unsafe { & self . ifru_metric } )
867
+ . field( "ifru_vnetid" , unsafe { & self . ifru_vnetid } )
868
+ . field( "ifru_media" , unsafe { & self . ifru_media } )
869
+ . field( "ifru_data" , unsafe { & self . ifru_data } )
870
+ . field( "ifru_index" , unsafe { & self . ifru_index } )
871
+ . finish( )
872
+ }
873
+ }
874
+
875
+ #[ cfg( libc_union) ]
876
+ impl :: hash:: Hash for __c_anonymous_ifr_ifru {
877
+ fn hash<H : :: hash:: Hasher >( & self , state: & mut H ) {
878
+ unsafe {
879
+ self . ifru_addr. hash( state) ;
880
+ self . ifru_dstaddr. hash( state) ;
881
+ self . ifru_broadaddr. hash( state) ;
882
+ self . ifru_flags. hash( state) ;
883
+ self . ifru_metric. hash( state) ;
884
+ self . ifru_vnetid. hash( state) ;
885
+ self . ifru_media. hash( state) ;
886
+ self . ifru_data. hash( state) ;
887
+ self . ifru_index. hash( state) ;
888
+ }
889
+ }
890
+ }
817
891
}
818
892
}
819
893
0 commit comments