-// Copyright (C) 2015-2016 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015-2017 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
}
void Dhcp4to6Ipc::open() {
- uint32_t port = CfgMgr::instance().getStagingCfg()->getDhcp4o6Port();
+ uint16_t port = CfgMgr::instance().getStagingCfg()->getDhcp4o6Port();
if (port == 0) {
Dhcp4o6IpcBase::close();
return;
}
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);
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);
}
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
-// Copyright (C) 2015-2016 Internet Systems Consortium, Inc. ("ISC")
+// Copyright (C) 2015-2017 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
}
void Dhcp6to4Ipc::open() {
- uint32_t port = CfgMgr::instance().getStagingCfg()->getDhcp4o6Port();
+ uint16_t port = CfgMgr::instance().getStagingCfg()->getDhcp4o6Port();
if (port == 0) {
Dhcp4o6IpcBase::close();
return;
}
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);
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);
}
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
/// this socket is bound and connected to this port and port + 1
///
/// @param port port and port + 1 to use
- void setDhcp4o6Port(uint32_t port) {
+ void setDhcp4o6Port(uint16_t port) {
/// @todo: Port is supposed to be uint16_t, not uint32_t
dhcp4o6_port_ = port;
}
///
/// See @ref setDhcp4o6Port for brief discussion.
/// @return value of DHCP4o6 IPC port
- uint32_t getDhcp4o6Port() {
+ uint16_t getDhcp4o6Port() {
return (dhcp4o6_port_);
}
///
/// DHCPv4-over-DHCPv6 uses a UDP socket for interserver communication,
/// this socket is bound and connected to this port and port + 1
- uint32_t dhcp4o6_port_;
+ uint16_t dhcp4o6_port_;
D2ClientConfigPtr d2_client_config_;
};