|
@@ -175,58 +175,58 @@ class BaseKea implements KeaConfigInterface
|
|
|
"password" => $data['db']['password'],
|
|
|
]
|
|
|
],
|
|
|
- // [
|
|
|
- // "library" => "/opt/hooks/amqp/kea-hook-flowdat3.so",
|
|
|
- // "parameters" => [
|
|
|
- // "host" => $data['amqp']['host'],
|
|
|
- // "user" => $data['amqp']['user'],
|
|
|
- // "password" => $data['amqp']['password'],
|
|
|
- // ],
|
|
|
- // ],
|
|
|
- ];
|
|
|
-
|
|
|
- $dhcp = $data['dhcp'];
|
|
|
- $hosts = $data['hosts'];
|
|
|
-
|
|
|
- $hook = [
|
|
|
- 'library' => $data['library'],
|
|
|
+ [
|
|
|
+ "library" => "/opt/hooks/amqp/kea-hook-flowdat3.so",
|
|
|
+ "parameters" => [
|
|
|
+ "host" => $data['amqp']['host'],
|
|
|
+ "user" => $data['amqp']['user'],
|
|
|
+ "password" => $data['amqp']['password'],
|
|
|
+ ],
|
|
|
+ ],
|
|
|
];
|
|
|
|
|
|
- $dhcpModelParams = $dhcp && $dhcp->getDhcpModel() ? $dhcp->getDhcpModel()->getData('parameters') : null;
|
|
|
-
|
|
|
- $option122 = isset($dhcpModelParams['option122']) ? $dhcpModelParams['option122'] : null;
|
|
|
- $ip = isset($dhcpModelParams['ip']) ? $dhcpModelParams['ip'] : null;
|
|
|
- if ($option122 && $ip) {
|
|
|
- $macs = [];
|
|
|
- foreach ($hosts as $host) {
|
|
|
- if ($host->getMac()) {
|
|
|
- $macs[] = $host->getMac();
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- $hook['parameters']['option122'] = [
|
|
|
- $ip => $macs
|
|
|
- ];
|
|
|
- }
|
|
|
-
|
|
|
- $remote_id_map = isset($dhcpModelParams['remote-id-map']) ? $dhcpModelParams['remote-id-map'] : null;
|
|
|
- if ($remote_id_map) {
|
|
|
- $hostConfig = [];
|
|
|
- foreach ($hosts as $host) {
|
|
|
- if ($host->getMac()) {
|
|
|
- $mac = $host->getMac();
|
|
|
- $state = $host->getState();
|
|
|
- $shortname = $host->getHostType()->getShortname();
|
|
|
-
|
|
|
- $client_class = $state != HostStatus::STATE_NONE ? $state : $shortname;
|
|
|
-
|
|
|
- $hostConfig[$client_class][] = $mac;
|
|
|
- }
|
|
|
- }
|
|
|
- $hook['parameters']['remote-id-map'] = $hostConfig;
|
|
|
- }
|
|
|
-
|
|
|
- $this->hooks_libraries[] = $hook;
|
|
|
+ // $dhcp = $data['dhcp'];
|
|
|
+ // $hosts = $data['hosts'];
|
|
|
+ //
|
|
|
+ // $hook = [
|
|
|
+ // 'library' => $data['library'],
|
|
|
+ // ];
|
|
|
+ //
|
|
|
+ // $dhcpModelParams = $dhcp && $dhcp->getDhcpModel() ? $dhcp->getDhcpModel()->getData('parameters') : null;
|
|
|
+ //
|
|
|
+ // $option122 = isset($dhcpModelParams['option122']) ? $dhcpModelParams['option122'] : null;
|
|
|
+ // $ip = isset($dhcpModelParams['ip']) ? $dhcpModelParams['ip'] : null;
|
|
|
+ // if ($option122 && $ip) {
|
|
|
+ // $macs = [];
|
|
|
+ // foreach ($hosts as $host) {
|
|
|
+ // if ($host->getMac()) {
|
|
|
+ // $macs[] = $host->getMac();
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // $hook['parameters']['option122'] = [
|
|
|
+ // $ip => $macs
|
|
|
+ // ];
|
|
|
+ // }
|
|
|
+ //
|
|
|
+ // $remote_id_map = isset($dhcpModelParams['remote-id-map']) ? $dhcpModelParams['remote-id-map'] : null;
|
|
|
+ // if ($remote_id_map) {
|
|
|
+ // $hostConfig = [];
|
|
|
+ // foreach ($hosts as $host) {
|
|
|
+ // if ($host->getMac()) {
|
|
|
+ // $mac = $host->getMac();
|
|
|
+ // $state = $host->getState();
|
|
|
+ // $shortname = $host->getHostType()->getShortname();
|
|
|
+ //
|
|
|
+ // $client_class = $state != HostStatus::STATE_NONE ? $state : $shortname;
|
|
|
+ //
|
|
|
+ // $hostConfig[$client_class][] = $mac;
|
|
|
+ // }
|
|
|
+ // }
|
|
|
+ // $hook['parameters']['remote-id-map'] = $hostConfig;
|
|
|
+ // }
|
|
|
+
|
|
|
+ // $this->hooks_libraries[] = $hook;
|
|
|
}
|
|
|
|
|
|
/**
|