mirror of
https://gitlab.isc.org/isc-projects/kea
synced 2025-08-30 13:37:55 +00:00
[3604] Renamed the socket-type parameter to dhcp-socket-type.
This commit is contained in:
@@ -58,7 +58,7 @@
|
||||
"Dhcp4": {
|
||||
"interfaces-config": {
|
||||
"interfaces": [ "eth0" ],
|
||||
"socket-type": "raw"
|
||||
"dhcp-socket-type": "raw"
|
||||
},
|
||||
"valid-lifetime": 4000,
|
||||
"renew-timer": 1000,
|
||||
|
@@ -415,16 +415,16 @@ temporarily override a list of interface names and listen on all interfaces.
|
||||
"Dhcp4": {
|
||||
"interfaces-config": {
|
||||
"interfaces": [ <userinput>"eth1", "eth3"</userinput> ],
|
||||
"socket-type": "datagram"
|
||||
"dhcp-socket-type": "datagram"
|
||||
},
|
||||
...
|
||||
}
|
||||
</screen>
|
||||
The <command>socket-type</command> specifies that the datagram sockets will
|
||||
The <command>dhcp-socket-type</command> specifies that the datagram sockets will
|
||||
be opened on all interfaces on which the server listens, i.e. "eth1" and
|
||||
"eth3" in our case. If the <command>socket-type</command> is set to
|
||||
"eth3" in our case. If the <command>dhcp-socket-type</command> is set to
|
||||
<userinput>raw</userinput>, it configures the server to use raw sockets
|
||||
instead. If the <command>socket-type</command> value is not specified, the
|
||||
instead. If the <command>dhcp-socket-type</command> value is not specified, the
|
||||
default value <userinput>raw</userinput> is used.
|
||||
</para>
|
||||
|
||||
|
@@ -36,7 +36,7 @@
|
||||
}
|
||||
},
|
||||
|
||||
{ "item_name": "socket-type",
|
||||
{ "item_name": "dhcp-socket-type",
|
||||
"item_type": "string",
|
||||
"item_optional": true,
|
||||
"item_default": ""
|
||||
|
@@ -99,9 +99,9 @@ This is a debug message reporting that the DHCP configuration manager has
|
||||
returned the specified IPv6 subnet when given the address hint specified
|
||||
because it is the only subnet defined.
|
||||
|
||||
% DHCPSRV_CFGMGR_SOCKET_TYPE_DEFAULT "socket-type" not specified , using default socket type %1
|
||||
% DHCPSRV_CFGMGR_SOCKET_TYPE_DEFAULT "dhcp-socket-type" not specified , using default socket type %1
|
||||
This informational message is logged when the administrator hasn't
|
||||
specified the "socket-type" parameter in configuration for interfaces.
|
||||
specified the "dhcp-socket-type" parameter in configuration for interfaces.
|
||||
In such case, the default socket type will be used.
|
||||
|
||||
% DHCPSRV_CFGMGR_SOCKET_RAW_UNSUPPORTED use of raw sockets is unsupported on this OS, datagram sockets will be used
|
||||
|
@@ -92,7 +92,7 @@ IfacesConfigParser4::build(isc::data::ConstElementPtr ifaces_config) {
|
||||
bool socket_type_specified = false;
|
||||
BOOST_FOREACH(ConfigPair element, ifaces_config->mapValue()) {
|
||||
try {
|
||||
if (element.first == "socket-type") {
|
||||
if (element.first == "dhcp-socket-type") {
|
||||
cfg->useSocketType(AF_INET, element.second->stringValue());
|
||||
socket_type_specified = true;
|
||||
|
||||
|
@@ -129,7 +129,7 @@ public:
|
||||
///
|
||||
/// Internally it invokes the @c InterfaceConfigParser::build to parse
|
||||
/// generic parameters. In addition, it parses the following parameters:
|
||||
/// - socket-type
|
||||
/// - dhcp-socket-type
|
||||
///
|
||||
/// @param ifaces_config A data element holding configuration of
|
||||
/// interfaces.
|
||||
|
@@ -103,7 +103,7 @@ TEST_F(IfacesConfigParserTest, socketTypeRaw) {
|
||||
|
||||
// Configuration with a raw socket selected.
|
||||
std::string config = "{ ""\"interfaces\": [ ],"
|
||||
" \"socket-type\": \"raw\" }";
|
||||
" \"dhcp-socket-type\": \"raw\" }";
|
||||
|
||||
ElementPtr config_element = Element::fromJSON(config);
|
||||
|
||||
@@ -128,7 +128,7 @@ TEST_F(IfacesConfigParserTest, socketTypeDatagram) {
|
||||
|
||||
// Configuration with a datagram socket selected.
|
||||
std::string config = "{ ""\"interfaces\": [ ],"
|
||||
" \"socket-type\": \"datagram\" }";
|
||||
" \"dhcp-socket-type\": \"datagram\" }";
|
||||
|
||||
ElementPtr config_element = Element::fromJSON(config);
|
||||
|
||||
@@ -149,14 +149,14 @@ TEST_F(IfacesConfigParserTest, socketTypeInvalid) {
|
||||
// For DHCPv4 we only accept the raw socket or datagram socket.
|
||||
IfacesConfigParser4 parser4;
|
||||
std::string config = "{ \"interfaces\": [ ],"
|
||||
"\"socket-type\": \"default\" }";
|
||||
"\"dhcp-socket-type\": \"default\" }";
|
||||
ElementPtr config_element = Element::fromJSON(config);
|
||||
ASSERT_THROW(parser4.build(config_element), DhcpConfigError);
|
||||
|
||||
// For DHCPv6 we don't accept any socket type.
|
||||
IfacesConfigParser6 parser6;
|
||||
config = "{ \"interfaces\": [ ],"
|
||||
" \"socket-type\": \"datagram\" }";
|
||||
" \"dhcp-socket-type\": \"datagram\" }";
|
||||
config_element = Element::fromJSON(config);
|
||||
ASSERT_THROW(parser6.build(config_element), DhcpConfigError);
|
||||
}
|
||||
|
Reference in New Issue
Block a user