errqueue.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef _LINUX_ERRQUEUE_H
  2. #define _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_TIMESTAMPING SO_EE_ORIGIN_TXSTATUS
  19. #define SO_EE_OFFENDER(ee) ((struct sockaddr*)((ee)+1))
  20. /**
  21. * struct scm_timestamping - timestamps exposed through cmsg
  22. *
  23. * The timestamping interfaces SO_TIMESTAMPING, MSG_TSTAMP_*
  24. * communicate network timestamps by passing this struct in a cmsg with
  25. * recvmsg(). See Documentation/networking/timestamping.txt for details.
  26. */
  27. struct scm_timestamping {
  28. struct timespec ts[3];
  29. };
  30. /* The type of scm_timestamping, passed in sock_extended_err ee_info.
  31. * This defines the type of ts[0]. For SCM_TSTAMP_SND only, if ts[0]
  32. * is zero, then this is a hardware timestamp and recorded in ts[2].
  33. */
  34. enum {
  35. SCM_TSTAMP_SND, /* driver passed skb to NIC, or HW */
  36. SCM_TSTAMP_SCHED, /* data entered the packet scheduler */
  37. SCM_TSTAMP_ACK, /* data acknowledged by peer */
  38. };
  39. #endif /* _LINUX_ERRQUEUE_H */