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

Semantics of lookup of CIDR #9

Open
dfn-certling opened this issue Oct 1, 2015 · 1 comment
Open

Semantics of lookup of CIDR #9

dfn-certling opened this issue Oct 1, 2015 · 1 comment

Comments

@dfn-certling
Copy link

I just found out that you can try to look up a CIDR in the SubnetTree. But it seems to just take the network part, complete it with zeros and look up that address. Is their some (documented or undocumented) semantics attached to this? It was a bit confusing for me to discover:

import SubnetTree
tree = SubnetTree.SubnetTree()
tree['10.0.0.0/16'] = 'Test net'
print t['10.0.0.0/8']
-> Test net
@dfn-certling
Copy link
Author

Ok, it doesn't just zero out the host part.

import SubnetTree
tree = SubnetTree.SubnetTree()
tree['10.0.0.0/16'] = 'Test net'
'10.1.0.0/8' in tree
-> False

I'm still confused as for the semantics of the CIDR lookup. Is it something else than the same lookup without the slash part?

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

1 participant