udp.h 730 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #ifndef _NETINET_UDP_H
  2. #define _NETINET_UDP_H
  3. #ifdef __cplusplus
  4. extern "C" {
  5. #endif
  6. #include <features.h>
  7. #include <stdint.h>
  8. #ifdef _GNU_SOURCE
  9. #define uh_sport source
  10. #define uh_dport dest
  11. #define uh_ulen len
  12. #define uh_sum check
  13. #endif
  14. struct udphdr {
  15. uint16_t uh_sport;
  16. uint16_t uh_dport;
  17. uint16_t uh_ulen;
  18. uint16_t uh_sum;
  19. };
  20. #define UDP_CORK 1
  21. #define UDP_ENCAP 100
  22. #define UDP_NO_CHECK6_TX 101
  23. #define UDP_NO_CHECK6_RX 102
  24. #define UDP_SEGMENT 103
  25. #define UDP_GRO 104
  26. #define UDP_ENCAP_ESPINUDP_NON_IKE 1
  27. #define UDP_ENCAP_ESPINUDP 2
  28. #define UDP_ENCAP_L2TPINUDP 3
  29. #define UDP_ENCAP_GTP0 4
  30. #define UDP_ENCAP_GTP1U 5
  31. #define UDP_ENCAP_RXRPC 6
  32. #define SOL_UDP 17
  33. #ifdef __cplusplus
  34. }
  35. #endif
  36. #endif