-
Notifications
You must be signed in to change notification settings - Fork 26
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
Function to calculate subnet block number #23
Comments
Hi @alonbg! Thanks for sharing this use-case. To make sure I understand what you mean, I think this would be an example (using a pseudo-code syntax):
Does that match your intuition for what you're requesting here? If so, I think this seems like a reasonable idea in principle but I think there are some questions to consider first:
🤔 This library is already meeting my needs so I want to be up front that I'm unlikely to spend time implementing this myself, but if we can agree on some answers to the above questions, hopefully with a rationale behind those decisions rather than just arbitrarily choosing, then I'd be happy to review and merge a pull request based on the outcome of the design discussion. Thanks! |
Hi @apparentlymart
Well, that's not really an
issue
.it would be very helpful to have a function returning the subnet position (block number) within a super-net.
func SubnetNumber(base *net.IPNet, subnet *net.IPNet) (int, error)
That's kind of a reverse to
func Subnet(base *net.IPNet, newBits int, num int) (*net.IPNet, error)
The text was updated successfully, but these errors were encountered: