Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create a netmask from an IP range #16

Open
coderholic opened this issue Jun 6, 2014 · 0 comments
Open

Create a netmask from an IP range #16

coderholic opened this issue Jun 6, 2014 · 0 comments

Comments

@coderholic
Copy link

This is an awesome module for creating IP ranges from a given netmask, but it'd be even better if it worked in reverse, eg:

coffee> n = new netmask.Netmask('10.0.0.0/24')
{ bitmask: 24,
maskLong: 4294967040,
netLong: 167772160,
size: 256,
base: '10.0.0.0',
mask: '255.255.255.0',
hostmask: '0.0.0.255',
first: '10.0.0.1',
last: '10.0.0.254',
broadcast: '10.0.0.255' }

coffee> n = new netmask.Netmask('10.0.0.1', '10.0.0.254')
{ bitmask: 24,
maskLong: 4294967040,
netLong: 167772160,
size: 256,
base: '10.0.0.0',
mask: '255.255.255.0',
hostmask: '0.0.0.255',
first: '10.0.0.1',
last: '10.0.0.254',
broadcast: '10.0.0.255' }

@rs rs added the enhancement label Aug 4, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants