ContentType.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. /* vim: set expandtab ts=4 sw=4: */
  2. /*
  3. * You may redistribute this program and/or modify it under the terms of
  4. * the GNU General Public License as published by the Free Software Foundation,
  5. * either version 3 of the License, or (at your option) any later version.
  6. *
  7. * This program is distributed in the hope that it will be useful,
  8. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. * GNU General Public License for more details.
  11. *
  12. * You should have received a copy of the GNU General Public License
  13. * along with this program. If not, see <https://www.gnu.org/licenses/>.
  14. */
  15. #ifndef ContentType_H
  16. #define ContentType_H
  17. enum ContentType
  18. {
  19. /**
  20. * The lowest 255 message types are reserved for cjdns/IPv6 packets.
  21. * AKA: packets where the IP address is within the FC00::/8 block.
  22. * Any packet sent in this way will have the IPv6 header deconstructed and this
  23. * field will come from the nextHeader field in the IPv6 header.
  24. */
  25. ContentType_IP6_HOP = 0,
  26. ContentType_IP6_ICMP = 1,
  27. ContentType_IP6_IGMP = 2,
  28. ContentType_IP6_IPV4 = 4,
  29. ContentType_IP6_TCP = 6,
  30. ContentType_IP6_EGP = 8,
  31. ContentType_IP6_PUP = 12,
  32. ContentType_IP6_UDP = 17,
  33. ContentType_IP6_IDP = 22,
  34. ContentType_IP6_TP = 29,
  35. ContentType_IP6_DCCP = 33,
  36. ContentType_IP6_IPV6 = 41,
  37. ContentType_IP6_RSVP = 46,
  38. ContentType_IP6_GRE = 47,
  39. ContentType_IP6_ESP = 50,
  40. ContentType_IP6_AH = 51,
  41. ContentType_IP6_ICMPV6 = 58,
  42. ContentType_IP6_MTP = 92,
  43. ContentType_IP6_BEETPH = 94,
  44. ContentType_IP6_ENCAP = 98,
  45. ContentType_IP6_PIM = 103,
  46. ContentType_IP6_COMP = 108,
  47. ContentType_IP6_SCTP = 132,
  48. ContentType_IP6_UDPLITE = 136,
  49. ContentType_IP6_MAX = 255,
  50. /** Bencoded inter-router DHT messages. */
  51. ContentType_CJDHT = 256,
  52. ContentType_IPTUN = 257,
  53. /** Reserved for future allocation. */
  54. ContentType_RESERVED = 258,
  55. ContentType_RESERVED_MAX = 0x7fff,
  56. /**
  57. * Content types in the AVAILABLE range are not defined and can be used
  58. * like port numbers for subsystems of cjdns to communicate with subsystems within
  59. * cjdns on other machines, providing they first agree on which numbers to use via
  60. * CTRL messages.
  61. */
  62. ContentType_AVAILABLE = 0x8000,
  63. // This contentType will never appear in the wild, it represents unencrypted control frames.
  64. ContentType_CTRL = 0xffff + 1,
  65. ContentType_MAX = 0xffff + 2
  66. };
  67. #endif