This repository has been archived by the owner on Jan 31, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Enhance addresses * Add some tests * Fix bug in php 5.3 * Improve code coverage by removing setters of address * Use ip/mac address as key of addresses array * Add some tests
- Loading branch information
1 parent
0ad808a
commit 3291888
Showing
5 changed files
with
132 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
<?php | ||
|
||
/** | ||
* This file is part of the nmap package. | ||
* For the full copyright and license information, please view the LICENSE | ||
* file that was distributed with this source code. | ||
* | ||
* @license MIT License | ||
*/ | ||
|
||
namespace Nmap; | ||
|
||
/** | ||
* @author Dany Maillard <[email protected]> | ||
*/ | ||
class Address | ||
{ | ||
CONST TYPE_IPV4 = 'ipv4'; | ||
CONST TYPE_MAC = 'mac'; | ||
|
||
private $address; | ||
private $type; | ||
private $vendor; | ||
|
||
public function __construct($address, $type = self::TYPE_IPV4, $vendor = '') | ||
{ | ||
$this->address = $address; | ||
$this->type = $type; | ||
$this->vendor = $vendor; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getAddress() | ||
{ | ||
return $this->address; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getType() | ||
{ | ||
return $this->type; | ||
} | ||
|
||
/** | ||
* @return string | ||
*/ | ||
public function getVendor() | ||
{ | ||
return $this->vendor; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters