dhcp6.h 7.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192
  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. #define D6O_ERP_LOCAL_DOMAIN_NAME 65 /* RFC6440 */
  66. #define D6O_RSOO 66 /* RFC6422 */
  67. #define D6O_CLIENT_LINKLAYER_ADDR 79 /* RFC6939 */
  68. /*
  69. * Status Codes, from RFC 3315 section 24.4, and RFC 3633, 5007.
  70. */
  71. #define STATUS_Success 0
  72. #define STATUS_UnspecFail 1
  73. #define STATUS_NoAddrsAvail 2
  74. #define STATUS_NoBinding 3
  75. #define STATUS_NotOnLink 4
  76. #define STATUS_UseMulticast 5
  77. #define STATUS_NoPrefixAvail 6
  78. #define STATUS_UnknownQueryType 7
  79. #define STATUS_MalformedQuery 8
  80. #define STATUS_NotConfigured 9
  81. #define STATUS_NotAllowed 10
  82. /*
  83. * DHCPv6 message types, defined in section 5.3 of RFC 3315
  84. */
  85. #define DHCPV6_SOLICIT 1
  86. #define DHCPV6_ADVERTISE 2
  87. #define DHCPV6_REQUEST 3
  88. #define DHCPV6_CONFIRM 4
  89. #define DHCPV6_RENEW 5
  90. #define DHCPV6_REBIND 6
  91. #define DHCPV6_REPLY 7
  92. #define DHCPV6_RELEASE 8
  93. #define DHCPV6_DECLINE 9
  94. #define DHCPV6_RECONFIGURE 10
  95. #define DHCPV6_INFORMATION_REQUEST 11
  96. #define DHCPV6_RELAY_FORW 12
  97. #define DHCPV6_RELAY_REPL 13
  98. #define DHCPV6_LEASEQUERY 14
  99. #define DHCPV6_LEASEQUERY_REPLY 15
  100. extern const char *dhcpv6_type_names[];
  101. extern const int dhcpv6_type_name_max;
  102. // DUID type definitions (RFC3315 section 9).
  103. // see isc::dhcp::DUID::DUIDType enum in dhcp/duid.h
  104. // Define hardware types
  105. // Taken from http://www.iana.org/assignments/arp-parameters/
  106. #define HWTYPE_ETHERNET 0x0001
  107. #define HWTYPE_INFINIBAND 0x0020
  108. // Taken from http://www.iana.org/assignments/enterprise-numbers
  109. #define ENTERPRISE_ID_ISC 2495
  110. /* Offsets into IA_*'s where Option spaces commence. */
  111. #define IA_NA_OFFSET 12 /* IAID, T1, T2, all 4 octets each */
  112. #define IA_TA_OFFSET 4 /* IAID only, 4 octets */
  113. #define IA_PD_OFFSET 12 /* IAID, T1, T2, all 4 octets each */
  114. /* Offset into IAADDR's where Option spaces commence. */
  115. #define IAADDR_OFFSET 24
  116. /* Offset into IAPREFIX's where Option spaces commence. */
  117. #define IAPREFIX_OFFSET 25
  118. /* Offset into LQ_QUERY's where Option spaces commence. */
  119. #define LQ_QUERY_OFFSET 17
  120. /*
  121. * DHCPv6 well-known multicast addresses, from section 5.1 of RFC 3315
  122. */
  123. #define ALL_DHCP_RELAY_AGENTS_AND_SERVERS "ff02::1:2"
  124. #define ALL_DHCP_SERVERS "ff05::1:3"
  125. #define DHCP6_CLIENT_PORT 546
  126. #define DHCP6_SERVER_PORT 547
  127. /*
  128. * DHCPv6 Retransmission Constants (RFC3315 section 5.5, RFC 5007)
  129. */
  130. #define SOL_MAX_DELAY 1
  131. #define SOL_TIMEOUT 1
  132. #define SOL_MAX_RT 120
  133. #define REQ_TIMEOUT 1
  134. #define REQ_MAX_RT 30
  135. #define REQ_MAX_RC 10
  136. #define CNF_MAX_DELAY 1
  137. #define CNF_TIMEOUT 1
  138. #define CNF_MAX_RT 4
  139. #define CNF_MAX_RD 10
  140. #define REN_TIMEOUT 10
  141. #define REN_MAX_RT 600
  142. #define REB_TIMEOUT 10
  143. #define REB_MAX_RT 600
  144. #define INF_MAX_DELAY 1
  145. #define INF_TIMEOUT 1
  146. #define INF_MAX_RT 120
  147. #define REL_TIMEOUT 1
  148. #define REL_MAX_RC 5
  149. #define DEC_TIMEOUT 1
  150. #define DEC_MAX_RC 5
  151. #define REC_TIMEOUT 2
  152. #define REC_MAX_RC 8
  153. #define HOP_COUNT_LIMIT 32
  154. #define LQ6_TIMEOUT 1
  155. #define LQ6_MAX_RT 10
  156. #define LQ6_MAX_RC 5
  157. /* Leasequery query-types (RFC 5007) */
  158. #define LQ6QT_BY_ADDRESS 1
  159. #define LQ6QT_BY_CLIENTID 2
  160. /*
  161. * DUID time starts 2000-01-01.
  162. * This constant is the number of seconds since 1970-01-01,
  163. * when the Unix epoch began.
  164. */
  165. #define DUID_TIME_EPOCH 946684800
  166. /* Information-Request Time option (RFC 4242) */
  167. #define IRT_DEFAULT 86400
  168. #define IRT_MINIMUM 600
  169. #endif /* DHCP6_H */