Given:
172.17.0.0/16
)172.17.0.2/16
)how can we say if B is in A?
All addresses are string variables in the following form: [IP address in dot-decimal notation]/[subnet mask]
. Should I try to do it by manipulating strings (initial thoughts). Is there a different path?
Here is the same question for Python:
and another approach with Go:
The Go net package includes the following functions:
This should cover your needs.