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