コード例 #1
0
ファイル: ArpHost.php プロジェクト: jwderoos/ZyXEL
 public static function fromRawData($rawData)
 {
     $fields = parent::prepareFields($rawData);
     $ip = new IPAddress($fields['IP address']);
     $hwType = new Integer(hexdec($fields['HW type']));
     $flags = new Integer(hexdec($fields['Flags']));
     $hwAddress = new MacAddress($fields['HW address']);
     $mask = new StringLiteral($fields['Mask']);
     $device = new StringLiteral($fields['Device']);
     return new static($ip, $hwType, $flags, $hwAddress, $mask, $device);
 }
コード例 #2
0
ファイル: LanHost.php プロジェクト: jwderoos/ZyXEL
 public static function fromRawData($rawData)
 {
     $fields = parent::prepareFields($rawData);
     $mac = $fields['MAC Addr'];
     $ip = $fields['IP Addr'];
     $lease = $fields['Lease Time Remaining'];
     $host = $fields['Hostname'];
     $macAddress = new MacAddress($mac);
     $ipAddress = new IPAddress($ip);
     $leaseTimeOut = new Integer($lease);
     $hostName = new Hostname($host);
     return new self($macAddress, $ipAddress, $leaseTimeOut, $hostName);
 }