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
445
Issues
445
List
Boards
Labels
Service Desk
Milestones
Merge Requests
71
Merge Requests
71
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
ISC Open Source Projects
Kea
Commits
efaa41c9
Commit
efaa41c9
authored
Feb 10, 2017
by
Francis Dupont
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[5126] Made DHCPv4o6 port uint16_t
parent
ca4a11ca
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
35 additions
and
15 deletions
+35
-15
src/bin/dhcp4/dhcp4to6_ipc.cc
src/bin/dhcp4/dhcp4to6_ipc.cc
+3
-4
src/bin/dhcp4/json_config_parser.cc
src/bin/dhcp4/json_config_parser.cc
+13
-2
src/bin/dhcp6/dhcp6to4_ipc.cc
src/bin/dhcp6/dhcp6to4_ipc.cc
+3
-4
src/bin/dhcp6/json_config_parser.cc
src/bin/dhcp6/json_config_parser.cc
+13
-2
src/lib/dhcpsrv/srv_config.h
src/lib/dhcpsrv/srv_config.h
+3
-3
No files found.
src/bin/dhcp4/dhcp4to6_ipc.cc
View file @
efaa41c9
// Copyright (C) 2015-201
6
Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2015-201
7
Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
...
...
@@ -35,7 +35,7 @@ Dhcp4to6Ipc& Dhcp4to6Ipc::instance() {
}
void
Dhcp4to6Ipc
::
open
()
{
uint
32
_t
port
=
CfgMgr
::
instance
().
getStagingCfg
()
->
getDhcp4o6Port
();
uint
16
_t
port
=
CfgMgr
::
instance
().
getStagingCfg
()
->
getDhcp4o6Port
();
if
(
port
==
0
)
{
Dhcp4o6IpcBase
::
close
();
return
;
...
...
@@ -45,8 +45,7 @@ void Dhcp4to6Ipc::open() {
}
int
old_fd
=
socket_fd_
;
socket_fd_
=
Dhcp4o6IpcBase
::
open
(
static_cast
<
uint16_t
>
(
port
),
ENDPOINT_TYPE_V4
);
socket_fd_
=
Dhcp4o6IpcBase
::
open
(
port
,
ENDPOINT_TYPE_V4
);
if
((
old_fd
==
-
1
)
&&
(
socket_fd_
!=
old_fd
))
{
IfaceMgr
::
instance
().
addExternalSocket
(
socket_fd_
,
Dhcp4to6Ipc
::
handler
);
...
...
src/bin/dhcp4/json_config_parser.cc
View file @
efaa41c9
...
...
@@ -339,8 +339,7 @@ public:
cfg
->
setDeclinePeriod
(
probation_period
);
// Set the DHCPv4-over-DHCPv6 interserver port.
// @todo Change for uint16_t
uint32_t
dhcp4o6_port
=
getUint32
(
global
,
"dhcp4o6-port"
);
uint16_t
dhcp4o6_port
=
getUint16
(
global
,
"dhcp4o6-port"
);
cfg
->
setDhcp4o6Port
(
dhcp4o6_port
);
}
...
...
@@ -357,6 +356,18 @@ private:
const
std
::
string
&
name
)
{
return
(
getIntType
<
uint32_t
>
(
scope
,
name
));
}
/// @brief Returns a value converted to uint16_t
///
/// Instantiation of getIntType() to uint16_t
///
/// @param scope specified parameter will be extracted from this scope
/// @param name name of the parameter
/// @return an uint16_t value
uint16_t
getUint16
(
isc
::
data
::
ConstElementPtr
scope
,
const
std
::
string
&
name
)
{
return
(
getIntType
<
uint16_t
>
(
scope
,
name
));
}
};
}
// anonymous namespace
...
...
src/bin/dhcp6/dhcp6to4_ipc.cc
View file @
efaa41c9
// Copyright (C) 2015-201
6
Internet Systems Consortium, Inc. ("ISC")
// Copyright (C) 2015-201
7
Internet Systems Consortium, Inc. ("ISC")
//
// This Source Code Form is subject to the terms of the Mozilla Public
// License, v. 2.0. If a copy of the MPL was not distributed with this
...
...
@@ -34,7 +34,7 @@ Dhcp6to4Ipc& Dhcp6to4Ipc::instance() {
}
void
Dhcp6to4Ipc
::
open
()
{
uint
32
_t
port
=
CfgMgr
::
instance
().
getStagingCfg
()
->
getDhcp4o6Port
();
uint
16
_t
port
=
CfgMgr
::
instance
().
getStagingCfg
()
->
getDhcp4o6Port
();
if
(
port
==
0
)
{
Dhcp4o6IpcBase
::
close
();
return
;
...
...
@@ -44,8 +44,7 @@ void Dhcp6to4Ipc::open() {
}
int
old_fd
=
socket_fd_
;
socket_fd_
=
Dhcp4o6IpcBase
::
open
(
static_cast
<
uint16_t
>
(
port
),
ENDPOINT_TYPE_V6
);
socket_fd_
=
Dhcp4o6IpcBase
::
open
(
port
,
ENDPOINT_TYPE_V6
);
if
((
old_fd
==
-
1
)
&&
(
socket_fd_
!=
old_fd
))
{
IfaceMgr
::
instance
().
addExternalSocket
(
socket_fd_
,
Dhcp6to4Ipc
::
handler
);
...
...
src/bin/dhcp6/json_config_parser.cc
View file @
efaa41c9
...
...
@@ -545,8 +545,7 @@ public:
srv_config
->
setDeclinePeriod
(
probation_period
);
// Set the DHCPv4-over-DHCPv6 interserver port.
// @todo Change for uint16_t
uint32_t
dhcp4o6_port
=
getUint32
(
global
,
"dhcp4o6-port"
);
uint16_t
dhcp4o6_port
=
getUint16
(
global
,
"dhcp4o6-port"
);
srv_config
->
setDhcp4o6Port
(
dhcp4o6_port
);
}
...
...
@@ -563,6 +562,18 @@ private:
const
std
::
string
&
name
)
{
return
(
getIntType
<
uint32_t
>
(
scope
,
name
));
}
/// @brief Returns a value converted to uint16_t
///
/// Instantiation of getIntType() to uint16_t
///
/// @param scope specified parameter will be extracted from this scope
/// @param name name of the parameter
/// @return an uint16_t value
uint16_t
getUint16
(
isc
::
data
::
ConstElementPtr
scope
,
const
std
::
string
&
name
)
{
return
(
getIntType
<
uint16_t
>
(
scope
,
name
));
}
};
}
// anonymous namespace
...
...
src/lib/dhcpsrv/srv_config.h
View file @
efaa41c9
...
...
@@ -476,7 +476,7 @@ public:
/// this socket is bound and connected to this port and port + 1
///
/// @param port port and port + 1 to use
void
setDhcp4o6Port
(
uint
32
_t
port
)
{
void
setDhcp4o6Port
(
uint
16
_t
port
)
{
/// @todo: Port is supposed to be uint16_t, not uint32_t
dhcp4o6_port_
=
port
;
}
...
...
@@ -485,7 +485,7 @@ public:
///
/// See @ref setDhcp4o6Port for brief discussion.
/// @return value of DHCP4o6 IPC port
uint
32
_t
getDhcp4o6Port
()
{
uint
16
_t
getDhcp4o6Port
()
{
return
(
dhcp4o6_port_
);
}
...
...
@@ -587,7 +587,7 @@ private:
///
/// DHCPv4-over-DHCPv6 uses a UDP socket for interserver communication,
/// this socket is bound and connected to this port and port + 1
uint
32
_t
dhcp4o6_port_
;
uint
16
_t
dhcp4o6_port_
;
D2ClientConfigPtr
d2_client_config_
;
};
...
...
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