Hi,
I am writing a program on Linux that requires to to setup itself with a static IP provided by a user but the gateway and subnet mask are not. Is there a way to calculate them? If not, what do you recommend as a solution, where the least preference is to ask the user to enter them.

Thanks in advance.