DrBudz
Junior Member level 3
Hello,
I have designed ethernet controller, and I am programming pc software to interface the controller via rs232.
In pc software I have fileds to set the IP address of the controller and subnet mask, and then write it to controller via rs 232.
I need source code for Subnet mask calculation.
When I enter IP adress in the fields, I need subnet mask to be generated automatically, just like in windows network properties settings.
When I enter IP address (for example
192.168.1.10
I need subnet mask to be generated automatically:
255.255.255.0
Can someone help with the IP subnet mask calculation?
Does anybody has a source code for this calculation?
Thanks!
I have designed ethernet controller, and I am programming pc software to interface the controller via rs232.
In pc software I have fileds to set the IP address of the controller and subnet mask, and then write it to controller via rs 232.
I need source code for Subnet mask calculation.
When I enter IP adress in the fields, I need subnet mask to be generated automatically, just like in windows network properties settings.
When I enter IP address (for example
192.168.1.10
I need subnet mask to be generated automatically:
255.255.255.0
Can someone help with the IP subnet mask calculation?
Does anybody has a source code for this calculation?
Thanks!