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

Feature Request: Determining Netmask #133

Open
JustBobinAround opened this issue Feb 20, 2024 · 1 comment
Open

Feature Request: Determining Netmask #133

JustBobinAround opened this issue Feb 20, 2024 · 1 comment

Comments

@JustBobinAround
Copy link
Contributor

This may be a feature already, I just couldn't find anything in the docs. Is there anyway to get the netmask of the ip? I am currently using this for a project to determine the UDP broadcast ip:

10  .0   .0   .5    // ip
255 .255 .255 .0    // netmask
----------------
10  .0   .0   .255    // broadcast

In most networks, I can assume the broadcast ip is just the last digit changed to 255, however if the netmask is changed, then so is the broadcast:

10  .0   .0   .5    // ip
255 .255 .0   .0    // netmask
----------------
10  .0   .255 .255    // broadcast
@EstebanBorai
Copy link
Owner

Hey @JustBobinAround!

Thanks so much for openning this issue!

I think this is a great addition to this library, do you feel like giving it a try?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants