-
Notifications
You must be signed in to change notification settings - Fork 5k
API proposal: Mask testing for IPAddress #42845
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
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Tagging subscribers to this area: @dotnet/ncl |
Would this check if an |
note that mask operations are obsolete in IPv6. There was similar CIDR proposal which did not fly. |
Given that this is IPv4 only feature and the world is moving towards IPv6, I wonder if this makes sense at all ... should we just close it as Won't Fix? |
Does a |
Have you considered contributing a better implementation that would be acceptable? |
That's a complete rewrite. I did implement a simple one just to use |
Unless there are valid concerns, I recommend to close this in favor of #79946. |
This issue has been marked |
Agreed to close in favor of #79946. |
Background and Motivation
From #42840
A weird workaround is used for mask testing. Masking should be exposed as a direct concept for ip addresses.
Proposed API
namespace System.Net { public class IPAddress { + public bool IsMask(IPAddress address, int maskLength); } }
Usage Examples
Alternative Designs
Expose a separated
IPAddressMask
type? Then mask length doesn't needed to be passed in every call.Risks
Is storing masks violating the
IPAddress
type? If so, anIPAddressMask
type should be appropriate.The text was updated successfully, but these errors were encountered: