errqueue.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. #ifndef _UAPI_LINUX_ERRQUEUE_H
  2. #define _UAPI_LINUX_ERRQUEUE_H
  3. #include <linux/types.h>
  4. struct sock_extended_err {
  5. __u32 ee_errno;
  6. __u8 ee_origin;
  7. __u8 ee_type;
  8. __u8 ee_code;
  9. __u8 ee_pad;
  10. __u32 ee_info;
  11. __u32 ee_data;
  12. };
  13. #define SO_EE_ORIGIN_NONE 0
  14. #define SO_EE_ORIGIN_LOCAL 1
  15. #define SO_EE_ORIGIN_ICMP 2
  16. #define SO_EE_ORIGIN_ICMP6 3
  17. #define SO_EE_ORIGIN_TXSTATUS 4
  18. #define SO_EE_ORIGIN_ZEROCOPY 5
  19. #define SO_EE_ORIGIN_TIMESTAMPING SO_EE_ORIGIN_TXSTATUS
  20. #define SO_EE_OFFENDER(ee) ((struct sockaddr*)((ee)+1))
  21. #define SO_EE_CODE_ZEROCOPY_COPIED 1
  22. /**
  23. * struct scm_timestamping - timestamps exposed through cmsg
  24. *
  25. * The timestamping interfaces SO_TIMESTAMPING, MSG_TSTAMP_*
  26. * communicate network timestamps by passing this struct in a cmsg with
  27. * recvmsg(). See Documentation/networking/timestamping.txt for details.
  28. */
  29. struct scm_timestamping {
  30. struct timespec ts[3];
  31. };
  32. /* The type of scm_timestamping, passed in sock_extended_err ee_info.
  33. * This defines the type of ts[0]. For SCM_TSTAMP_SND only, if ts[0]
  34. * is zero, then this is a hardware timestamp and recorded in ts[2].
  35. */
  36. enum {
  37. SCM_TSTAMP_SND, /* driver passed skb to NIC, or HW */
  38. SCM_TSTAMP_SCHED, /* data entered the packet scheduler */
  39. SCM_TSTAMP_ACK, /* data acknowledged by peer */
  40. };
  41. #endif /* _UAPI_LINUX_ERRQUEUE_H */