@@ -208,6 +208,16 @@ s! {
208208 pub cookie: u32 ,
209209 pub len: u32
210210 }
211+
212+ pub struct sock_extended_err {
213+ pub ee_errno: u32 ,
214+ pub ee_origin: u8 ,
215+ pub ee_type: u8 ,
216+ pub ee_code: u8 ,
217+ pub ee_pad: u8 ,
218+ pub ee_info: u32 ,
219+ pub ee_data: u32 ,
220+ }
211221}
212222
213223s_no_extra_traits ! {
@@ -1572,6 +1582,7 @@ pub const SOCK_NONBLOCK: ::c_int = O_NONBLOCK;
15721582pub const SO_ORIGINAL_DST : :: c_int = 80 ;
15731583pub const IP_ORIGDSTADDR : :: c_int = 20 ;
15741584pub const IP_RECVORIGDSTADDR : :: c_int = IP_ORIGDSTADDR ;
1585+ pub const IPV6_FLOWINFO : :: c_int = 11 ;
15751586pub const IPV6_ORIGDSTADDR : :: c_int = 74 ;
15761587pub const IPV6_RECVORIGDSTADDR : :: c_int = IPV6_ORIGDSTADDR ;
15771588pub const IPV6_FLOWLABEL_MGR : :: c_int = 32 ;
@@ -2081,6 +2092,51 @@ pub const FUTEX_CLOCK_REALTIME: ::c_int = 256;
20812092pub const FUTEX_CMD_MASK : :: c_int =
20822093 !( FUTEX_PRIVATE_FLAG | FUTEX_CLOCK_REALTIME ) ;
20832094
2095+ // linux/errqueue.h
2096+ pub const SO_EE_ORIGIN_NONE : u8 = 0 ;
2097+ pub const SO_EE_ORIGIN_LOCAL : u8 = 1 ;
2098+ pub const SO_EE_ORIGIN_ICMP : u8 = 2 ;
2099+ pub const SO_EE_ORIGIN_ICMP6 : u8 = 3 ;
2100+ pub const SO_EE_ORIGIN_TXSTATUS : u8 = 4 ;
2101+ pub const SO_EE_ORIGIN_TIMESTAMPING : u8 = SO_EE_ORIGIN_TXSTATUS ;
2102+
2103+ // errno.h
2104+ pub const EPERM : :: c_int = 1 ;
2105+ pub const ENOENT : :: c_int = 2 ;
2106+ pub const ESRCH : :: c_int = 3 ;
2107+ pub const EINTR : :: c_int = 4 ;
2108+ pub const EIO : :: c_int = 5 ;
2109+ pub const ENXIO : :: c_int = 6 ;
2110+ pub const E2BIG : :: c_int = 7 ;
2111+ pub const ENOEXEC : :: c_int = 8 ;
2112+ pub const EBADF : :: c_int = 9 ;
2113+ pub const ECHILD : :: c_int = 10 ;
2114+ pub const EAGAIN : :: c_int = 11 ;
2115+ pub const ENOMEM : :: c_int = 12 ;
2116+ pub const EACCES : :: c_int = 13 ;
2117+ pub const EFAULT : :: c_int = 14 ;
2118+ pub const ENOTBLK : :: c_int = 15 ;
2119+ pub const EBUSY : :: c_int = 16 ;
2120+ pub const EEXIST : :: c_int = 17 ;
2121+ pub const EXDEV : :: c_int = 18 ;
2122+ pub const ENODEV : :: c_int = 19 ;
2123+ pub const ENOTDIR : :: c_int = 20 ;
2124+ pub const EISDIR : :: c_int = 21 ;
2125+ pub const EINVAL : :: c_int = 22 ;
2126+ pub const ENFILE : :: c_int = 23 ;
2127+ pub const EMFILE : :: c_int = 24 ;
2128+ pub const ENOTTY : :: c_int = 25 ;
2129+ pub const ETXTBSY : :: c_int = 26 ;
2130+ pub const EFBIG : :: c_int = 27 ;
2131+ pub const ENOSPC : :: c_int = 28 ;
2132+ pub const ESPIPE : :: c_int = 29 ;
2133+ pub const EROFS : :: c_int = 30 ;
2134+ pub const EMLINK : :: c_int = 31 ;
2135+ pub const EPIPE : :: c_int = 32 ;
2136+ pub const EDOM : :: c_int = 33 ;
2137+ pub const ERANGE : :: c_int = 34 ;
2138+ pub const EWOULDBLOCK : :: c_int = EAGAIN ;
2139+
20842140f ! {
20852141 pub fn CMSG_NXTHDR ( mhdr: * const msghdr,
20862142 cmsg: * const cmsghdr) -> * mut cmsghdr {
@@ -2140,6 +2196,10 @@ f! {
21402196 pub fn NLA_ALIGN ( len: :: c_int) -> :: c_int {
21412197 return ( ( len) + NLA_ALIGNTO - 1 ) & !( NLA_ALIGNTO - 1 )
21422198 }
2199+
2200+ pub fn SO_EE_OFFENDER ( ee: * const :: sock_extended_err) -> * mut :: sockaddr {
2201+ ee. offset( 1 ) as * mut :: sockaddr
2202+ }
21432203}
21442204
21452205extern "C" {
0 commit comments