Browse Source

[3604] Renamed the socket-type parameter to dhcp-socket-type.

Marcin Siodelski 10 years ago
parent
commit
bb16ee10e1

+ 1 - 1
doc/guide/config.xml

@@ -58,7 +58,7 @@
 "Dhcp4": {
 "Dhcp4": {
     "interfaces-config": {
     "interfaces-config": {
         "interfaces": [ "eth0" ],
         "interfaces": [ "eth0" ],
-        "socket-type": "raw"
+        "dhcp-socket-type": "raw"
     },
     },
     "valid-lifetime": 4000,
     "valid-lifetime": 4000,
     "renew-timer": 1000,
     "renew-timer": 1000,

+ 4 - 4
doc/guide/dhcp4-srv.xml

@@ -415,16 +415,16 @@ temporarily override a list of interface names and listen on all interfaces.
 "Dhcp4": {
 "Dhcp4": {
     "interfaces-config": {
     "interfaces-config": {
         "interfaces": [ <userinput>"eth1", "eth3"</userinput> ],
         "interfaces": [ <userinput>"eth1", "eth3"</userinput> ],
-        "socket-type": "datagram"
+        "dhcp-socket-type": "datagram"
     },
     },
     ...
     ...
 }
 }
   </screen>
   </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
   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
   <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.
   default value <userinput>raw</userinput> is used.
   </para>
   </para>
 
 

+ 1 - 1
src/bin/dhcp4/dhcp4.spec

@@ -36,7 +36,7 @@
             }
             }
         },
         },
 
 
-        { "item_name": "socket-type",
+        { "item_name": "dhcp-socket-type",
           "item_type": "string",
           "item_type": "string",
           "item_optional": true,
           "item_optional": true,
           "item_default": ""
           "item_default": ""

+ 2 - 2
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
 returned the specified IPv6 subnet when given the address hint specified
 because it is the only subnet defined.
 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
 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.
 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
 % DHCPSRV_CFGMGR_SOCKET_RAW_UNSUPPORTED use of raw sockets is unsupported on this OS, datagram sockets will be used

+ 1 - 1
src/lib/dhcpsrv/parsers/ifaces_config_parser.cc

@@ -92,7 +92,7 @@ IfacesConfigParser4::build(isc::data::ConstElementPtr ifaces_config) {
     bool socket_type_specified = false;
     bool socket_type_specified = false;
     BOOST_FOREACH(ConfigPair element, ifaces_config->mapValue()) {
     BOOST_FOREACH(ConfigPair element, ifaces_config->mapValue()) {
         try {
         try {
-            if (element.first == "socket-type") {
+            if (element.first == "dhcp-socket-type") {
                 cfg->useSocketType(AF_INET, element.second->stringValue());
                 cfg->useSocketType(AF_INET, element.second->stringValue());
                 socket_type_specified = true;
                 socket_type_specified = true;
 
 

+ 1 - 1
src/lib/dhcpsrv/parsers/ifaces_config_parser.h

@@ -129,7 +129,7 @@ public:
     ///
     ///
     /// Internally it invokes the @c InterfaceConfigParser::build to parse
     /// Internally it invokes the @c InterfaceConfigParser::build to parse
     /// generic parameters. In addition, it parses the following parameters:
     /// generic parameters. In addition, it parses the following parameters:
-    /// - socket-type
+    /// - dhcp-socket-type
     ///
     ///
     /// @param ifaces_config A data element holding configuration of
     /// @param ifaces_config A data element holding configuration of
     /// interfaces.
     /// interfaces.

+ 4 - 4
src/lib/dhcpsrv/tests/ifaces_config_parser_unittest.cc

@@ -103,7 +103,7 @@ TEST_F(IfacesConfigParserTest, socketTypeRaw) {
 
 
     // Configuration with a raw socket selected.
     // Configuration with a raw socket selected.
     std::string config = "{ ""\"interfaces\": [ ],"
     std::string config = "{ ""\"interfaces\": [ ],"
-        " \"socket-type\": \"raw\" }";
+        " \"dhcp-socket-type\": \"raw\" }";
 
 
     ElementPtr config_element = Element::fromJSON(config);
     ElementPtr config_element = Element::fromJSON(config);
 
 
@@ -128,7 +128,7 @@ TEST_F(IfacesConfigParserTest, socketTypeDatagram) {
 
 
     // Configuration with a datagram socket selected.
     // Configuration with a datagram socket selected.
     std::string config = "{ ""\"interfaces\": [ ],"
     std::string config = "{ ""\"interfaces\": [ ],"
-        " \"socket-type\": \"datagram\" }";
+        " \"dhcp-socket-type\": \"datagram\" }";
 
 
     ElementPtr config_element = Element::fromJSON(config);
     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.
     // For DHCPv4 we only accept the raw socket or datagram socket.
     IfacesConfigParser4 parser4;
     IfacesConfigParser4 parser4;
     std::string config = "{ \"interfaces\": [ ],"
     std::string config = "{ \"interfaces\": [ ],"
-        "\"socket-type\": \"default\" }";
+        "\"dhcp-socket-type\": \"default\" }";
     ElementPtr config_element = Element::fromJSON(config);
     ElementPtr config_element = Element::fromJSON(config);
     ASSERT_THROW(parser4.build(config_element), DhcpConfigError);
     ASSERT_THROW(parser4.build(config_element), DhcpConfigError);
 
 
     // For DHCPv6 we don't accept any socket type.
     // For DHCPv6 we don't accept any socket type.
     IfacesConfigParser6 parser6;
     IfacesConfigParser6 parser6;
     config = "{ \"interfaces\": [ ],"
     config = "{ \"interfaces\": [ ],"
-        " \"socket-type\": \"datagram\" }";
+        " \"dhcp-socket-type\": \"datagram\" }";
     config_element = Element::fromJSON(config);
     config_element = Element::fromJSON(config);
     ASSERT_THROW(parser6.build(config_element), DhcpConfigError);
     ASSERT_THROW(parser6.build(config_element), DhcpConfigError);
 }
 }