Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ISC Open Source Projects
Kea
Commits
7173c099
Commit
7173c099
authored
Jun 12, 2015
by
Francis Dupont
Browse files
[master] spelling
parent
03e0f731
Changes
18
Hide whitespace changes
Inline
Side-by-side
src/bin/dhcp6/ctrl_dhcp6_srv.h
View file @
7173c099
// Copyright (C) 2012-201
4
Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2012-201
5
Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
...
...
src/bin/dhcp6/dhcp6.dox
View file @
7173c099
...
...
@@ -21,7 +21,7 @@
especially lib::dhcp::Pkt6, isc::dhcp::Option and
isc::dhcp::IfaceMgr classes. Currently this code offers skeleton
functionality, i.e. it is able to receive and process incoming
requests and trasmit responses. However, it does not have database
requests and tra
n
smit responses. However, it does not have database
management, so it returns only one, hardcoded lease to whoever asks
for it.
...
...
@@ -167,8 +167,8 @@ different way. If the server overrides client's preference it will communicate i
by sending the DHCPv6 Client FQDN Option in its responses to a client, with
appropriate flags set.
@todo Note, that current implementation doesn't allow configuration of the server's behavio
u
r
with respect to DNS Updates. This is planned for the future. The default behavio
u
r is
@todo Note, that current implementation doesn't allow configuration of the server's behavior
with respect to DNS Updates. This is planned for the future. The default behavior is
constituted by the set of constants defined in the (upper part of) dhcp6_srv.cc file.
Once the configuration is implemented, these constants will be removed.
...
...
@@ -216,11 +216,11 @@ name.
In principle any given packet can belong to zero or more classes. As the current
classifier is very modest, there's only one way to assign a class (based on vendor class
option), the ability to assign more than one class to a packet is not yet exercised.
Neverthless, there is such a possibility and it will be used in a near future. To
Neverth
e
less, there is such a possibility and it will be used in a near future. To
check whether a packet belongs to given class, isc::dhcp::Pkt6::inClass method should
be used.
Currently there is no class behavio
u
r coded in DHCPv6, hence no v6 equivalent of
Currently there is no class behavior coded in DHCPv6, hence no v6 equivalent of
@ref isc::dhcp::Dhcpv4Srv::classSpecificProcessing. Should any need for such a code arise,
it will be conducted in an external hooks library.
...
...
src/bin/dhcp6/dhcp6_hooks.dox
View file @
7173c099
// Copyright (C) 2013 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2013
, 2015
Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
...
...
@@ -22,7 +22,7 @@
the @ref hooksdgDevelopersGuide. Information for Kea maintainers can be
found in the @ref hooksComponentDeveloperGuide.
This manual is more speciali
s
ed and is aimed at developers of hook
This manual is more speciali
z
ed and is aimed at developers of hook
code for the DHCPv6 server. It describes each hook point, what the callouts
attached to the hook are able to do, and the arguments passed to the
callouts. Each entry in this manual has the following information:
...
...
src/bin/dhcp6/dhcp6_messages.mes
View file @
7173c099
...
...
@@ -51,7 +51,7 @@ through its main loop to perform handling of any pending signals
and timers. After that, it will enter the wait state again.
% DHCP6_BUFFER_WAIT_INTERRUPTED interrupted wait for the next packet due to timeout, signal or external socket callback (timeout value is %1)
This debug message is issued when the server intrrupts waiting
This debug message is issued when the server int
e
rrupts waiting
for reception of the next DHCPv6 message due to timeout, signal
or reception of the data over socket other than used for DHCPv6
message transmission. The server will now handle signals
...
...
@@ -75,7 +75,7 @@ to establish a session with the Kea control channel.
% DHCP6_CLASS_ASSIGNED client packet has been assigned to the following class(es): %1
This debug message informs that incoming packet has been assigned to specified
class or classes.
This is a norma
class or classes.
% DHCP6_COMMAND_RECEIVED received command %1, arguments: %2
A debug message listing the command (and possible arguments) received
...
...
@@ -177,7 +177,7 @@ information.
% DHCP6_DDNS_REQUEST_SEND_FAILED failed sending a request to kea-dhcp-ddns, error: %1, ncr: %2
This error message indicates that IPv6 DHCP server failed to send a DDNS
update req
e
ust to the DHCP-DDNS server. This is most likely a configuration or
update requ
e
st to the DHCP-DDNS server. This is most likely a configuration or
networking error.
% DHCP6_DDNS_RESPONSE_FQDN_DATA %1: including FQDN option in the server's response: %2
...
...
@@ -205,7 +205,7 @@ This message is printed when DHCPv6 server disables an interface from being
used to receive DHCPv6 traffic. Sockets on this interface will not be opened
by the Interface Manager until interface is enabled.
% DHCP6_DYNAMIC_RECONFIGURATION initate server reconfiguration using file: %1, after receiving SIGHUP signal
% DHCP6_DYNAMIC_RECONFIGURATION init
i
ate server reconfiguration using file: %1, after receiving SIGHUP signal
This is the info message logged when the DHCPv6 server starts reconfiguration
as a result of receiving SIGHUP signal.
...
...
@@ -295,7 +295,7 @@ identification information.
% DHCP6_INIT_FAIL failed to initialize Kea server: %1
The server has failed to establish communication with the rest of Kea,
failed to read JSON configuration file or e
x
countered any other critical
failed to read JSON configuration file or e
n
countered any other critical
issue that prevents it from starting up properly. Attached error message
provides more details about the issue.
...
...
@@ -383,7 +383,7 @@ server is about to open sockets on the specified port.
A warning message issued when IfaceMgr fails to open and bind a socket. The reason
for the failure is appended as an argument of the log message.
% DHCP6_PACKET_DROP_PARSE_FAIL failed to parse packet from %1 to %2, received over interace %3, reason: %4
% DHCP6_PACKET_DROP_PARSE_FAIL failed to parse packet from %1 to %2, received over inter
f
ace %3, reason: %4
The DHCPv4 server has received a packet that it is unable to
interpret. The reason why the packet is invalid is included in the message.
...
...
@@ -484,7 +484,7 @@ message, the server successfully granted an non-temporary address
lease. This is a normal behavior and indicates successful operation.
The first argument includes the client and transaction identification
information. The remaining arguments hold the allocated prefix,
prefix len
n
gth and and IAID.
prefix length and and IAID.
% DHCP6_PD_LEASE_ALLOC_FAIL %1: failed to grant a prefix lease for iaid=%2
This message indicates that in response to a received REQUEST, the server
...
...
@@ -535,7 +535,7 @@ argument includes the client and the transaction identification
information.
% DHCP6_RAPID_COMMIT %1: Rapid Commit option received, following 2-way exchange
This debug mess
g
age is issued when the server found a Rapid Commit option
This debug message is issued when the server found a Rapid Commit option
in the client's message and 2-way exchanges are supported by the
server for the subnet on which the client is connected. The argument
specifies the client and transaction identification information.
...
...
src/bin/dhcp6/dhcp6_srv.cc
View file @
7173c099
...
...
@@ -244,7 +244,7 @@ Dhcpv6Srv::testServerID(const Pkt6Ptr& pkt) {
OptionPtr
server_id
=
pkt
->
getOption
(
D6O_SERVERID
);
if
(
server_id
){
// Let us test received ServerID if it is same as ServerID
// which is be
e
ing used by server
// which is being used by server
if
(
getServerID
()
->
getData
()
!=
server_id
->
getData
()){
LOG_DEBUG
(
bad_packet_logger
,
DBG_DHCP6_DETAIL_DATA
,
DHCP6_PACKET_DROP_SERVERID_MISMATCH
)
...
...
@@ -254,7 +254,7 @@ Dhcpv6Srv::testServerID(const Pkt6Ptr& pkt) {
return
(
false
);
}
}
// retun True if: no serverid received or ServerIDs matching
// retu
r
n True if: no serverid received or ServerIDs matching
return
(
true
);
}
...
...
@@ -453,7 +453,7 @@ bool Dhcpv6Srv::run() {
.
arg
(
query
->
toText
());
// At this point the information in the packet has been unpacked into
// the various packet fields and option objects has been cre
t
ated.
// the various packet fields and option objects has been created.
// Execute callouts registered for packet6_receive.
if
(
HooksManager
::
calloutsPresent
(
Hooks
.
hook_index_pkt6_receive_
))
{
CalloutHandlePtr
callout_handle
=
getCalloutHandle
(
query
);
...
...
@@ -754,7 +754,7 @@ Dhcpv6Srv::generateServerID() {
// MAC address should be at least 6 bytes. Although there is no such
// requirement in any RFC, all decent physical interfaces (Ethernet,
// WiFi, Infini
b
and, etc.) have 6 bytes long MAC address. We want to
// WiFi, Infini
B
and, etc.) have 6 bytes long MAC address. We want to
// base our DUID on real hardware address, rather than virtual
// interface that pretends that underlying IP address is its MAC.
if
(
iface
->
getMacLen
()
<
MIN_MAC_LEN
)
{
...
...
@@ -782,7 +782,8 @@ Dhcpv6Srv::generateServerID() {
// it. See RFC3315, Section 9.2 for details.
// DUID uses seconds since midnight of 01-01-2000, time() returns
// seconds since 01-01-1970. DUID_TIME_EPOCH substution corrects that.
// seconds since 01-01-1970. DUID_TIME_EPOCH substitution corrects
// that.
time_t
seconds
=
time
(
NULL
);
seconds
-=
DUID_TIME_EPOCH
;
...
...
@@ -1026,9 +1027,10 @@ Dhcpv6Srv::selectSubnet(const Pkt6Ptr& question) {
// Call user (and server-side) callouts
HooksManager
::
callCallouts
(
Hooks
.
hook_index_subnet6_select_
,
*
callout_handle
);
// Callouts decided to skip this step. This means that no subnet will be
// selected. Packet processing will continue, but it will be severly limited
// (i.e. only global options will be assigned)
// Callouts decided to skip this step. This means that no
// subnet will be selected. Packet processing will continue,
// but it will be severely limited (i.e. only global options
// will be assigned)
if
(
callout_handle
->
getSkip
())
{
LOG_DEBUG
(
hooks_logger
,
DBG_DHCP6_HOOKS
,
DHCP6_HOOK_SUBNET6_SELECT_SKIP
)
.
arg
(
question
->
getLabel
());
...
...
@@ -1197,7 +1199,7 @@ Dhcpv6Srv::createNameChangeRequests(const Pkt6Ptr& answer) {
}
// Get the Client Id. It is mandatory and a function creating a response
// would have thrown an exception if it was missing. Thus throw
n
ing
// would have thrown an exception if it was missing. Thus throwing
// Unexpected if it is missing as it is a programming error.
OptionPtr
opt_duid
=
answer
->
getOption
(
D6O_CLIENTID
);
if
(
!
opt_duid
)
{
...
...
@@ -1397,7 +1399,7 @@ Dhcpv6Srv::assignIA_NA(const Pkt6Ptr& query, const Pkt6Ptr& answer,
}
// Use allocation engine to pick a lease for this client. Allocation engine
// will try to hono
u
r the hint, but it is just a hint - some other address
// will try to honor the hint, but it is just a hint - some other address
// may be used instead. If fake_allocation is set to false, the lease will
// be inserted into the LeaseMgr as well.
AllocEngine
::
ClientContext6
ctx
(
subnet
,
duid
,
ia
->
getIAID
(),
...
...
@@ -1557,7 +1559,7 @@ Dhcpv6Srv::assignIA_PD(const Pkt6Ptr& query, const Pkt6Ptr& answer,
bool
fake_allocation
=
(
answer
->
getType
()
!=
DHCPV6_REPLY
);
// Use allocation engine to pick a lease for this client. Allocation engine
// will try to hono
u
r the hint, but it is just a hint - some other address
// will try to honor the hint, but it is just a hint - some other address
// may be used instead. If fake_allocation is set to false, the lease will
// be inserted into the LeaseMgr as well.
Lease6Collection
old_leases
;
...
...
@@ -1632,7 +1634,7 @@ Dhcpv6Srv::extendIA_NA(const Pkt6Ptr& query, const Pkt6Ptr& answer,
Option6IAPtr
ia_rsp
(
new
Option6IA
(
D6O_IA_NA
,
ia
->
getIAID
()));
if
(
!
subnet
)
{
/// @todo For simplic
l
ty and due to limitations of LeaseMgr we don't
/// @todo For simplic
i
ty and due to limitations of LeaseMgr we don't
/// get the binding for the client for which we don't get subnet id.
/// Subnet id is a required value when searching for the bindings.
/// The fact that we can't identify the subnet for the returning client
...
...
@@ -1695,7 +1697,7 @@ Dhcpv6Srv::extendIA_NA(const Pkt6Ptr& query, const Pkt6Ptr& answer,
// we extend, cancel or otherwise deal with the leases.
bool
hints_present
=
!
ctx
.
hints_
.
empty
();
/// @todo: This was clarfied in draft-ietf-dhc-dhcpv6-stateful-issues that
/// @todo: This was clar
i
fied in draft-ietf-dhc-dhcpv6-stateful-issues that
/// the server is allowed to assign new leases in both Renew and Rebind. For
/// now, we only support it in Renew, because it breaks a lot of Rebind
/// unit-tests. Ultimately, whether we allow it or not, should be exposed
...
...
@@ -2171,7 +2173,7 @@ Dhcpv6Srv::releaseIA_NA(const DuidPtr& duid, const Pkt6Ptr& query,
}
// Ok, we've passed all checks. Let's release this address.
bool
success
=
false
;
// was the removal operation succe
e
ssful?
bool
success
=
false
;
// was the removal operation successful?
if
(
!
skip
)
{
success
=
LeaseMgrFactory
::
instance
().
deleteLease
(
lease
->
addr_
);
...
...
@@ -2315,7 +2317,7 @@ Dhcpv6Srv::releaseIA_PD(const DuidPtr& duid, const Pkt6Ptr& query,
}
// Ok, we've passed all checks. Let's release this prefix.
bool
success
=
false
;
// was the removal operation succe
e
ssful?
bool
success
=
false
;
// was the removal operation successful?
if
(
!
skip
)
{
success
=
LeaseMgrFactory
::
instance
().
deleteLease
(
lease
->
addr_
);
...
...
@@ -2612,7 +2614,7 @@ Dhcpv6Srv::unpackOptions(const OptionBuffer& buf,
OptionDefContainer
option_defs
;
if
(
option_space
==
"dhcp6"
)
{
// Get the list of st
d
andard option definitions.
// Get the list of standard option definitions.
option_defs
=
LibDHCP
::
getOptionDefs
(
Option
::
V6
);
}
else
if
(
!
option_space
.
empty
())
{
OptionDefContainerPtr
option_defs_ptr
=
...
...
@@ -2820,8 +2822,8 @@ Dhcpv6Srv::d2ClientErrorHandler(const
dhcp_ddns
::
NameChangeRequestPtr
&
ncr
)
{
LOG_ERROR
(
ddns_logger
,
DHCP6_DDNS_REQUEST_SEND_FAILED
).
arg
(
result
).
arg
((
ncr
?
ncr
->
toText
()
:
" NULL "
));
// We cannot communicate with kea-dhcp-ddns, suspend futher updates.
/// @todo We may wish to revisit this, but for now we will simpy turn
// We cannot communicate with kea-dhcp-ddns, suspend fu
r
ther updates.
/// @todo We may wish to revisit this, but for now we will simp
l
y turn
/// them off.
CfgMgr
::
instance
().
getD2ClientMgr
().
suspendUpdates
();
}
...
...
src/bin/dhcp6/dhcp6_srv.h
View file @
7173c099
...
...
@@ -77,7 +77,7 @@ public:
/// @brief Destructor. Used during DHCPv6 service shutdown.
virtual
~
Dhcpv6Srv
();
/// @brief Returns server-i
n
dentifier option.
/// @brief Returns server-identifier option.
///
/// @return server-id option
OptionPtr
getServerID
()
{
return
serverid_
;
}
...
...
@@ -326,7 +326,7 @@ protected:
/// message should contain Client FQDN option being sent by the server
/// to the client (if the client sent this option to the server).
/// @param orig_ctx client context (contains subnet, duid and other parameters)
/// @param ia IA_NA option which carries adress for which lease lifetime
/// @param ia IA_NA option which carries ad
d
ress for which lease lifetime
/// will be extended.
/// @return IA_NA option (server's response)
OptionPtr
extendIA_NA
(
const
Pkt6Ptr
&
query
,
const
Pkt6Ptr
&
answer
,
...
...
@@ -470,7 +470,7 @@ protected:
/// - If there is no Client FQDN and no reserved hostname then there
/// will no be DNS updates and the lease hostname will be empty.
///
/// - If there is no Client FQDN but there is reserve
r
d hostname then
/// - If there is no Client FQDN but there is reserved hostname then
/// there will be no DNS updates and the lease hostname will be equal
/// to reserved hostname.
///
...
...
@@ -478,7 +478,7 @@ protected:
/// FQDN and lease hostname will be equal to reserved hostname with
/// the qualifying suffix appended.
///
/// - If there is a Client FQDN but no reserve
r
d hostname then both the
/// - If there is a Client FQDN but no reserved hostname then both the
/// FQDN and lease hostname will be equal to the name provided in the
/// client FQDN adjusted according the the DhcpDdns configuration
/// parameters (e.g.replace-client-name, qualifying suffix...).
...
...
@@ -509,7 +509,7 @@ protected:
///
/// @todo Add support for multiple IAADDR options in the IA_NA.
///
/// @param answer A message begin
g
sent to the Client. If it holds the
/// @param answer A message begin
s
sent to the Client. If it holds the
/// Client FQDN option, this option is used to create NameChangeRequests.
void
createNameChangeRequests
(
const
Pkt6Ptr
&
answer
);
...
...
src/bin/dhcp6/json_config_parser.cc
View file @
7173c099
...
...
@@ -130,7 +130,7 @@ protected:
/// This class handles prefix delegation pool definitions for IPv6 subnets
/// Pool6 objects are created and stored in the given PoolStorage container.
///
/// PdPool defintions currently support three elements: prefix, prefix-len,
/// PdPool defin
i
tions currently support three elements: prefix, prefix-len,
/// and delegated-len, as shown in the example JSON text below:
///
/// @code
...
...
@@ -321,7 +321,7 @@ public:
/// @brief Constructor
///
/// @param ignored first parameter
/// stores global scope parameters, options, option defintions.
/// stores global scope parameters, options, option defin
i
tions.
Subnet6ConfigParser
(
const
std
::
string
&
)
:
SubnetConfigParser
(
""
,
globalContext
(),
IOAddress
(
"::"
))
{
}
...
...
@@ -341,7 +341,7 @@ public:
"Invalid cast in Subnet6ConfigParser::commit"
);
}
// Set relay infomation if it was provided
// Set relay info
r
mation if it was provided
if
(
relay_info_
)
{
sub6ptr
->
setRelayInfo
(
*
relay_info_
);
}
...
...
@@ -447,7 +447,7 @@ protected:
static_cast
<
SubnetID
>
(
uint32_values_
->
getOptionalParam
(
"id"
,
0
));
// Get interface-id option content. For now we support string
// represenation only
// represen
t
ation only
std
::
string
ifaceid
;
try
{
ifaceid
=
string_values_
->
getParam
(
"interface-id"
);
...
...
@@ -751,7 +751,7 @@ configureDhcp6Server(Dhcpv6Srv&, isc::data::ConstElementPtr config_set) {
// answer will hold the result.
ConstElementPtr
answer
;
// rollback informs whether error occured and original data
// rollback informs whether error occur
r
ed and original data
// have to be restored to global storages.
bool
rollback
=
false
;
// config_pair holds ther details of the current parser when iterating over
...
...
@@ -828,7 +828,7 @@ configureDhcp6Server(Dhcpv6Srv&, isc::data::ConstElementPtr config_set) {
LOG_ERROR
(
dhcp6_logger
,
DHCP6_PARSER_FAIL
)
.
arg
(
config_pair
.
first
).
arg
(
ex
.
what
());
answer
=
isc
::
config
::
createAnswer
(
1
,
ex
.
what
());
// An error occured, so make sure that we restore original data.
// An error occur
r
ed, so make sure that we restore original data.
rollback
=
true
;
}
catch
(...)
{
...
...
@@ -836,7 +836,7 @@ configureDhcp6Server(Dhcpv6Srv&, isc::data::ConstElementPtr config_set) {
LOG_ERROR
(
dhcp6_logger
,
DHCP6_PARSER_EXCEPTION
).
arg
(
config_pair
.
first
);
answer
=
isc
::
config
::
createAnswer
(
1
,
"undefined configuration"
" processing error"
);
// An error occured, so make sure that we restore original data.
// An error occur
r
ed, so make sure that we restore original data.
rollback
=
true
;
}
...
...
@@ -863,14 +863,14 @@ configureDhcp6Server(Dhcpv6Srv&, isc::data::ConstElementPtr config_set) {
catch
(
const
isc
::
Exception
&
ex
)
{
LOG_ERROR
(
dhcp6_logger
,
DHCP6_PARSER_COMMIT_FAIL
).
arg
(
ex
.
what
());
answer
=
isc
::
config
::
createAnswer
(
2
,
ex
.
what
());
// An error occured, so make sure to restore the original data.
// An error occur
r
ed, so make sure to restore the original data.
rollback
=
true
;
}
catch
(...)
{
// for things like bad_cast in boost::lexical_cast
LOG_ERROR
(
dhcp6_logger
,
DHCP6_PARSER_COMMIT_EXCEPTION
);
answer
=
isc
::
config
::
createAnswer
(
2
,
"undefined configuration"
" parsing error"
);
// An error occured, so make sure to restore the original data.
// An error occur
r
ed, so make sure to restore the original data.
rollback
=
true
;
}
}
...
...
src/bin/dhcp6/tests/config_parser_unittest.cc
View file @
7173c099
...
...
@@ -373,7 +373,7 @@ public:
// The default setting is to listen on all interfaces. In order to
// properly test interface configuration we disable listening on
// all interfaces before each test and later check that this setting
// has been overriden by the configuration used in the test.
// has been overrid
d
en by the configuration used in the test.
CfgMgr
::
instance
().
clear
();
// Create fresh context.
globalContext
()
->
copyContext
(
ParserContext
(
Option
::
V6
));
...
...
@@ -2856,7 +2856,7 @@ TEST_F(Dhcp6ParserTest, vendorOptionsCsv) {
TEST_F
(
Dhcp6ParserTest
,
DISABLED_stdOptionDataEncapsulate
)
{
// The configuration is two stage process in this test.
// In the first sta
h
e we create definitions of suboptions
// In the first sta
g
e we create definitions of suboptions
// that we will add to the base option.
// Let's create some dummy options: foo and foo2.
string
config
=
"{ "
+
genIfaceConfig
()
+
","
...
...
@@ -3559,7 +3559,7 @@ TEST_F(Dhcp6ParserTest, reservations) {
ASSERT_TRUE
(
hosts_cfg
);
// Let's create an object holding hardware address of the host having
// a reservation in the subnet having id of 234. For simlicity the
// a reservation in the subnet having id of 234. For sim
p
licity the
// address is a collection of numbers from 1 to 6.
std
::
vector
<
uint8_t
>
hwaddr_vec
;
for
(
int
i
=
1
;
i
<
7
;
++
i
)
{
...
...
@@ -3626,7 +3626,7 @@ TEST_F(Dhcp6ParserTest, reservations) {
EXPECT_FALSE
(
hosts_cfg
->
get6
(
234
,
duid
));
}
// This test verfies that the bogus host reservation would trigger a
// This test ver
i
fies that the bogus host reservation would trigger a
// server configuration error.
TEST_F
(
Dhcp6ParserTest
,
reservationBogus
)
{
// Case 1: misspelled "duid" parameter.
...
...
src/bin/dhcp6/tests/confirm_unittest.cc
View file @
7173c099
...
...
@@ -288,7 +288,7 @@ TEST_F(ConfirmTest, relayedClientNoSubnet) {
EXPECT_FALSE
(
client
.
getContext
().
response_
);
}
// This test checks that the relayed Confirm mess
s
age is processed by the server
// This test checks that the relayed Confirm message is processed by the server
// when sent to unicast address RFC3315, section 18.2.8).
TEST_F
(
ConfirmTest
,
relayedUnicast
)
{
Dhcp6Client
client
;
...
...
src/bin/dhcp6/tests/d2_unittest.h
View file @
7173c099
// Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2014
, 2015
Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
...
...
@@ -99,7 +99,7 @@ public:
/// @param exp_result indicates if configuration should pass or fail
void
configure
(
const
std
::
string
&
config
,
bool
exp_result
=
SHOULD_PASS
);
/// @brief Contructs a NameChangeRequest message from a fixed JSON string.
/// @brief Con
s
tructs a NameChangeRequest message from a fixed JSON string.
///
/// @param dhcid_id_num Integer value to use as the DHCID.
dhcp_ddns
::
NameChangeRequestPtr
buildTestNcr
(
uint32_t
...
...
@@ -108,7 +108,7 @@ public:
/// @brief Stores the return code of the last configuration attempt.
int
rcode_
;
/// @brief Stores the message component of the last configuration
t
attempt.
/// @brief Stores the message component of the last configuration attempt.
isc
::
data
::
ConstElementPtr
comment_
;
/// @brief Server object under test.
...
...
src/bin/dhcp6/tests/dhcp6_client.h
View file @
7173c099
...
...
@@ -177,7 +177,7 @@ public:
/// @param lease A lease to be applied for the client.
void
createLease
(
const
Lease6
&
lease
);
/// @brief Performs a 4-way echange between the client and the server.
/// @brief Performs a 4-way e
x
change between the client and the server.
///
/// If the 4-way exchange is successful, the client should acquire leases
/// according to the server's current configuration and the type of leases
...
...
@@ -375,7 +375,7 @@ public:
///
/// By default, the client uses All_DHCP_Relay_Agents_and_Servers
/// multicast address to communicate with the server. In certain cases
/// it ay be desired that different address is used (e.g. unicast in Renew).
/// it
m
ay be desired that different address is used (e.g. unicast in Renew).
/// This function sets the new address for all future exchanges with the
/// server.
///
...
...
@@ -465,7 +465,7 @@ public:
/// @brief RelayInfo (information about relays)
///
/// Dhcp6Client will typically contruct this info itself, but if
/// Dhcp6Client will typically con
s
truct this info itself, but if
/// it is provided here by the test, this data will be used as is.
std
::
vector
<
Pkt6
::
RelayInfo
>
relay_info_
;
...
...
@@ -579,7 +579,7 @@ private:
/// @brief Current context (sent and received message).
Context
context_
;
/// @b
i
ref Current transaction id (altered on each send).
/// @br
i
ef Current transaction id (altered on each send).
uint32_t
curr_transid_
;
/// @brief Currently used destination address.
...
...
src/bin/dhcp6/tests/dhcp6_message_test.h
View file @
7173c099
// Copyright (C) 2014 Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2014
, 2015
Internet Systems Consortium, Inc. ("ISC")
//
// Permission to use, copy, modify, and/or distribute this software for any
// purpose with or without fee is hereby granted, provided that the above
...
...
@@ -60,7 +60,7 @@ public:
/// @brief Increases the first byte of the address.
///
/// This function is helpful to find an address which belongs to the
/// different subnet than the input address. It is achived by increasing
/// different subnet than the input address. It is achi
e
ved by increasing
/// the first byte of the input address.
///
/// @param input_addr An input addres.
...
...
src/bin/dhcp6/tests/dhcp6_srv_unittest.cc
View file @
7173c099
...
...
@@ -1092,7 +1092,7 @@ TEST_F(Dhcpv6SrvTest, testServerID) {
Pkt6Ptr
req
=
Pkt6Ptr
(
new
Pkt6
(
DHCPV6_REQUEST
,
1234
));
std
::
vector
<
uint8_t
>
bin
;
// d
i
ud_llt constructed with: time = 0, macaddress = 00:00:00:00:00:00
// du
i
d_llt constructed with: time = 0, macaddress = 00:00:00:00:00:00
// it's necessary to generate server identifier option
isc
::
util
::
encode
::
decodeHex
(
"0001000100000000000000000000"
,
bin
);
// Now create server identifier option
...
...
@@ -1103,7 +1103,7 @@ TEST_F(Dhcpv6SrvTest, testServerID) {
// server is using.
req
->
addOption
(
serverid
);
// Message shoud be dropped
// Message shou
l
d be dropped
EXPECT_FALSE
(
srv
.
testServerID
(
req
));
// Delete server identifier option and add new one, with same value as
...
...
@@ -1635,7 +1635,7 @@ TEST_F(Dhcpv6SrvTest, vendorOptionsORO) {
adv
=
srv_
.
processSolicit
(
sol
);
ASSERT_TRUE
(
adv
);
// Check if thre is vendor option response
// Check if th
e
re is vendor option response
OptionPtr
tmp
=
adv
->
getOption
(
D6O_VENDOR_OPTS
);
ASSERT_TRUE
(
tmp
);
...
...
@@ -1860,7 +1860,7 @@ TEST_F(Dhcpv6SrvTest, clientClassify2) {
// Still not supported, because it belongs to wrong class.
EXPECT_FALSE
(
srv_
.
selectSubnet
(
sol
));
// Let's add it to maching class.
// Let's add it to ma
t
ching class.
sol
->
addClass
(
"foo"
);
// This time it should work
...
...
src/bin/dhcp6/tests/dhcp6_test_utils.cc
View file @
7173c099
...
...
@@ -106,7 +106,7 @@ Dhcpv6SrvTest::checkIA_PD(const Pkt6Ptr& rsp, uint32_t expected_iaid,
}
// Checks if the lease sent to client is present in the database
// and is valid when checked aga
s
int the configured subnet
// and is valid when checked again
s
t the configured subnet
Lease6Ptr
Dhcpv6SrvTest
::
checkLease
(
const
DuidPtr
&
duid
,
const
OptionPtr
&
ia_na
,
boost
::
shared_ptr
<
Option6IAAddr
>
addr
)
{
...
...
src/bin/dhcp6/tests/dhcp6_test_utils.h
View file @
7173c099
...
...
@@ -321,7 +321,7 @@ class Dhcpv6SrvTest : public NakedDhcpv6SrvTest {
public:
/// Name of the server-id file (used in server-id tests)
/// @brief Constructor that initalizes a simple default configuration
/// @brief Constructor that init
i
alizes a simple default configuration
///
/// Sets up a single subnet6 with one pool for addresses and second
/// pool for prefixes.
...
...
src/bin/dhcp6/tests/fqdn_unittest.cc
View file @
7173c099
...
...
@@ -469,7 +469,7 @@ public:
/// NameChangeRequest.
/// @param dhcid An expected DHCID value.
/// @note This value is the value that is produced by
/// dhcp_ddns::D2Dhcid::crateDigest() with the appropriate arguments. This
/// dhcp_ddns::D2Dhcid::cr
e
ateDigest() with the appropriate arguments. This
/// method uses encryption tools to produce the value which cannot be
/// easily duplicated by hand. It is more or less necessary to generate
/// these values programmatically and place them here. Should the
...
...
@@ -540,7 +540,7 @@ public:
};
// A set of tests verifying server's behavio
u
r when it receives the DHCPv6
// A set of tests verifying server's behavior when it receives the DHCPv6
// Client Fqdn Option.
// Test server's response when client requests that server performs AAAA update.
...
...
src/bin/dhcp6/tests/hooks_unittest.cc
View file @
7173c099
...
...
@@ -351,7 +351,7 @@ public:
static
int
subnet6_select_different_subnet_callout
(
CalloutHandle
&
callout_handle
)
{
// Call the basic call
l
out to record all passed values
// Call the basic callout to record all passed values
subnet6_select_callout
(
callout_handle
);
const
Subnet6Collection
*
subnets
;
...
...
@@ -569,7 +569,7 @@ TEST_F(HooksDhcpv6SrvTest, valueChange_buffer6_receive) {
// In particular, it should call registered pkt6_receive callback.
srv_
->
run
();
// Check that the server did send a repos
onc
e
// Check that the server did send a re
s
po
n
se
ASSERT_EQ
(
1
,
srv_
->
fake_sent_
.
size
());
// Make sure that we received a response
...
...
@@ -690,7 +690,7 @@ TEST_F(HooksDhcpv6SrvTest, valueChange_pkt6_receive) {
// In particular, it should call registered pkt6_receive callback.
srv_
->
run
();
// Check that the server did send a repos
onc
e
// Check that the server did send a re
s
po
n
se
ASSERT_EQ
(
1
,
srv_
->
fake_sent_
.
size
());
// Make sure that we received a response
...
...
src/bin/dhcp6/tests/rebind_unittest.cc
View file @
7173c099
...
...
@@ -463,7 +463,7 @@ TEST_F(RebindTest, relayedClientLostLease) {
}
// Check that relayed client receives the IA with lifetimes of 0, when
// client is t
g
rying to Rebind using an address it doesn't have.
// client is trying to Rebind using an address it doesn't have.
TEST_F
(
RebindTest
,
relayedClientChangingAddress
)
{
Dhcp6Client
client
;
// Configure client to request IA_NA.
...
...
@@ -514,7 +514,7 @@ TEST_F(RebindTest, relayedClientChangingAddress) {
// Check that server still has the same lease.
Lease6Ptr
lease_server
=
checkLease
(
lease_client
);
EXPECT_TRUE
(
lease_server
);
// Make sure that the lease in the data base hasn't been adde
cte
d.
// Make sure that the lease in the data base hasn't been added.
EXPECT_NE
(
0
,
lease_server
->
valid_lft_
);
EXPECT_NE
(
0
,
lease_server
->
preferred_lft_
);
}
...
...
@@ -661,13 +661,13 @@ TEST_F(RebindTest, directClientPDChangingPrefix) {
// Check that server still has the same lease.
Lease6Ptr
lease_server
=
checkLease
(
lease_client
);
ASSERT_TRUE
(
lease_server
);
// Make sure that the lease in the data base hasn't been adde
cte
d.
// Make sure that the lease in the data base hasn't been added.
EXPECT_NE
(
0
,
lease_server
->
valid_lft_
);
EXPECT_NE
(
0
,
lease_server
->
preferred_lft_
);
}
/// @todo Extend PD tests for relayed messages.
/// @todo Extend PD tests to cover same prefix b
uyt
different length.
/// @todo Extend PD tests to cover same prefix b
y
different length.
// This test checks that the Rebind message is discarded by the server if it
// has been sent to unicast address (RFC3315, section 15).