I am developing a part of code using C++ for our project, my code must return a list of all available IPs in a subnet, so I have this scenario:
Get my subnet.
Test every IP in subnet using a
for
loop, e.g.:for (int i = 0; i < 254; i++) { testip(X, X, X, i); /* if IP is valid */ vectoriplist.push_back(X, X, X, i); }
For find subnet I think I will use IPnetwork utility, but I still have another problem and it's how I can test if the IP is valid on the subnet. I try to use boost.asio
, but I cannot find anything.