@@ -496,6 +496,22 @@ s! {
496
496
pub flag: * mut :: c_int,
497
497
pub val: :: c_int,
498
498
}
499
+
500
+ pub struct __c_anonymous_ifru_map {
501
+ pub mem_start: :: c_ulong,
502
+ pub mem_end: :: c_ulong,
503
+ pub base_addr: :: c_ushort,
504
+ pub irq: :: c_uchar,
505
+ pub dma: :: c_uchar,
506
+ pub port: :: c_uchar,
507
+ }
508
+
509
+ pub struct in6_ifreq {
510
+ pub ifr6_addr: :: in6_addr,
511
+ pub ifr6_prefixlen: u32 ,
512
+ pub ifr6_ifindex: :: c_int,
513
+ }
514
+
499
515
}
500
516
501
517
s_no_extra_traits ! {
@@ -591,6 +607,50 @@ s_no_extra_traits! {
591
607
__serial: :: c_uint,
592
608
__value: [ [ :: c_char; 4 ] ; 23 ] ,
593
609
}
610
+
611
+ #[ cfg( libc_union) ]
612
+ pub union __c_anonymous_ifr_ifru {
613
+ pub ifru_addr: :: sockaddr,
614
+ pub ifru_dstaddr: :: sockaddr,
615
+ pub ifru_broadaddr: :: sockaddr,
616
+ pub ifru_netmask: :: sockaddr,
617
+ pub ifru_hwaddr: :: sockaddr,
618
+ pub ifru_flags: :: c_short,
619
+ pub ifru_ifindex: :: c_int,
620
+ pub ifru_metric: :: c_int,
621
+ pub ifru_mtu: :: c_int,
622
+ pub ifru_map: __c_anonymous_ifru_map,
623
+ pub ifru_slave: [ :: c_char; :: IFNAMSIZ ] ,
624
+ pub ifru_newname: [ :: c_char; :: IFNAMSIZ ] ,
625
+ pub ifru_data: * mut :: c_char,
626
+ }
627
+
628
+ pub struct ifreq {
629
+ /// interface name, e.g. "en0"
630
+ pub ifr_name: [ :: c_char; :: IFNAMSIZ ] ,
631
+ #[ cfg( libc_union) ]
632
+ pub ifr_ifru: __c_anonymous_ifr_ifru,
633
+ #[ cfg( not( libc_union) ) ]
634
+ pub ifr_ifru: :: sockaddr,
635
+ }
636
+
637
+ #[ cfg( libc_union) ]
638
+ pub union __c_anonymous_ifc_ifcu {
639
+ pub ifcu_buf: * mut :: c_char,
640
+ pub ifcu_req: * mut :: ifreq,
641
+ }
642
+
643
+ /* Structure used in SIOCGIFCONF request. Used to retrieve interface
644
+ configuration for machine (useful for programs which must know all
645
+ networks accessible). */
646
+ pub struct ifconf {
647
+ pub ifc_len: :: c_int, /* Size of buffer. */
648
+ #[ cfg( libc_union) ]
649
+ pub ifc_ifcu: __c_anonymous_ifc_ifcu,
650
+ #[ cfg( not( libc_union) ) ]
651
+ pub ifc_ifcu: * mut :: ifreq,
652
+ }
653
+
594
654
}
595
655
596
656
cfg_if ! {
@@ -938,6 +998,53 @@ cfg_if! {
938
998
}
939
999
}
940
1000
1001
+ #[ cfg( libc_union) ]
1002
+ impl :: fmt:: Debug for __c_anonymous_ifr_ifru {
1003
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
1004
+ f. debug_struct( "ifr_ifru" )
1005
+ . field( "ifru_addr" , unsafe { & self . ifru_addr } )
1006
+ . field( "ifru_dstaddr" , unsafe { & self . ifru_dstaddr } )
1007
+ . field( "ifru_broadaddr" , unsafe { & self . ifru_broadaddr } )
1008
+ . field( "ifru_netmask" , unsafe { & self . ifru_netmask } )
1009
+ . field( "ifru_hwaddr" , unsafe { & self . ifru_hwaddr } )
1010
+ . field( "ifru_flags" , unsafe { & self . ifru_flags } )
1011
+ . field( "ifru_ifindex" , unsafe { & self . ifru_ifindex } )
1012
+ . field( "ifru_metric" , unsafe { & self . ifru_metric } )
1013
+ . field( "ifru_mtu" , unsafe { & self . ifru_mtu } )
1014
+ . field( "ifru_map" , unsafe { & self . ifru_map } )
1015
+ . field( "ifru_slave" , unsafe { & self . ifru_slave } )
1016
+ . field( "ifru_newname" , unsafe { & self . ifru_newname } )
1017
+ . field( "ifru_data" , unsafe { & self . ifru_data } )
1018
+ . finish( )
1019
+ }
1020
+ }
1021
+ impl :: fmt:: Debug for ifreq {
1022
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
1023
+ f. debug_struct( "ifreq" )
1024
+ . field( "ifr_name" , & self . ifr_name)
1025
+ . field( "ifr_ifru" , & self . ifr_ifru)
1026
+ . finish( )
1027
+ }
1028
+ }
1029
+
1030
+ #[ cfg( libc_union) ]
1031
+ impl :: fmt:: Debug for __c_anonymous_ifc_ifcu {
1032
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
1033
+ f. debug_struct( "ifr_ifru" )
1034
+ . field( "ifcu_buf" , unsafe { & self . ifcu_buf } )
1035
+ . field( "ifcu_req" , unsafe { & self . ifcu_req } )
1036
+ . finish( )
1037
+ }
1038
+ }
1039
+ impl :: fmt:: Debug for ifconf {
1040
+ fn fmt( & self , f: & mut :: fmt:: Formatter ) -> :: fmt:: Result {
1041
+ f. debug_struct( "ifconf" )
1042
+ . field( "ifc_len" , & self . ifc_len)
1043
+ . field( "ifc_ifcu" , & self . ifc_ifcu)
1044
+ . finish( )
1045
+ }
1046
+ }
1047
+
941
1048
#[ allow( deprecated) ]
942
1049
impl af_alg_iv {
943
1050
fn as_slice( & self ) -> & [ u8 ] {
@@ -2715,6 +2822,7 @@ pub const NFEA_DONT_REFRESH: ::c_ushort = 2;
2715
2822
2716
2823
pub const SIOCADDRT : :: c_ulong = 0x0000890B ;
2717
2824
pub const SIOCDELRT : :: c_ulong = 0x0000890C ;
2825
+ pub const SIOCRTMSG : :: c_ulong = 0x0000890D ;
2718
2826
pub const SIOCGIFNAME : :: c_ulong = 0x00008910 ;
2719
2827
pub const SIOCSIFLINK : :: c_ulong = 0x00008911 ;
2720
2828
pub const SIOCGIFCONF : :: c_ulong = 0x00008912 ;
@@ -2734,6 +2842,7 @@ pub const SIOCGIFMEM: ::c_ulong = 0x0000891F;
2734
2842
pub const SIOCSIFMEM : :: c_ulong = 0x00008920 ;
2735
2843
pub const SIOCGIFMTU : :: c_ulong = 0x00008921 ;
2736
2844
pub const SIOCSIFMTU : :: c_ulong = 0x00008922 ;
2845
+ pub const SIOCSIFNAME : :: c_ulong = 0x00008923 ;
2737
2846
pub const SIOCSIFHWADDR : :: c_ulong = 0x00008924 ;
2738
2847
pub const SIOCGIFENCAP : :: c_ulong = 0x00008925 ;
2739
2848
pub const SIOCSIFENCAP : :: c_ulong = 0x00008926 ;
@@ -2742,6 +2851,24 @@ pub const SIOCGIFSLAVE: ::c_ulong = 0x00008929;
2742
2851
pub const SIOCSIFSLAVE : :: c_ulong = 0x00008930 ;
2743
2852
pub const SIOCADDMULTI : :: c_ulong = 0x00008931 ;
2744
2853
pub const SIOCDELMULTI : :: c_ulong = 0x00008932 ;
2854
+ pub const SIOCGIFINDEX : :: c_ulong = 0x00008933 ;
2855
+ pub const SIOGIFINDEX : :: c_ulong = SIOCGIFINDEX ;
2856
+ pub const SIOCSIFPFLAGS : :: c_ulong = 0x00008934 ;
2857
+ pub const SIOCGIFPFLAGS : :: c_ulong = 0x00008935 ;
2858
+ pub const SIOCDIFADDR : :: c_ulong = 0x00008936 ;
2859
+ pub const SIOCSIFHWBROADCAST : :: c_ulong = 0x00008937 ;
2860
+ pub const SIOCGIFCOUNT : :: c_ulong = 0x00008938 ;
2861
+ pub const SIOCGIFBR : :: c_ulong = 0x00008940 ;
2862
+ pub const SIOCSIFBR : :: c_ulong = 0x00008941 ;
2863
+ pub const SIOCGIFTXQLEN : :: c_ulong = 0x00008942 ;
2864
+ pub const SIOCSIFTXQLEN : :: c_ulong = 0x00008943 ;
2865
+ pub const SIOCETHTOOL : :: c_ulong = 0x00008946 ;
2866
+ pub const SIOCGMIIPHY : :: c_ulong = 0x00008947 ;
2867
+ pub const SIOCGMIIREG : :: c_ulong = 0x00008948 ;
2868
+ pub const SIOCSMIIREG : :: c_ulong = 0x00008949 ;
2869
+ pub const SIOCWANDEV : :: c_ulong = 0x0000894A ;
2870
+ pub const SIOCOUTQNSD : :: c_ulong = 0x0000894B ;
2871
+ pub const SIOCGSKNS : :: c_ulong = 0x0000894C ;
2745
2872
pub const SIOCDARP : :: c_ulong = 0x00008953 ;
2746
2873
pub const SIOCGARP : :: c_ulong = 0x00008954 ;
2747
2874
pub const SIOCSARP : :: c_ulong = 0x00008955 ;
@@ -2750,6 +2877,24 @@ pub const SIOCGRARP: ::c_ulong = 0x00008961;
2750
2877
pub const SIOCSRARP : :: c_ulong = 0x00008962 ;
2751
2878
pub const SIOCGIFMAP : :: c_ulong = 0x00008970 ;
2752
2879
pub const SIOCSIFMAP : :: c_ulong = 0x00008971 ;
2880
+ pub const SIOCADDDLCI : :: c_ulong = 0x00008980 ;
2881
+ pub const SIOCDELDLCI : :: c_ulong = 0x00008981 ;
2882
+ pub const SIOCGIFVLAN : :: c_ulong = 0x00008982 ;
2883
+ pub const SIOCSIFVLAN : :: c_ulong = 0x00008983 ;
2884
+ pub const SIOCBONDENSLAVE : :: c_ulong = 0x00008990 ;
2885
+ pub const SIOCBONDRELEASE : :: c_ulong = 0x00008991 ;
2886
+ pub const SIOCBONDSETHWADDR : :: c_ulong = 0x00008992 ;
2887
+ pub const SIOCBONDSLAVEINFOQUERY : :: c_ulong = 0x00008993 ;
2888
+ pub const SIOCBONDINFOQUERY : :: c_ulong = 0x00008994 ;
2889
+ pub const SIOCBONDCHANGEACTIVE : :: c_ulong = 0x00008995 ;
2890
+ pub const SIOCBRADDBR : :: c_ulong = 0x000089a0 ;
2891
+ pub const SIOCBRDELBR : :: c_ulong = 0x000089a1 ;
2892
+ pub const SIOCBRADDIF : :: c_ulong = 0x000089a2 ;
2893
+ pub const SIOCBRDELIF : :: c_ulong = 0x000089a3 ;
2894
+ pub const SIOCSHWTSTAMP : :: c_ulong = 0x000089b0 ;
2895
+ pub const SIOCGHWTSTAMP : :: c_ulong = 0x000089b1 ;
2896
+ pub const SIOCDEVPRIVATE : :: c_ulong = 0x000089F0 ;
2897
+ pub const SIOCPROTOPRIVATE : :: c_ulong = 0x000089E0 ;
2753
2898
2754
2899
// linux/module.h
2755
2900
pub const MODULE_INIT_IGNORE_MODVERSIONS : :: c_uint = 0x0001 ;
0 commit comments