silverstripeltd / submuncher
Tool for consolidating subnets
Installs: 2 965
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 6
Forks: 0
Open Issues: 0
Requires
- php: >=5.6
- s1lentium/iptools: ^1.1.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^2.0
- mockery/mockery: ^0.9
- phpunit/phpunit: ^5.7
- squizlabs/php_codesniffer: ^3.2
This package is not auto-updated.
Last update: 2024-11-05 17:54:14 UTC
README
Tool for shortening CIDRs lists.
Inspired by @andrewandante https://github.com/andrewandante/submuncher.
Promises
The tool promises the list will be shortened to desired maximum size. It also promises all input addresses will be included within the output CIDRs.
It does not guarantee output list will not have ("leak") non-input IPs. In other words, it consolidates the list by merging CIDRs and making them bigger.
Algorithm aims to minimise the leak size.
Example
$longList = ['1.1.1.0', '1.1.1.1', '1.1.1.2']; $subMuncher = new SubMuncher(); $shortList = $subMuncher->consolidate($longList, 1); // $shortList is ['1.1.1.0/30'] echo $subMuncher->getLeakTotal(); // Outputs "1" - 1.1.1.3 was leaked.