Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Kea
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Operations
Operations
Incidents
Packages & Registries
Packages & Registries
Container Registry
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Adam Osuchowski
Kea
Commits
33f7238e
Commit
33f7238e
authored
Mar 05, 2015
by
Tomek Mrugalski
🛰
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[3705] Dhcp6Client improvements:
- is now able to use specified relay information - stores received options
parent
4495b7a7
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
29 additions
and
8 deletions
+29
-8
src/bin/dhcp6/tests/dhcp6_client.cc
src/bin/dhcp6/tests/dhcp6_client.cc
+15
-7
src/bin/dhcp6/tests/dhcp6_client.h
src/bin/dhcp6/tests/dhcp6_client.h
+14
-1
No files found.
src/bin/dhcp6/tests/dhcp6_client.cc
View file @
33f7238e
...
...
@@ -76,6 +76,8 @@ Dhcp6Client::applyRcvdConfiguration(const Pkt6Ptr& reply) {
for
(
Opts
::
const_iterator
opt
=
opts
.
begin
();
opt
!=
opts
.
end
();
++
opt
)
{
Option6IAPtr
ia
=
boost
::
dynamic_pointer_cast
<
Option6IA
>
(
opt
->
second
);
if
(
!
ia
)
{
// This is not IA, so let's just store it.
config_
.
options_
.
insert
(
*
opt
);
continue
;
}
...
...
@@ -453,13 +455,19 @@ Dhcp6Client::sendMsg(const Pkt6Ptr& msg) {
srv_
->
shutdown_
=
false
;
// The client is configured to send through the relay. We achieve that
// adding the relay structure.
if
(
use_relay_
)
{
Pkt6
::
RelayInfo
relay
;
relay
.
linkaddr_
=
relay_link_addr_
;
relay
.
peeraddr_
=
asiolink
::
IOAddress
(
"fe80::1"
);
relay
.
msg_type_
=
DHCPV6_RELAY_FORW
;
relay
.
hop_count_
=
1
;
msg
->
relay_info_
.
push_back
(
relay
);
if
(
use_relay_
||
!
relay_info_
.
empty
())
{
if
(
relay_info_
.
empty
())
{
// Let's craft the relay info by hand
Pkt6
::
RelayInfo
relay
;
relay
.
linkaddr_
=
relay_link_addr_
;
relay
.
peeraddr_
=
asiolink
::
IOAddress
(
"fe80::1"
);
relay
.
msg_type_
=
DHCPV6_RELAY_FORW
;
relay
.
hop_count_
=
1
;
msg
->
relay_info_
.
push_back
(
relay
);
}
else
{
// The test provided relay_info_, let's use that.
msg
->
relay_info_
=
relay_info_
;
}
}
// Repack the message to simulate wire-data parsing.
msg
->
pack
();
...
...
src/bin/dhcp6/tests/dhcp6_client.h
View file @
33f7238e
...
...
@@ -74,10 +74,17 @@ public:
/// @brief Holds the current client configuration obtained from the
/// server over DHCP.
///
/// Currently it simply contains the collection of leases acquired.
/// Currently it simply contains the collection of leases acquired
/// and a list of options. Note: this is a simple copy of all
/// non-IA options and often includes "protocol" options, like
/// server-id and client-id.
struct
Configuration
{
/// @brief List of received leases
std
::
vector
<
LeaseInfo
>
leases_
;
/// @brief List of received options
OptionCollection
options_
;
/// @brief Status code received in the global option scope.
uint16_t
status_code_
;
...
...
@@ -388,6 +395,12 @@ public:
/// @brief Link address of the relay to be used for relayed messages.
asiolink
::
IOAddress
relay_link_addr_
;
/// @brief RelayInfo (information about relays)
///
/// Dhcp6Client will typically contruct 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_
;
/// @brief Controls whether the client will send ORO
///
/// The actual content of the ORO is specified in oro_.
...
...
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