BIND 10 trac2491, updated. ee0836a4c450db59764158e9f9c58acad7a1c4a4 [2491] Added a few comments.
BIND 10 source code commits
bind10-changes at lists.isc.org
Tue Dec 4 11:52:44 UTC 2012
The branch, trac2491 has been updated
via ee0836a4c450db59764158e9f9c58acad7a1c4a4 (commit)
from 7c0a4abbb4cce4460c8b0cfd9f1447e0cc37644d (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit ee0836a4c450db59764158e9f9c58acad7a1c4a4
Author: Marcin Siodelski <marcin at isc.org>
Date: Tue Dec 4 12:52:36 2012 +0100
[2491] Added a few comments.
-----------------------------------------------------------------------
Summary of changes:
src/lib/dhcp/libdhcp++.cc | 21 +++++++++++++--------
src/lib/dhcp/option_data_types.h | 10 +++++++++-
2 files changed, 22 insertions(+), 9 deletions(-)
-----------------------------------------------------------------------
diff --git a/src/lib/dhcp/libdhcp++.cc b/src/lib/dhcp/libdhcp++.cc
index 329b9a4..a1ca8a6 100644
--- a/src/lib/dhcp/libdhcp++.cc
+++ b/src/lib/dhcp/libdhcp++.cc
@@ -281,7 +281,13 @@ LibDHCP::initStdOptionDefs6() {
{ "preference", D6O_PREFERENCE, OPT_UINT8_TYPE, false },
{ "elapsed-time", D6O_ELAPSED_TIME, OPT_UINT16_TYPE, false },
{ "relay-msg", D6O_RELAY_MSG, OPT_BINARY_TYPE, false },
- // { "AUTH", D6O_AUTH, D6O_AUTH, OPT_RECORD_TYPE, false },
+ // Unfortunatelly the AUTH option contains a 64-bit data field
+ // called 'replay-detection' that can't be added as a record
+ // field to a custom option. Also, there is no dedicated
+ // option class to handle it so we simply return binary
+ // option type for now.
+ // @todo implement a class to handle AUTH option.
+ { "AUTH", D6O_AUTH, D6O_AUTH, OPT_BINARY_TYPE, false },
{ "unicast", D6O_UNICAST, OPT_IPV6_ADDRESS_TYPE, false },
{ "status-code", D6O_STATUS_CODE, OPT_RECORD_TYPE, false },
{ "rapid-commit", D6O_RAPID_COMMIT, OPT_EMPTY_TYPE, false },
@@ -318,14 +324,11 @@ LibDHCP::initStdOptionDefs6() {
{ "client-data", D6O_CLIENT_DATA, OPT_EMPTY_TYPE, false },
{ "clt-time", D6O_CLT_TIME, OPT_UINT32_TYPE, false },
{ "lq-relay-data", D6O_LQ_RELAY_DATA, OPT_RECORD_TYPE, false },
- { "lq-client-link", D6O_LQ_CLIENT_LINK, OPT_IPV6_ADDRESS_TYPE, true },
- /* { "MIP6_HNIDF", D6O_MIP6_HNIDF, OPT_FQDN_TYPE, false },
- { "MIP6_VDINF", D6O_MIP6_VDINF, OPT_EMPTY_TYPE, false },
- { "V6_LOST", D6O_V6_LOST, OPT_FQDN_TYPE, false },
- { "CAPWAP_AC_V6", D6O_CAPWAP_AC_V6, OPT_IPV6_ADDRESS_TYPE, true },
- { "RELAY_ID", D6O_RELAY_ID, OPT_BINARY_TYPE, false },
- { "IPV6_ADDRESS_MOS", */
+ { "lq-client-link", D6O_LQ_CLIENT_LINK, OPT_IPV6_ADDRESS_TYPE, true }
+ // @todo There is still a bunch of options for which we have to provide
+ // definitions but we don't do it because they are not really
+ // critical right now.
};
const int params_size = sizeof(params) / sizeof(params[0]);
@@ -334,6 +337,8 @@ LibDHCP::initStdOptionDefs6() {
params[i].code,
params[i].type,
params[i].array));
+ // Some of the options comprise a "record" of data fields so
+ // we have to add those fields here.
switch(params[i].code) {
case D6O_IA_NA:
case D6O_IA_PD:
diff --git a/src/lib/dhcp/option_data_types.h b/src/lib/dhcp/option_data_types.h
index b52cc4d..1628735 100644
--- a/src/lib/dhcp/option_data_types.h
+++ b/src/lib/dhcp/option_data_types.h
@@ -225,11 +225,13 @@ public:
/// @return data type size or zero for variable length types.
static int getDataTypeLen(const OptionDataType data_type);
- /// @brief Read IPv4 or IPv6 addres from a buffer.
+ /// @brief Read IPv4 or IPv6 address from a buffer.
///
/// @param buf input buffer.
/// @param family address family: AF_INET or AF_INET6.
///
+ /// @throw isc::dhcp::BadDataTypeCast when the data being read
+ /// is truncated.
/// @return address being read.
static asiolink::IOAddress readAddress(const std::vector<uint8_t>& buf,
const short family);
@@ -252,6 +254,9 @@ public:
/// @brief Read boolean value from a buffer.
///
/// @param buf input buffer.
+ ///
+ /// @throw isc::dhcp::BadDataTypeCast when the data being read
+ /// is truncated or the value is invalid (neither 1 nor 0).
/// @return boolean value read from a buffer.
static bool readBool(const std::vector<uint8_t>& buf);
@@ -268,6 +273,9 @@ public:
///
/// @param buf input buffer.
/// @tparam integer type of the returned value.
+ ///
+ /// @throw isc::dhcp::BadDataTypeCast when the data in the buffer
+ /// is truncated.
/// @return integer value being read.
template<typename T>
static T readInt(const std::vector<uint8_t>& buf) {
More information about the bind10-changes
mailing list