|
In the PORTSCAN program I ported to the 400 there is an example (in C ) that shows how to do it. I *think* this is the revelent portion of code: bar = getservbyport(htons(e),"tcp"); printf("%d (%s) is running.\n",e,(bar == NULL) ? "Unknown" : bar->s_name); http://home.columbus.rr.com/jbmmdietz/iseries.html ---------------------------- Bryan Dietz midrange-l-bounces@xxxxxxxxxxxx wrote on 06/16/2004 10:49:10 AM: --> Hello all, --> --> I am not sure how to do this. --> Is there any way to retrieve the TCP/IP service (local port name) --> associated to a local port number ? --> --> Just like int the command WRKSRVTBLE --> --> Is there an API for this ? --> --> I am using the API QtocLstNetCnn to list the Network Connections and I want --> to add to my listing the --> TCP/IP service (local port name) associated to a local port number (f any) --> --> I do not think that the following two APIs vcan help me .. However I have --> been wrong plenty of times --> --> Get Port Number for Service name (getservbyname()) --> and --> Get Port Number for Service name (getservbyname_r()) --> --> Your suggestions will be appreciated --> --> (I did not find much help in the archives ... ) --> --> Regards --> --> Jorge Moreno
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.