Hallo Michael,
ich habe dies hier auf die schnelle gefunden:

Are there any commands or API's available which retrieve information relating to TCP/IP port numbers?
A: There are the getservbyname() and getservbyname_r() API's which allow you to retrieve an associated port for a given service name. Unfortunately, the results do not indicate whether the specific service is running. Furthermore, if a third party program is using a specific port, it will most likey not be registered in the services file.
The List Network Connections (QtocLstNetCnn) API can be used to retrieve status for the full range of local ports, or a subset of the ports, or by local IP address. The information returned will show if any given port is being used and what the status of it is. The InfoCenter describes this API in more detail.
The Retrieve Network Connection Data (QtocRtvNetCnnDta) API can be used to identify the job/program associated with an active port. Information for this API can also be found in the InfoCenter.
NOTE: The InfoCenter has become our primary source of information for questions such as this.
http://publib.boulder.ibm.com/pubs/h...nfocenter.html