Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
7
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Open sidebar
ISC Open Source Projects
Kea
Commits
60606cab
Commit
60606cab
authored
Jan 10, 2013
by
Tomek Mrugalski
🛰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[2320] perfdhcp tests updated after Pkt4::setType() changed.
parent
b8b0b9c2
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
9 deletions
+6
-9
tests/tools/perfdhcp/perf_pkt4.cc
tests/tools/perfdhcp/perf_pkt4.cc
+1
-1
tests/tools/perfdhcp/test_control.cc
tests/tools/perfdhcp/test_control.cc
+5
-5
tests/tools/perfdhcp/tests/test_control_unittest.cc
tests/tools/perfdhcp/tests/test_control_unittest.cc
+0
-3
No files found.
tests/tools/perfdhcp/perf_pkt4.cc
View file @
60606cab
...
@@ -13,7 +13,7 @@
...
@@ -13,7 +13,7 @@
// PERFORMANCE OF THIS SOFTWARE.
// PERFORMANCE OF THIS SOFTWARE.
#include <dhcp/libdhcp++.h>
#include <dhcp/libdhcp++.h>
#include <dhcp/dhcp
6
.h>
#include <dhcp/dhcp
4
.h>
#include "perf_pkt4.h"
#include "perf_pkt4.h"
...
...
tests/tools/perfdhcp/test_control.cc
View file @
60606cab
...
@@ -1284,6 +1284,10 @@ TestControl::sendDiscover4(const TestControlSocket& socket,
...
@@ -1284,6 +1284,10 @@ TestControl::sendDiscover4(const TestControlSocket& socket,
if
(
!
pkt4
)
{
if
(
!
pkt4
)
{
isc_throw
(
Unexpected
,
"failed to create DISCOVER packet"
);
isc_throw
(
Unexpected
,
"failed to create DISCOVER packet"
);
}
}
// Delete the default Message Type option set by Pkt4
pkt4
->
delOption
(
DHO_DHCP_MESSAGE_TYPE
);
// Set options: DHCP_MESSAGE_TYPE and DHCP_PARAMETER_REQUEST_LIST
// Set options: DHCP_MESSAGE_TYPE and DHCP_PARAMETER_REQUEST_LIST
OptionBuffer
buf_msg_type
;
OptionBuffer
buf_msg_type
;
buf_msg_type
.
push_back
(
DHCPDISCOVER
);
buf_msg_type
.
push_back
(
DHCPDISCOVER
);
...
@@ -1371,11 +1375,7 @@ TestControl::sendRequest4(const TestControlSocket& socket,
...
@@ -1371,11 +1375,7 @@ TestControl::sendRequest4(const TestControlSocket& socket,
const
dhcp
::
Pkt4Ptr
&
offer_pkt4
)
{
const
dhcp
::
Pkt4Ptr
&
offer_pkt4
)
{
const
uint32_t
transid
=
generateTransid
();
const
uint32_t
transid
=
generateTransid
();
Pkt4Ptr
pkt4
(
new
Pkt4
(
DHCPREQUEST
,
transid
));
Pkt4Ptr
pkt4
(
new
Pkt4
(
DHCPREQUEST
,
transid
));
OptionBuffer
buf_msg_type
;
buf_msg_type
.
push_back
(
DHCPREQUEST
);
OptionPtr
opt_msg_type
=
Option
::
factory
(
Option
::
V4
,
DHO_DHCP_MESSAGE_TYPE
,
buf_msg_type
);
pkt4
->
addOption
(
opt_msg_type
);
// Use first flags indicates that we want to use the server
// Use first flags indicates that we want to use the server
// id captured in first packet.
// id captured in first packet.
if
(
CommandOptions
::
instance
().
isUseFirst
()
&&
if
(
CommandOptions
::
instance
().
isUseFirst
()
&&
...
...
tests/tools/perfdhcp/tests/test_control_unittest.cc
View file @
60606cab
...
@@ -630,13 +630,10 @@ private:
...
@@ -630,13 +630,10 @@ private:
boost
::
shared_ptr
<
Pkt4
>
boost
::
shared_ptr
<
Pkt4
>
createOfferPkt4
(
uint32_t
transid
)
const
{
createOfferPkt4
(
uint32_t
transid
)
const
{
boost
::
shared_ptr
<
Pkt4
>
offer
(
new
Pkt4
(
DHCPOFFER
,
transid
));
boost
::
shared_ptr
<
Pkt4
>
offer
(
new
Pkt4
(
DHCPOFFER
,
transid
));
OptionPtr
opt_msg_type
=
Option
::
factory
(
Option
::
V4
,
DHO_DHCP_MESSAGE_TYPE
,
OptionBuffer
(
DHCPOFFER
));
OptionPtr
opt_serverid
=
Option
::
factory
(
Option
::
V4
,
OptionPtr
opt_serverid
=
Option
::
factory
(
Option
::
V4
,
DHO_DHCP_SERVER_IDENTIFIER
,
DHO_DHCP_SERVER_IDENTIFIER
,
OptionBuffer
(
4
,
1
));
OptionBuffer
(
4
,
1
));
offer
->
setYiaddr
(
asiolink
::
IOAddress
(
"127.0.0.1"
));
offer
->
setYiaddr
(
asiolink
::
IOAddress
(
"127.0.0.1"
));
offer
->
addOption
(
opt_msg_type
);
offer
->
addOption
(
opt_serverid
);
offer
->
addOption
(
opt_serverid
);
offer
->
updateTimestamp
();
offer
->
updateTimestamp
();
return
(
offer
);
return
(
offer
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment