| ... | @@ -6784,7 +6784,258 @@ pub const termios2 = if (is_mips) extern struct { | ... | @@ -6784,7 +6784,258 @@ pub const termios2 = if (is_mips) extern struct { |
| 6784 | ospeed: speed_t, | 6784 | ospeed: speed_t, |
| 6785 | }; | 6785 | }; |
| 6786 | | 6786 | |
| | 6787 | /// Linux-specific socket ioctls |
| | 6788 | pub const SIOCINQ = T.FIONREAD; |
| | 6789 | |
| | 6790 | /// Linux-specific socket ioctls |
| | 6791 | /// output queue size (not sent + not acked) |
| | 6792 | pub const SIOCOUTQ = T.IOCOUTQ; |
| | 6793 | |
| | 6794 | pub const SOCK_IOC_TYPE = 0x89; |
| | 6795 | |
| | 6796 | pub const SIOCGSTAMP_NEW = IOCTL.IOR(SOCK_IOC_TYPE, 0x06, i64[2]); |
| | 6797 | pub const SIOCGSTAMP_OLD = IOCTL.IOR('s', 100, timeval); |
| | 6798 | |
| | 6799 | /// Get stamp (timeval) |
| | 6800 | pub const SIOCGSTAMP = if (native_arch == .x86_64 or @sizeOf(timeval) == 8) SIOCGSTAMP_OLD else SIOCGSTAMP_NEW; |
| | 6801 | |
| | 6802 | pub const SIOCGSTAMPNS_NEW = IOCTL.IOR(SOCK_IOC_TYPE, 0x07, i64[2]); |
| | 6803 | pub const SIOCGSTAMPNS_OLD = IOCTL.IOR('s', 101, kernel_timespec); |
| | 6804 | |
| | 6805 | /// Get stamp (timespec) |
| | 6806 | pub const SIOCGSTAMPNS = if (native_arch == .x86_64 or @sizeOf(timespec) == 8) SIOCGSTAMPNS_OLD else SIOCGSTAMPNS_NEW; |
| | 6807 | |
| | 6808 | // Routing table calls. |
| | 6809 | /// Add routing table entry |
| | 6810 | pub const SIOCADDRT = 0x890B; |
| | 6811 | |
| | 6812 | /// Delete routing table entry |
| | 6813 | pub const SIOCDELRT = 0x890C; |
| | 6814 | |
| | 6815 | /// Unused |
| | 6816 | pub const SIOCRTMSG = 0x890D; |
| | 6817 | |
| | 6818 | // Socket configuration controls. |
| | 6819 | /// Get iface name |
| | 6820 | pub const SIOCGIFNAME = 0x8910; |
| | 6821 | |
| | 6822 | /// Set iface channel |
| | 6823 | pub const SIOCSIFLINK = 0x8911; |
| | 6824 | |
| | 6825 | /// Get iface list |
| | 6826 | pub const SIOCGIFCONF = 0x8912; |
| | 6827 | |
| | 6828 | /// Get flags |
| | 6829 | pub const SIOCGIFFLAGS = 0x8913; |
| | 6830 | |
| | 6831 | /// Set flags |
| | 6832 | pub const SIOCSIFFLAGS = 0x8914; |
| | 6833 | |
| | 6834 | /// Get PA address |
| | 6835 | pub const SIOCGIFADDR = 0x8915; |
| | 6836 | |
| | 6837 | /// Set PA address |
| | 6838 | pub const SIOCSIFADDR = 0x8916; |
| | 6839 | |
| | 6840 | /// Get remote PA address |
| | 6841 | pub const SIOCGIFDSTADDR = 0x8917; |
| | 6842 | |
| | 6843 | /// Set remote PA address |
| | 6844 | pub const SIOCSIFDSTADDR = 0x8918; |
| | 6845 | |
| | 6846 | /// Get broadcast PA address |
| | 6847 | pub const SIOCGIFBRDADDR = 0x8919; |
| | 6848 | |
| | 6849 | /// Set broadcast PA address |
| | 6850 | pub const SIOCSIFBRDADDR = 0x891a; |
| | 6851 | |
| | 6852 | /// Get network PA mask |
| | 6853 | pub const SIOCGIFNETMASK = 0x891b; |
| | 6854 | |
| | 6855 | /// Set network PA mask |
| | 6856 | pub const SIOCSIFNETMASK = 0x891c; |
| | 6857 | |
| | 6858 | /// Get metric |
| | 6859 | pub const SIOCGIFMETRIC = 0x891d; |
| | 6860 | |
| | 6861 | /// Set metric |
| | 6862 | pub const SIOCSIFMETRIC = 0x891e; |
| | 6863 | |
| | 6864 | /// Get memory address (BSD) |
| | 6865 | pub const SIOCGIFMEM = 0x891f; |
| | 6866 | |
| | 6867 | /// Set memory address (BSD) |
| | 6868 | pub const SIOCSIFMEM = 0x8920; |
| | 6869 | |
| | 6870 | /// Get MTU size |
| | 6871 | pub const SIOCGIFMTU = 0x8921; |
| | 6872 | |
| | 6873 | /// Set MTU size |
| | 6874 | pub const SIOCSIFMTU = 0x8922; |
| | 6875 | |
| | 6876 | /// Set interface name |
| | 6877 | pub const SIOCSIFNAME = 0x8923; |
| | 6878 | |
| | 6879 | /// Set hardware address |
| | 6880 | pub const SIOCSIFHWADDR = 0x8924; |
| | 6881 | |
| | 6882 | /// Get encapsulations |
| | 6883 | pub const SIOCGIFENCAP = 0x8925; |
| | 6884 | |
| | 6885 | /// Set encapsulations |
| | 6886 | pub const SIOCSIFENCAP = 0x8926; |
| | 6887 | |
| | 6888 | /// Get hardware address |
| | 6889 | pub const SIOCGIFHWADDR = 0x8927; |
| | 6890 | |
| | 6891 | /// Driver slaving support |
| | 6892 | pub const SIOCGIFSLAVE = 0x8929; |
| | 6893 | |
| | 6894 | /// Driver slaving support |
| | 6895 | pub const SIOCSIFSLAVE = 0x8930; |
| | 6896 | |
| | 6897 | /// Add to Multicast address lists |
| | 6898 | pub const SIOCADDMULTI = 0x8931; |
| | 6899 | |
| | 6900 | /// Delete from Multicast address lists |
| | 6901 | pub const SIOCDELMULTI = 0x8932; |
| | 6902 | |
| | 6903 | /// name -> if_index mapping |
| 6787 | pub const SIOCGIFINDEX = 0x8933; | 6904 | pub const SIOCGIFINDEX = 0x8933; |
| | 6905 | |
| | 6906 | /// Set extended flags set |
| | 6907 | pub const SIOCSIFPFLAGS = 0x8934; |
| | 6908 | |
| | 6909 | /// Get extended flags set |
| | 6910 | pub const SIOCGIFPFLAGS = 0x8935; |
| | 6911 | |
| | 6912 | /// Delete PA address |
| | 6913 | pub const SIOCDIFADDR = 0x8936; |
| | 6914 | |
| | 6915 | /// Set hardware broadcast addr |
| | 6916 | pub const SIOCSIFHWBROADCAST = 0x8937; |
| | 6917 | |
| | 6918 | /// Get number of devices |
| | 6919 | pub const SIOCGIFCOUNT = 0x8938; |
| | 6920 | |
| | 6921 | /// Bridging support |
| | 6922 | pub const SIOCGIFBR = 0x8940; |
| | 6923 | |
| | 6924 | /// Set bridging options |
| | 6925 | pub const SIOCSIFBR = 0x8941; |
| | 6926 | |
| | 6927 | /// Get the tx queue length |
| | 6928 | pub const SIOCGIFTXQLEN = 0x8942; |
| | 6929 | |
| | 6930 | /// Set the tx queue length |
| | 6931 | pub const SIOCSIFTXQLEN = 0x8943; |
| | 6932 | |
| | 6933 | /// Ethtool interface |
| | 6934 | pub const SIOCETHTOOL = 0x8946; |
| | 6935 | |
| | 6936 | /// Get address of MII PHY in use. |
| | 6937 | pub const SIOCGMIIPHY = 0x8947; |
| | 6938 | |
| | 6939 | /// Read MII PHY register. |
| | 6940 | pub const SIOCGMIIREG = 0x8948; |
| | 6941 | |
| | 6942 | /// Write MII PHY register. |
| | 6943 | pub const SIOCSMIIREG = 0x8949; |
| | 6944 | |
| | 6945 | /// Get / Set netdev parameters |
| | 6946 | pub const SIOCWANDEV = 0x894A; |
| | 6947 | |
| | 6948 | /// Output queue size (not sent only) |
| | 6949 | pub const SIOCOUTQNSD = 0x894B; |
| | 6950 | |
| | 6951 | /// Get socket network namespace |
| | 6952 | pub const SIOCGSKNS = 0x894C; |
| | 6953 | |
| | 6954 | // ARP cache control calls. |
| | 6955 | // 0x8950 - 0x8952 obsolete calls. |
| | 6956 | /// Delete ARP table entry |
| | 6957 | pub const SIOCDARP = 0x8953; |
| | 6958 | |
| | 6959 | /// Get ARP table entry |
| | 6960 | pub const SIOCGARP = 0x8954; |
| | 6961 | |
| | 6962 | /// Set ARP table entry |
| | 6963 | pub const SIOCSARP = 0x8955; |
| | 6964 | |
| | 6965 | // RARP cache control calls. |
| | 6966 | /// Delete RARP table entry |
| | 6967 | pub const SIOCDRARP = 0x8960; |
| | 6968 | |
| | 6969 | /// Get RARP table entry |
| | 6970 | pub const SIOCGRARP = 0x8961; |
| | 6971 | |
| | 6972 | /// Set RARP table entry |
| | 6973 | pub const SIOCSRARP = 0x8962; |
| | 6974 | |
| | 6975 | // Driver configuration calls |
| | 6976 | /// Get device parameters |
| | 6977 | pub const SIOCGIFMAP = 0x8970; |
| | 6978 | |
| | 6979 | /// Set device parameters |
| | 6980 | pub const SIOCSIFMAP = 0x8971; |
| | 6981 | |
| | 6982 | // DLCI configuration calls |
| | 6983 | /// Create new DLCI device |
| | 6984 | pub const SIOCADDDLCI = 0x8980; |
| | 6985 | |
| | 6986 | /// Delete DLCI device |
| | 6987 | pub const SIOCDELDLCI = 0x8981; |
| | 6988 | |
| | 6989 | /// 802.1Q VLAN support |
| | 6990 | pub const SIOCGIFVLAN = 0x8982; |
| | 6991 | |
| | 6992 | /// Set 802.1Q VLAN options |
| | 6993 | pub const SIOCSIFVLAN = 0x8983; |
| | 6994 | |
| | 6995 | // bonding calls |
| | 6996 | /// Enslave a device to the bond |
| | 6997 | pub const SIOCBONDENSLAVE = 0x8990; |
| | 6998 | |
| | 6999 | /// Release a slave from the bond |
| | 7000 | pub const SIOCBONDRELEASE = 0x8991; |
| | 7001 | |
| | 7002 | /// Set the hw addr of the bond |
| | 7003 | pub const SIOCBONDSETHWADDR = 0x8992; |
| | 7004 | |
| | 7005 | /// rtn info about slave state |
| | 7006 | pub const SIOCBONDSLAVEINFOQUERY = 0x8993; |
| | 7007 | |
| | 7008 | /// rtn info about bond state |
| | 7009 | pub const SIOCBONDINFOQUERY = 0x8994; |
| | 7010 | |
| | 7011 | /// Update to a new active slave |
| | 7012 | pub const SIOCBONDCHANGEACTIVE = 0x8995; |
| | 7013 | |
| | 7014 | // Bridge calls |
| | 7015 | /// Create new bridge device |
| | 7016 | pub const SIOCBRADDBR = 0x89a0; |
| | 7017 | |
| | 7018 | /// Remove bridge device |
| | 7019 | pub const SIOCBRDELBR = 0x89a1; |
| | 7020 | |
| | 7021 | /// Add interface to bridge |
| | 7022 | pub const SIOCBRADDIF = 0x89a2; |
| | 7023 | |
| | 7024 | /// Remove interface from bridge |
| | 7025 | pub const SIOCBRDELIF = 0x89a3; |
| | 7026 | |
| | 7027 | /// Get hardware time stamp config |
| | 7028 | pub const SIOCSHWTSTAMP = 0x89b0; |
| | 7029 | |
| | 7030 | /// Set hardware time stamp config |
| | 7031 | pub const SIOCGHWTSTAMP = 0x89b1; |
| | 7032 | |
| | 7033 | /// Device private ioctl calls |
| | 7034 | pub const SIOCDEVPRIVATE = 0x89F0; |
| | 7035 | |
| | 7036 | /// These 16 ioctl calls are protocol private |
| | 7037 | pub const SIOCPROTOPRIVATE = 0x89E0; |
| | 7038 | |
| 6788 | pub const IFNAMESIZE = 16; | 7039 | pub const IFNAMESIZE = 16; |
| 6789 | | 7040 | |
| 6790 | pub const ifmap = extern struct { | 7041 | pub const ifmap = extern struct { |