dhcp6.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184
  1. // Copyright (C) 2006-2011 Internet Systems Consortium, Inc. ("ISC")
  2. //
  3. // Permission to use, copy, modify, and/or distribute this software for any
  4. // purpose with or without fee is hereby granted, provided that the above
  5. // copyright notice and this permission notice appear in all copies.
  6. //
  7. // THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
  8. // REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
  9. // AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
  10. // INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
  11. // LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
  12. // OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
  13. // PERFORMANCE OF THIS SOFTWARE.
  14. #ifndef DHCP6_H
  15. #define DHCP6_H
  16. /* DHCPv6 Option codes: */
  17. #define D6O_CLIENTID 1 /* RFC3315 */
  18. #define D6O_SERVERID 2
  19. #define D6O_IA_NA 3
  20. #define D6O_IA_TA 4
  21. #define D6O_IAADDR 5
  22. #define D6O_ORO 6
  23. #define D6O_PREFERENCE 7
  24. #define D6O_ELAPSED_TIME 8
  25. #define D6O_RELAY_MSG 9
  26. /* Option code 10 unassigned. */
  27. #define D6O_AUTH 11
  28. #define D6O_UNICAST 12
  29. #define D6O_STATUS_CODE 13
  30. #define D6O_RAPID_COMMIT 14
  31. #define D6O_USER_CLASS 15
  32. #define D6O_VENDOR_CLASS 16
  33. #define D6O_VENDOR_OPTS 17
  34. #define D6O_INTERFACE_ID 18
  35. #define D6O_RECONF_MSG 19
  36. #define D6O_RECONF_ACCEPT 20
  37. #define D6O_SIP_SERVERS_DNS 21 /* RFC3319 */
  38. #define D6O_SIP_SERVERS_ADDR 22 /* RFC3319 */
  39. #define D6O_NAME_SERVERS 23 /* RFC3646 */
  40. #define D6O_DOMAIN_SEARCH 24 /* RFC3646 */
  41. #define D6O_IA_PD 25 /* RFC3633 */
  42. #define D6O_IAPREFIX 26 /* RFC3633 */
  43. #define D6O_NIS_SERVERS 27 /* RFC3898 */
  44. #define D6O_NISP_SERVERS 28 /* RFC3898 */
  45. #define D6O_NIS_DOMAIN_NAME 29 /* RFC3898 */
  46. #define D6O_NISP_DOMAIN_NAME 30 /* RFC3898 */
  47. #define D6O_SNTP_SERVERS 31 /* RFC4075 */
  48. #define D6O_INFORMATION_REFRESH_TIME 32 /* RFC4242 */
  49. #define D6O_BCMCS_SERVER_D 33 /* RFC4280 */
  50. #define D6O_BCMCS_SERVER_A 34 /* RFC4280 */
  51. /* 35 is unassigned */
  52. #define D6O_GEOCONF_CIVIC 36 /* RFC4776 */
  53. #define D6O_REMOTE_ID 37 /* RFC4649 */
  54. #define D6O_SUBSCRIBER_ID 38 /* RFC4580 */
  55. #define D6O_CLIENT_FQDN 39 /* RFC4704 */
  56. #define D6O_PANA_AGENT 40 /* paa-option */
  57. #define D6O_NEW_POSIX_TIMEZONE 41 /* RFC4833 */
  58. #define D6O_NEW_TZDB_TIMEZONE 42 /* RFC4833 */
  59. #define D6O_ERO 43 /* RFC4994 */
  60. #define D6O_LQ_QUERY 44 /* RFC5007 */
  61. #define D6O_CLIENT_DATA 45 /* RFC5007 */
  62. #define D6O_CLT_TIME 46 /* RFC5007 */
  63. #define D6O_LQ_RELAY_DATA 47 /* RFC5007 */
  64. #define D6O_LQ_CLIENT_LINK 48 /* RFC5007 */
  65. /*
  66. * Status Codes, from RFC 3315 section 24.4, and RFC 3633, 5007.
  67. */
  68. #define STATUS_Success 0
  69. #define STATUS_UnspecFail 1
  70. #define STATUS_NoAddrsAvail 2
  71. #define STATUS_NoBinding 3
  72. #define STATUS_NotOnLink 4
  73. #define STATUS_UseMulticast 5
  74. #define STATUS_NoPrefixAvail 6
  75. #define STATUS_UnknownQueryType 7
  76. #define STATUS_MalformedQuery 8
  77. #define STATUS_NotConfigured 9
  78. #define STATUS_NotAllowed 10
  79. /*
  80. * DHCPv6 message types, defined in section 5.3 of RFC 3315
  81. */
  82. #define DHCPV6_SOLICIT 1
  83. #define DHCPV6_ADVERTISE 2
  84. #define DHCPV6_REQUEST 3
  85. #define DHCPV6_CONFIRM 4
  86. #define DHCPV6_RENEW 5
  87. #define DHCPV6_REBIND 6
  88. #define DHCPV6_REPLY 7
  89. #define DHCPV6_RELEASE 8
  90. #define DHCPV6_DECLINE 9
  91. #define DHCPV6_RECONFIGURE 10
  92. #define DHCPV6_INFORMATION_REQUEST 11
  93. #define DHCPV6_RELAY_FORW 12
  94. #define DHCPV6_RELAY_REPL 13
  95. #define DHCPV6_LEASEQUERY 14
  96. #define DHCPV6_LEASEQUERY_REPLY 15
  97. extern const char *dhcpv6_type_names[];
  98. extern const int dhcpv6_type_name_max;
  99. /* DUID type definitions (RFC3315 section 9).
  100. */
  101. #define DUID_LLT 1
  102. #define DUID_EN 2
  103. #define DUID_LL 3
  104. /* Offsets into IA_*'s where Option spaces commence. */
  105. #define IA_NA_OFFSET 12 /* IAID, T1, T2, all 4 octets each */
  106. #define IA_TA_OFFSET 4 /* IAID only, 4 octets */
  107. #define IA_PD_OFFSET 12 /* IAID, T1, T2, all 4 octets each */
  108. /* Offset into IAADDR's where Option spaces commence. */
  109. #define IAADDR_OFFSET 24
  110. /* Offset into IAPREFIX's where Option spaces commence. */
  111. #define IAPREFIX_OFFSET 25
  112. /* Offset into LQ_QUERY's where Option spaces commence. */
  113. #define LQ_QUERY_OFFSET 17
  114. /*
  115. * DHCPv6 well-known multicast addressess, from section 5.1 of RFC 3315
  116. */
  117. #define ALL_DHCP_RELAY_AGENTS_AND_SERVERS "ff02::1:2"
  118. #define ALL_DHCP_SERVERS "ff05::1:3"
  119. #define DHCP6_CLIENT_PORT 546
  120. #define DHCP6_SERVER_PORT 547
  121. /*
  122. * DHCPv6 Retransmission Constants (RFC3315 section 5.5, RFC 5007)
  123. */
  124. #define SOL_MAX_DELAY 1
  125. #define SOL_TIMEOUT 1
  126. #define SOL_MAX_RT 120
  127. #define REQ_TIMEOUT 1
  128. #define REQ_MAX_RT 30
  129. #define REQ_MAX_RC 10
  130. #define CNF_MAX_DELAY 1
  131. #define CNF_TIMEOUT 1
  132. #define CNF_MAX_RT 4
  133. #define CNF_MAX_RD 10
  134. #define REN_TIMEOUT 10
  135. #define REN_MAX_RT 600
  136. #define REB_TIMEOUT 10
  137. #define REB_MAX_RT 600
  138. #define INF_MAX_DELAY 1
  139. #define INF_TIMEOUT 1
  140. #define INF_MAX_RT 120
  141. #define REL_TIMEOUT 1
  142. #define REL_MAX_RC 5
  143. #define DEC_TIMEOUT 1
  144. #define DEC_MAX_RC 5
  145. #define REC_TIMEOUT 2
  146. #define REC_MAX_RC 8
  147. #define HOP_COUNT_LIMIT 32
  148. #define LQ6_TIMEOUT 1
  149. #define LQ6_MAX_RT 10
  150. #define LQ6_MAX_RC 5
  151. /* Leasequery query-types (RFC 5007) */
  152. #define LQ6QT_BY_ADDRESS 1
  153. #define LQ6QT_BY_CLIENTID 2
  154. /*
  155. * DUID time starts 2000-01-01.
  156. * This constant is the number of seconds since 1970-01-01,
  157. * when the Unix epoch began.
  158. */
  159. #define DUID_TIME_EPOCH 946684800
  160. /* Information-Request Time option (RFC 4242) */
  161. #define IRT_DEFAULT 86400
  162. #define IRT_MINIMUM 600
  163. #endif