From bb16ee10e1323929a4cbc6bcc45cf7296ba9b7a5 Mon Sep 17 00:00:00 2001 From: Marcin Siodelski Date: Fri, 13 Feb 2015 11:43:48 +0100 Subject: [PATCH] [3604] Renamed the socket-type parameter to dhcp-socket-type. --- doc/guide/config.xml | 2 +- doc/guide/dhcp4-srv.xml | 8 ++++---- src/bin/dhcp4/dhcp4.spec | 2 +- src/lib/dhcpsrv/dhcpsrv_messages.mes | 4 ++-- src/lib/dhcpsrv/parsers/ifaces_config_parser.cc | 2 +- src/lib/dhcpsrv/parsers/ifaces_config_parser.h | 2 +- src/lib/dhcpsrv/tests/ifaces_config_parser_unittest.cc | 8 ++++---- 7 files changed, 14 insertions(+), 14 deletions(-) diff --git a/doc/guide/config.xml b/doc/guide/config.xml index 5214986511..565c7fa49a 100644 --- a/doc/guide/config.xml +++ b/doc/guide/config.xml @@ -58,7 +58,7 @@ "Dhcp4": { "interfaces-config": { "interfaces": [ "eth0" ], - "socket-type": "raw" + "dhcp-socket-type": "raw" }, "valid-lifetime": 4000, "renew-timer": 1000, diff --git a/doc/guide/dhcp4-srv.xml b/doc/guide/dhcp4-srv.xml index f0864e5127..98b5160f02 100644 --- a/doc/guide/dhcp4-srv.xml +++ b/doc/guide/dhcp4-srv.xml @@ -415,16 +415,16 @@ temporarily override a list of interface names and listen on all interfaces. "Dhcp4": { "interfaces-config": { "interfaces": [ "eth1", "eth3" ], - "socket-type": "datagram" + "dhcp-socket-type": "datagram" }, ... } - The socket-type specifies that the datagram sockets will + The dhcp-socket-type 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 socket-type is set to + "eth3" in our case. If the dhcp-socket-type is set to raw, it configures the server to use raw sockets - instead. If the socket-type value is not specified, the + instead. If the dhcp-socket-type value is not specified, the default value raw is used. diff --git a/src/bin/dhcp4/dhcp4.spec b/src/bin/dhcp4/dhcp4.spec index dc60e82322..56be067d4b 100644 --- a/src/bin/dhcp4/dhcp4.spec +++ b/src/bin/dhcp4/dhcp4.spec @@ -36,7 +36,7 @@ } }, - { "item_name": "socket-type", + { "item_name": "dhcp-socket-type", "item_type": "string", "item_optional": true, "item_default": "" diff --git a/src/lib/dhcpsrv/dhcpsrv_messages.mes b/src/lib/dhcpsrv/dhcpsrv_messages.mes index 4a05114e31..0d94ac3226 100644 --- a/src/lib/dhcpsrv/dhcpsrv_messages.mes +++ b/src/lib/dhcpsrv/dhcpsrv_messages.mes @@ -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 diff --git a/src/lib/dhcpsrv/parsers/ifaces_config_parser.cc b/src/lib/dhcpsrv/parsers/ifaces_config_parser.cc index 46eff500cb..ae2d0cd694 100644 --- a/src/lib/dhcpsrv/parsers/ifaces_config_parser.cc +++ b/src/lib/dhcpsrv/parsers/ifaces_config_parser.cc @@ -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; diff --git a/src/lib/dhcpsrv/parsers/ifaces_config_parser.h b/src/lib/dhcpsrv/parsers/ifaces_config_parser.h index 8e997589ac..207fe127d6 100644 --- a/src/lib/dhcpsrv/parsers/ifaces_config_parser.h +++ b/src/lib/dhcpsrv/parsers/ifaces_config_parser.h @@ -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. diff --git a/src/lib/dhcpsrv/tests/ifaces_config_parser_unittest.cc b/src/lib/dhcpsrv/tests/ifaces_config_parser_unittest.cc index 6bd3fc1946..e0a1b5d30d 100644 --- a/src/lib/dhcpsrv/tests/ifaces_config_parser_unittest.cc +++ b/src/lib/dhcpsrv/tests/ifaces_config_parser_unittest.cc @@ -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); } -- 2.47.3