|
@@ -2,142 +2,199 @@
|
|
|
|
|
|
namespace IPv4Bundle\Traits;
|
|
|
|
|
|
-
|
|
|
-trait DHCPOptionTrait{
|
|
|
- protected $json_dhcp_option_config;
|
|
|
- function getDHCPOption(){
|
|
|
- return $this->json_dhcp_option_config;
|
|
|
- }
|
|
|
-
|
|
|
- function setDHCPOption($config){
|
|
|
- $this->json_dhcp_option_config = $config;
|
|
|
- }
|
|
|
-
|
|
|
- function setFilename($value){
|
|
|
- $this->json_dhcp_option_config['filename'] = $value;
|
|
|
- }
|
|
|
-
|
|
|
- function getFilename(){
|
|
|
- return @$this->json_dhcp_option_config['filename'];
|
|
|
- }
|
|
|
-
|
|
|
- function setSubnetMask($value){
|
|
|
- $this->json_dhcp_option_config['subnet_mask'] = $value;
|
|
|
- }
|
|
|
-
|
|
|
- function getSubnetMask(){
|
|
|
- return @$this->json_dhcp_option_config['subnet_mask'];
|
|
|
- }
|
|
|
-
|
|
|
- function setTimeOffset($value){
|
|
|
- $this->json_dhcp_option_config['time_offset'] = $value;
|
|
|
- }
|
|
|
-
|
|
|
- function getTimeOffset(){
|
|
|
- return @$this->json_dhcp_option_config['time_offset'];
|
|
|
- }
|
|
|
-
|
|
|
- function setRouters($value){
|
|
|
- $this->json_dhcp_option_config['routers'] = $value;
|
|
|
- }
|
|
|
-
|
|
|
- function getRouters(){
|
|
|
- return @$this->json_dhcp_option_config['routers'];
|
|
|
- }
|
|
|
-
|
|
|
- function setDomainNameServers($value){
|
|
|
- $this->json_dhcp_option_config['domain_name_servers'] = $value;
|
|
|
- }
|
|
|
-
|
|
|
- function getDomainNameServers(){
|
|
|
- return @$this->json_dhcp_option_config['domain_name_servers'];
|
|
|
- }
|
|
|
-
|
|
|
- function setHostName($value){
|
|
|
- $this->json_dhcp_option_config['host_name'] = $value;
|
|
|
- }
|
|
|
-
|
|
|
- function getHostName(){
|
|
|
- return @$this->json_dhcp_option_config['host_name'];
|
|
|
- }
|
|
|
-
|
|
|
- function setDomainName($value){
|
|
|
- $this->json_dhcp_option_config['domain_name'] = $value;
|
|
|
- }
|
|
|
- function getDomainName(){
|
|
|
- return @$this->json_dhcp_option_config['domain_name'];
|
|
|
- }
|
|
|
-
|
|
|
- function setBroadcastAddress($value){
|
|
|
- $this->json_dhcp_option_config['broadcast_address'] = $value;
|
|
|
- }
|
|
|
-
|
|
|
- function getBroadcastAddress(){
|
|
|
- return @$this->json_dhcp_option_config['broadcast_address'];
|
|
|
- }
|
|
|
-
|
|
|
- function setDefaultLeaseTime($value){
|
|
|
- $this->json_dhcp_option_config['default_lease_time'] = $value;
|
|
|
- }
|
|
|
-
|
|
|
- function getDefaultLeaseTime(){
|
|
|
- return @$this->json_dhcp_option_config['default_lease_time'];
|
|
|
- }
|
|
|
-
|
|
|
- function setMaxLeaseTime($value){
|
|
|
- $this->json_dhcp_option_config['max_lease_time'] = $value;
|
|
|
- }
|
|
|
-
|
|
|
- function getMaxLeaseTime(){
|
|
|
- return @$this->json_dhcp_option_config['max_lease_time'];
|
|
|
- }
|
|
|
-
|
|
|
- function setNextServer($value){
|
|
|
- $this->json_dhcp_option_config['next_server'] = $value;
|
|
|
- }
|
|
|
-
|
|
|
- function getNextServer(){
|
|
|
- return @$this->json_dhcp_option_config['next_server'];
|
|
|
- }
|
|
|
-
|
|
|
- function setTftpServerName($value){
|
|
|
- $this->json_dhcp_option_config['tftp_server'] = $value;
|
|
|
- }
|
|
|
-
|
|
|
- function getTftpServerName(){
|
|
|
- return @$this->json_dhcp_option_config['tftp_server'];
|
|
|
- }
|
|
|
-
|
|
|
- function setOption122DhcpServer($value){
|
|
|
- $this->json_dhcp_option_config['option122.dhcp-server'] = $value;
|
|
|
- }
|
|
|
-
|
|
|
- function getOption122DhcpServer(){
|
|
|
- return @$this->json_dhcp_option_config['option122.dhcp-server'];
|
|
|
- }
|
|
|
-
|
|
|
- function setOption122DhcpServerSeconday($value){
|
|
|
- $this->json_dhcp_option_config['option122.dhcp-server-secundary'] = $value;
|
|
|
- }
|
|
|
-
|
|
|
- function getOption122DhcpServerSeconday(){
|
|
|
- return @$this->json_dhcp_option_config['option122.dhcp-server-secundary'];
|
|
|
- }
|
|
|
-
|
|
|
- function getOption122ProvisioningServer($value){
|
|
|
- $this->json_dhcp_option_config['option122.provisioning-server'] = $value;
|
|
|
- }
|
|
|
-
|
|
|
- function setOption122ProvisioningServer(){
|
|
|
- return @$this->json_dhcp_option_config['option122.provisioning-server'];
|
|
|
- }
|
|
|
-
|
|
|
- function setOption122ProvisioningType($value){
|
|
|
- $this->json_dhcp_option_config['option122.provisioning-type'] = $value;
|
|
|
- }
|
|
|
-
|
|
|
- function getOption122ProvisioningType(){
|
|
|
- return @$this->json_dhcp_option_config['option122.provisioning-type'];
|
|
|
- }
|
|
|
-
|
|
|
-}
|
|
|
+use Doctrine\ORM\Mapping as ORM;
|
|
|
+
|
|
|
+trait DHCPOptionTrait
|
|
|
+{
|
|
|
+
|
|
|
+ protected $json_dhcp_option_config;
|
|
|
+
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @ORM\PreUpdate
|
|
|
+ * @ORM\PrePersist
|
|
|
+ */
|
|
|
+ public function doDHCPOptionsPrePersist()
|
|
|
+ {
|
|
|
+ $this->setOptions(json_encode($this->getDHCPOption()));
|
|
|
+ }
|
|
|
+
|
|
|
+ /**
|
|
|
+ * @ORM\PostLoad
|
|
|
+ */
|
|
|
+ public function doDHCPOptionOnPostLoad()
|
|
|
+ {
|
|
|
+ $this->setDHCPOption((array)json_decode($this->getOptions()));
|
|
|
+ }
|
|
|
+
|
|
|
+ function getDHCPOption()
|
|
|
+ {
|
|
|
+ return $this->json_dhcp_option_config;
|
|
|
+ }
|
|
|
+
|
|
|
+ function setDHCPOption($config)
|
|
|
+ {
|
|
|
+ $this->json_dhcp_option_config = $config;
|
|
|
+ }
|
|
|
+
|
|
|
+ function setFilename($value)
|
|
|
+ {
|
|
|
+ $this->json_dhcp_option_config['filename'] = $value;
|
|
|
+ }
|
|
|
+
|
|
|
+ function getFilename()
|
|
|
+ {
|
|
|
+ return @$this->json_dhcp_option_config['filename'];
|
|
|
+ }
|
|
|
+
|
|
|
+ function setSubnetMask($value)
|
|
|
+ {
|
|
|
+ $this->json_dhcp_option_config['subnet_mask'] = $value;
|
|
|
+ }
|
|
|
+
|
|
|
+ function getSubnetMask()
|
|
|
+ {
|
|
|
+ return @$this->json_dhcp_option_config['subnet_mask'];
|
|
|
+ }
|
|
|
+
|
|
|
+ function setTimeOffset($value)
|
|
|
+ {
|
|
|
+ $this->json_dhcp_option_config['time_offset'] = $value;
|
|
|
+ }
|
|
|
+
|
|
|
+ function getTimeOffset()
|
|
|
+ {
|
|
|
+ return @$this->json_dhcp_option_config['time_offset'];
|
|
|
+ }
|
|
|
+
|
|
|
+ function setRouters($value)
|
|
|
+ {
|
|
|
+ $this->json_dhcp_option_config['routers'] = $value;
|
|
|
+ }
|
|
|
+
|
|
|
+ function getRouters()
|
|
|
+ {
|
|
|
+ return @$this->json_dhcp_option_config['routers'];
|
|
|
+ }
|
|
|
+
|
|
|
+ function setDomainNameServers($value)
|
|
|
+ {
|
|
|
+ $this->json_dhcp_option_config['domain_name_servers'] = $value;
|
|
|
+ }
|
|
|
+
|
|
|
+ function getDomainNameServers()
|
|
|
+ {
|
|
|
+ return @$this->json_dhcp_option_config['domain_name_servers'];
|
|
|
+ }
|
|
|
+
|
|
|
+ function setHostName($value)
|
|
|
+ {
|
|
|
+ $this->json_dhcp_option_config['host_name'] = $value;
|
|
|
+ }
|
|
|
+
|
|
|
+ function getHostName()
|
|
|
+ {
|
|
|
+ return @$this->json_dhcp_option_config['host_name'];
|
|
|
+ }
|
|
|
+
|
|
|
+ function setDomainName($value)
|
|
|
+ {
|
|
|
+ $this->json_dhcp_option_config['domain_name'] = $value;
|
|
|
+ }
|
|
|
+
|
|
|
+ function getDomainName()
|
|
|
+ {
|
|
|
+ return @$this->json_dhcp_option_config['domain_name'];
|
|
|
+ }
|
|
|
+
|
|
|
+ function setBroadcastAddress($value)
|
|
|
+ {
|
|
|
+ $this->json_dhcp_option_config['broadcast_address'] = $value;
|
|
|
+ }
|
|
|
+
|
|
|
+ function getBroadcastAddress()
|
|
|
+ {
|
|
|
+ return @$this->json_dhcp_option_config['broadcast_address'];
|
|
|
+ }
|
|
|
+
|
|
|
+ function setDefaultLeaseTime($value)
|
|
|
+ {
|
|
|
+ $this->json_dhcp_option_config['default_lease_time'] = $value;
|
|
|
+ }
|
|
|
+
|
|
|
+ function getDefaultLeaseTime()
|
|
|
+ {
|
|
|
+ return @$this->json_dhcp_option_config['default_lease_time'];
|
|
|
+ }
|
|
|
+
|
|
|
+ function setMaxLeaseTime($value)
|
|
|
+ {
|
|
|
+ $this->json_dhcp_option_config['max_lease_time'] = $value;
|
|
|
+ }
|
|
|
+
|
|
|
+ function getMaxLeaseTime()
|
|
|
+ {
|
|
|
+ return @$this->json_dhcp_option_config['max_lease_time'];
|
|
|
+ }
|
|
|
+
|
|
|
+ function setNextServer($value)
|
|
|
+ {
|
|
|
+ $this->json_dhcp_option_config['next_server'] = $value;
|
|
|
+ }
|
|
|
+
|
|
|
+ function getNextServer()
|
|
|
+ {
|
|
|
+ return @$this->json_dhcp_option_config['next_server'];
|
|
|
+ }
|
|
|
+
|
|
|
+ function setTftpServerName($value)
|
|
|
+ {
|
|
|
+ $this->json_dhcp_option_config['tftp_server'] = $value;
|
|
|
+ }
|
|
|
+
|
|
|
+ function getTftpServerName()
|
|
|
+ {
|
|
|
+ return @$this->json_dhcp_option_config['tftp_server'];
|
|
|
+ }
|
|
|
+
|
|
|
+ function setOption122DhcpServer($value)
|
|
|
+ {
|
|
|
+ $this->json_dhcp_option_config['option122.dhcp-server'] = $value;
|
|
|
+ }
|
|
|
+
|
|
|
+ function getOption122DhcpServer()
|
|
|
+ {
|
|
|
+ return @$this->json_dhcp_option_config['option122.dhcp-server'];
|
|
|
+ }
|
|
|
+
|
|
|
+ function setOption122DhcpServerSecondary($value)
|
|
|
+ {
|
|
|
+ $this->json_dhcp_option_config['option122.dhcp-server-secondary'] = $value;
|
|
|
+ }
|
|
|
+
|
|
|
+ function getOption122DhcpServerSecondary()
|
|
|
+ {
|
|
|
+ return @$this->json_dhcp_option_config['option122.dhcp-server-secondary'];
|
|
|
+ }
|
|
|
+
|
|
|
+ function setOption122ProvisioningServer($value)
|
|
|
+ {
|
|
|
+ $this->json_dhcp_option_config['option122.provisioning-server'] = $value;
|
|
|
+ }
|
|
|
+
|
|
|
+ function getOption122ProvisioningServer()
|
|
|
+ {
|
|
|
+ return @$this->json_dhcp_option_config['option122.provisioning-server'];
|
|
|
+ }
|
|
|
+
|
|
|
+ function setOption122ProvisioningType($value)
|
|
|
+ {
|
|
|
+ $this->json_dhcp_option_config['option122.provisioning-type'] = $value;
|
|
|
+ }
|
|
|
+
|
|
|
+ function getOption122ProvisioningType()
|
|
|
+ {
|
|
|
+ return @$this->json_dhcp_option_config['option122.provisioning-type'];
|
|
|
+ }
|
|
|
+
|
|
|
+}
|