Sfoglia il codice sorgente

FD3-477 Se agrega options para Host en DHCP

Guillermo Espinoza 7 anni fa
parent
commit
15bcc11a1f

+ 1 - 1
src/CablemodemBundle/Command/DHCPHostCRUDCommand.php

@@ -85,7 +85,7 @@ EOT
 
             $result = $webservice->makeGetRequest($this->getUrlParameter($method, $host), $method, [
                 'mac' => $mac,
-                'options' => $mac,
+                'options' => $cablemodem->getDHCPOptions(),
                 'hostType' => $hostType,
             ], $credentials);
 

+ 31 - 18
src/CablemodemBundle/Entity/Cablemodem.php

@@ -349,23 +349,36 @@ class Cablemodem implements DeviceInterface, TenancyIdTraitInterface, LocationIn
     }
 
     /**
-     * @return boolean
-     */
-    public function getMtaEnabled()
-    {
-        return $this->mtaEnabled;
-    }
-
-    /**
-     * @param boolean $mtaEnabled
-     *
-     * @return Cablemodem
-     */
-    public function setMtaEnabled($mtaEnabled)
-    {
-        $this->mtaEnabled = $mtaEnabled;
-
-        return $this;
-    }
+    * @return boolean
+    */
+   public function getMtaEnabled()
+   {
+       return $this->mtaEnabled;
+   }
+
+   /**
+    * @param boolean $mtaEnabled
+    *
+    * @return Cablemodem
+    */
+   public function setMtaEnabled($mtaEnabled)
+   {
+       $this->mtaEnabled = $mtaEnabled;
+
+       return $this;
+   }
+
+   /**
+    * @return string
+    */
+   public function getDHCPOptions()
+   {
+       $options = "";
+       if ($this->mtaEnabled) {
+           $options .= "option option122.dhcp-server 255.255.255.255;\r\noption option122.provisioning-type \"BASIC.1\";\r\n";
+       }
+
+       return $options;
+   }
 
 }