BIND 10 trac3201, updated. ff2b7624b7d1bba8ce38c85018b625aecca937ab [3201] Constants moved to dhcp4.h
BIND 10 source code commits
bind10-changes at lists.isc.org
Thu Oct 24 19:47:51 UTC 2013
The branch, trac3201 has been updated
via ff2b7624b7d1bba8ce38c85018b625aecca937ab (commit)
via bc5486ec4a8bffd32dd161d7238177c4a50fc94e (commit)
from 9dc05967b079038d66d4a79ba607ac553500e23b (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 ff2b7624b7d1bba8ce38c85018b625aecca937ab
Author: Tomek Mrugalski <tomasz at isc.org>
Date: Thu Oct 24 21:41:17 2013 +0200
[3201] Constants moved to dhcp4.h
commit bc5486ec4a8bffd32dd161d7238177c4a50fc94e
Author: Tomek Mrugalski <tomasz at isc.org>
Date: Thu Oct 24 21:40:57 2013 +0200
[3201] BIND10 Guide updated.
-----------------------------------------------------------------------
Summary of changes:
doc/guide/bind10-guide.xml | 4 ++++
src/lib/dhcp/dhcp4.h | 23 +++++++++++++++++------
src/lib/dhcp/tests/libdhcp++_unittest.cc | 24 ++++++++++--------------
3 files changed, 31 insertions(+), 20 deletions(-)
-----------------------------------------------------------------------
diff --git a/doc/guide/bind10-guide.xml b/doc/guide/bind10-guide.xml
index 9ab1a9a..8c64ffc 100644
--- a/doc/guide/bind10-guide.xml
+++ b/doc/guide/bind10-guide.xml
@@ -4405,6 +4405,10 @@ Dhcp4/subnet4 [] list (default)
Domain Name (15), DNS Servers (6), IP Address Lease Time
(51), Subnet mask (1), and Routers (3).</simpara>
</listitem>
+ <listitem>
+ <simpara><ulink url="http://tools.ietf.org/html/rfc3046">RFC 3046</ulink>:
+ Relay Agent Information option is supported.</simpara>
+ </listitem>
</itemizedlist>
</section>
diff --git a/src/lib/dhcp/dhcp4.h b/src/lib/dhcp/dhcp4.h
index 2bce3a8..392478a 100644
--- a/src/lib/dhcp/dhcp4.h
+++ b/src/lib/dhcp/dhcp4.h
@@ -164,16 +164,27 @@ static const uint16_t DHCP4_SERVER_PORT = 67;
/// extensions field).
static const uint32_t DHCP_OPTIONS_COOKIE = 0x63825363;
+/* Relay Agent Information option subtypes: */
+
+static const uint16_t RAI_OPTION_AGENT_CIRCUIT_ID = 1; // RFC3046
+static const uint16_t RAI_OPTION_REMOTE_ID = 2; // RFC3046
+/* option 3 is reserved and will never be assigned */
+static const uint16_t RAI_OPTION_DOCSIS_DEVICE_CLASS = 4; // RFC3256
+static const uint16_t RAI_OPTION_LINK_SELECTION = 5; // RFC3527
+static const uint16_t RAI_OPTION_SUBSCRIBER_ID = 6; //RFC3993
+static const uint16_t RAI_OPTION_RADIUS = 7; //RFC4014
+static const uint16_t RAI_OPTION_AUTH = 8; //RFC4030
+static const uint16_t RAI_OPTION_VSI = 9; // RFC4243
+static const uint16_t RAI_OPTION_RELAY_FLAGS = 10; // RFC5010
+static const uint16_t RAI_OPTION_SERVER_ID_OVERRIDE = 11; // RFC5107
+static const uint16_t RAI_OPTION_RELAY_ID = 12; //RFC6925
+static const uint16_t RAI_OPTION_VIRTUAL_SUBNET_SELECT = 151; //RFC6607
+static const uint16_t RAI_OPTION_VIRTUAL_SUBNET_SELECT_CTRL = 152; //RFC6607
+
// TODO: Following are leftovers from dhcp.h import from ISC DHCP
// They will be converted to C++-style defines once they will start
// to be used.
#if 0
-/* Relay Agent Information option subtypes: */
-#define RAI_CIRCUIT_ID 1
-#define RAI_REMOTE_ID 2
-#define RAI_AGENT_ID 3
-#define RAI_LINK_SELECT 5
-
/* FQDN suboptions: */
#define FQDN_NO_CLIENT_UPDATE 1
#define FQDN_SERVER_UPDATE 2
diff --git a/src/lib/dhcp/tests/libdhcp++_unittest.cc b/src/lib/dhcp/tests/libdhcp++_unittest.cc
index e909ae5..614caff 100644
--- a/src/lib/dhcp/tests/libdhcp++_unittest.cc
+++ b/src/lib/dhcp/tests/libdhcp++_unittest.cc
@@ -43,12 +43,8 @@ using namespace isc::util;
namespace {
-// DHCPv4 suboptions of standard option Relay Agent Information
-const uint16_t OPTION_AGENT_CIRCUIT_ID = 1;
-const uint16_t OPTION_REMOTE_ID = 2;
-const uint16_t OPTION_VSI = 9;
-
// DHCPv6 suboptions of Vendor Options Option.
+/// @todo move to src/lib/dhcp/docsis3_option_defs.h once #3194 is merged.
const uint16_t OPTION_CMTS_CAPS = 1025;
const uint16_t OPTION_CM_MAC = 1026;
@@ -502,18 +498,18 @@ TEST_F(LibDhcpTest, packOptions4) {
// option in on-wire format is correct.
// Create Ciruit ID sub-option and add to RAI.
- OptionPtr circuit_id(new Option(Option::V4, OPTION_AGENT_CIRCUIT_ID,
+ OptionPtr circuit_id(new Option(Option::V4, RAI_OPTION_AGENT_CIRCUIT_ID,
OptionBuffer(v4_opts + 29,
v4_opts + 33)));
rai->addOption(circuit_id);
// Create Remote ID option and add to RAI.
- OptionPtr remote_id(new Option(Option::V4, OPTION_REMOTE_ID,
+ OptionPtr remote_id(new Option(Option::V4, RAI_OPTION_REMOTE_ID,
OptionBuffer(v4_opts + 35, v4_opts + 41)));
rai->addOption(remote_id);
// Create Vendor Specific Information and add to RAI.
- OptionPtr vsi(new Option(Option::V4, OPTION_VSI,
+ OptionPtr vsi(new Option(Option::V4, RAI_OPTION_VSI,
OptionBuffer(v4_opts + 43, v4_opts + 52)));
rai->addOption(vsi);
@@ -602,23 +598,23 @@ TEST_F(LibDhcpTest, unpackOptions4) {
// the generic Option class.
// Check that Circuit ID option is among parsed options.
- OptionPtr rai_option = rai->getOption(OPTION_AGENT_CIRCUIT_ID);
+ OptionPtr rai_option = rai->getOption(RAI_OPTION_AGENT_CIRCUIT_ID);
ASSERT_TRUE(rai_option);
- EXPECT_EQ(OPTION_AGENT_CIRCUIT_ID, rai_option->getType());
+ EXPECT_EQ(RAI_OPTION_AGENT_CIRCUIT_ID, rai_option->getType());
ASSERT_EQ(6, rai_option->len());
EXPECT_EQ(0, memcmp(&rai_option->getData()[0], v4_opts + 29, 4));
// Check that Remote ID option is among parsed options.
- rai_option = rai->getOption(OPTION_REMOTE_ID);
+ rai_option = rai->getOption(RAI_OPTION_REMOTE_ID);
ASSERT_TRUE(rai_option);
- EXPECT_EQ(OPTION_REMOTE_ID, rai_option->getType());
+ EXPECT_EQ(RAI_OPTION_REMOTE_ID, rai_option->getType());
ASSERT_EQ(8, rai_option->len());
EXPECT_EQ(0, memcmp(&rai_option->getData()[0], v4_opts + 35, 6));
// Check that Vendor Specific Information option is among parsed options.
- rai_option = rai->getOption(OPTION_VSI);
+ rai_option = rai->getOption(RAI_OPTION_VSI);
ASSERT_TRUE(rai_option);
- EXPECT_EQ(OPTION_VSI, rai_option->getType());
+ EXPECT_EQ(RAI_OPTION_VSI, rai_option->getType());
ASSERT_EQ(11, rai_option->len());
EXPECT_EQ(0, memcmp(&rai_option->getData()[0], v4_opts + 43, 11));
More information about the bind10-changes
mailing list