1607ca46eSDavid Howells #ifndef _UAPI_LINUX_ERRQUEUE_H 2607ca46eSDavid Howells #define _UAPI_LINUX_ERRQUEUE_H 3607ca46eSDavid Howells 4607ca46eSDavid Howells #include <linux/types.h> 5607ca46eSDavid Howells 6607ca46eSDavid Howells struct sock_extended_err { 7607ca46eSDavid Howells __u32 ee_errno; 8607ca46eSDavid Howells __u8 ee_origin; 9607ca46eSDavid Howells __u8 ee_type; 10607ca46eSDavid Howells __u8 ee_code; 11607ca46eSDavid Howells __u8 ee_pad; 12607ca46eSDavid Howells __u32 ee_info; 13607ca46eSDavid Howells __u32 ee_data; 14607ca46eSDavid Howells }; 15607ca46eSDavid Howells 16607ca46eSDavid Howells #define SO_EE_ORIGIN_NONE 0 17607ca46eSDavid Howells #define SO_EE_ORIGIN_LOCAL 1 18607ca46eSDavid Howells #define SO_EE_ORIGIN_ICMP 2 19607ca46eSDavid Howells #define SO_EE_ORIGIN_ICMP6 3 20607ca46eSDavid Howells #define SO_EE_ORIGIN_TXSTATUS 4 21607ca46eSDavid Howells #define SO_EE_ORIGIN_TIMESTAMPING SO_EE_ORIGIN_TXSTATUS 22607ca46eSDavid Howells 23607ca46eSDavid Howells #define SO_EE_OFFENDER(ee) ((struct sockaddr*)((ee)+1)) 24607ca46eSDavid Howells 25f24b9be5SWillem de Bruijn /** 26f24b9be5SWillem de Bruijn * struct scm_timestamping - timestamps exposed through cmsg 27f24b9be5SWillem de Bruijn * 28f24b9be5SWillem de Bruijn * The timestamping interfaces SO_TIMESTAMPING, MSG_TSTAMP_* 29f24b9be5SWillem de Bruijn * communicate network timestamps by passing this struct in a cmsg with 30f24b9be5SWillem de Bruijn * recvmsg(). See Documentation/networking/timestamping.txt for details. 31f24b9be5SWillem de Bruijn */ 32f24b9be5SWillem de Bruijn struct scm_timestamping { 33f24b9be5SWillem de Bruijn struct timespec ts[3]; 34f24b9be5SWillem de Bruijn }; 35f24b9be5SWillem de Bruijn 36f24b9be5SWillem de Bruijn /* The type of scm_timestamping, passed in sock_extended_err ee_info. 37f24b9be5SWillem de Bruijn * This defines the type of ts[0]. For SCM_TSTAMP_SND only, if ts[0] 38f24b9be5SWillem de Bruijn * is zero, then this is a hardware timestamp and recorded in ts[2]. 39f24b9be5SWillem de Bruijn */ 40f24b9be5SWillem de Bruijn enum { 41f24b9be5SWillem de Bruijn SCM_TSTAMP_SND, /* driver passed skb to NIC, or HW */ 42e7fd2885SWillem de Bruijn SCM_TSTAMP_SCHED, /* data entered the packet scheduler */ 43*e1c8a607SWillem de Bruijn SCM_TSTAMP_ACK, /* data acknowledged by peer */ 44f24b9be5SWillem de Bruijn }; 45607ca46eSDavid Howells 46607ca46eSDavid Howells #endif /* _UAPI_LINUX_ERRQUEUE_H */ 47