CIDR2IPList_IPv4 ( cidr ; start )
Converts IPv4 CIDR notation into a list of IP addresses.
Average rating: 4.3 (28 votes) Log in to vote
Maxwell Klein - Show more from this author
Maxwell Klein Consulting http://www.maxwellklein.com |
CIDR2IPList_IPv4 ( "10.0.1.128/29" ; 1 )
"10.0.1.129¶10.0.1.130¶10.0.1.131¶10.0.1.132¶10.0.1.133¶10.0.1.134¶10.0.1.135¶10.0.1.136"
Function definition: (Copy & paste into FileMaker's Edit Custom Function window)
Requires FileMaker 18, plus custom functions IP2IPLong and IPLong from Dick Impens. Converts IPv4 CIDR notation into a list of IP addresses. For performance the recursion limit is set to only allow subnet masks from 32 to 16.
Comments
Ron Smith Nov 29, 2021 |
||
Line with 'count = 2 ^ exponent ;' should be: count = 2 ^ exponent - 1; |
||
Maxwell Klein, Maxwell Klein Consulting Nov 29, 2021 |
||
@Ron Smith, thanks for the correction. | ||
Alan Deffenderfer, ABD Enterprises Dec 22, 2021 |
||
SetRecursion() is your friend with this great custom function from Maxwell! | ||
Maxwell Klein, Maxwell Klein Consulting Dec 23, 2021 |
||
@Alan Deffenderfer, SetRecursion set! For performance sake I still limit subnet mask to /16, you can make multiple calls or hack the function if you really need a list with more than 65,536 addresses. Also took the opportunity to modernize with While loop, improved preflight CIDR format and start position, plus fixed a bug that limited octets to .254. |
||
Note: these functions are not guaranteed or supported by BrianDunning.com. Please contact the individual developer with any questions or problems.