1 | <?php |
||
12 | class SubnetMask extends Address |
||
13 | { |
||
14 | /** |
||
15 | * Retrieve the number of host bits denoted by this mask. |
||
16 | * |
||
17 | * @return int |
||
18 | */ |
||
19 | public function getHostBitsCount() |
||
23 | |||
24 | /** |
||
25 | * Retrieve the number of network bits denoted by this mask. |
||
26 | * |
||
27 | * @return int |
||
28 | */ |
||
29 | public function getNetworkBitsCount() |
||
33 | |||
34 | /** |
||
35 | * Alias to \JAAulde\IP\V4\SubnetMask::getNetworkBitsCount. |
||
36 | * |
||
37 | * @uses \JAAulde\IP\V4\SubnetMask::getNetworkBitsCount |
||
38 | * |
||
39 | * @return int |
||
40 | */ |
||
41 | public function getCIDRPrefix() |
||
45 | |||
46 | /** |
||
47 | * Given two (2) IP (V4) addresses, calculate a CIDR prefix for the network which could contain them both. |
||
48 | * |
||
49 | * @param \JAAulde\IP\V4\Address $address1 |
||
50 | * @param \JAAulde\IP\V4\Address $address2 |
||
51 | */ |
||
52 | public static function calculateCIDRToFit(Address $address1, Address $address2) |
||
56 | |||
57 | /** |
||
58 | * Factory method for producing a SubnetMask instance from a CIDR (slash notation) prefix size. |
||
59 | * |
||
60 | * @param int $prefixSize Number of network bits to be represented by the subnet mask |
||
61 | * |
||
62 | * @return self |
||
63 | * |
||
64 | * @throws Exception |
||
65 | */ |
||
66 | public static function fromCIDRPrefix($prefixSize) |
||
78 | } |
||
79 |