I want to fill a list with all valid IPs in a given broadcast address.
Taking the IP and subnet mask from the adapter, I can calculate the subnet ID and broadcast address, i.e.
IP: 192.168.0.1 Subnet Mask: 255.255.255.0
will give me an ID of 192.168.0.0 and a broadcast address of 192.168.0.255.
Therefore I would need fill a list from 192.168.0.1 to 192.168.0.254
(Please note, this is just an example and the address range won't be static, so looping 192.168.0.x 1 to 254 is not what I need).
Ideally, I would like to be able to just send out a ping on the broadcast address and see which IPs respond, but apparently windows does not support broadcast pinging so I first have to enumarate the IPs in the range and ping them in a loop.
I have searched high and low but cannot find the answer.
Any advice would be appreciated.
Thanking you in advance.
Taking the IP and subnet mask from the adapter, I can calculate the subnet ID and broadcast address, i.e.
IP: 192.168.0.1 Subnet Mask: 255.255.255.0
will give me an ID of 192.168.0.0 and a broadcast address of 192.168.0.255.
Therefore I would need fill a list from 192.168.0.1 to 192.168.0.254
(Please note, this is just an example and the address range won't be static, so looping 192.168.0.x 1 to 254 is not what I need).
Ideally, I would like to be able to just send out a ping on the broadcast address and see which IPs respond, but apparently windows does not support broadcast pinging so I first have to enumarate the IPs in the range and ping them in a loop.
I have searched high and low but cannot find the answer.
Any advice would be appreciated.
Thanking you in advance.