ip_icmp.h 1.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. /*
  2. * Copyright (c) 2018-2020, Andreas Kling <kling@serenityos.org>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #pragma once
  7. #include <bits/stdint.h>
  8. #include <sys/cdefs.h>
  9. __BEGIN_DECLS
  10. struct icmphdr {
  11. uint8_t type;
  12. uint8_t code;
  13. uint16_t checksum;
  14. union {
  15. struct {
  16. uint16_t id;
  17. uint16_t sequence;
  18. } echo;
  19. uint32_t gateway;
  20. } un;
  21. };
  22. #define ICMP_ECHOREPLY 0 // Echo Reply
  23. #define ICMP_DEST_UNREACH 3 // Destination Unreachable
  24. #define ICMP_SOURCE_QUENCH 4 // Source Quench
  25. #define ICMP_REDIRECT 5 // Redirect
  26. #define ICMP_ECHO 8 // Echo Request
  27. #define ICMP_TIME_EXCEEDED 11 // Time Exceeded
  28. #define ICMP_PARAMETERPROB 12 // Parameter Problem
  29. #define ICMP_TIMESTAMP 13 // Timestamp Request
  30. #define ICMP_TIMESTAMPREPLY 14 // Timestamp Reply
  31. #define ICMP_INFO_REQUEST 15 // Information Request
  32. #define ICMP_INFO_REPLY 16 // Information Reply
  33. #define ICMP_ADDRESS 17 // Address Mask Request
  34. #define ICMP_ADDRESSREPLY 18 // Address Mask Reply
  35. #define NR_ICMP_TYPES 18
  36. __END_DECLS