I need to find whether a port Ex. port 8080 is opened on a Linux system. I'm looking for a C or C++ API call that will return true or false or the equivalent when given a port number. This only needs to run locally. I don't want to know if there is a process listening on the port, only that is not blocked by the firewall.
I want to do the equivalent of
if( ! IsPortOpen(8080))
cout << "please request IT to open port 8080 before running this tool";
exit(1);
}