add protocol param to proc_port function

This commit is contained in:
Doug MacEachern 2005-03-16 02:44:52 +00:00
parent 730ee36885
commit c31d2c5712
5 changed files with 10 additions and 5 deletions

View File

@ -870,8 +870,9 @@ JNIEXPORT jlong SIGAR_JNI(Sigar_getProcPort)
#if defined(__linux__) || defined(WIN32) #if defined(__linux__) || defined(WIN32)
/* just thinking about implementing this on other platforms hurts */ /* just thinking about implementing this on other platforms hurts */
status = sigar_proc_port_get(sigar, SIGAR_NETCONN_TCP,
if ((status = sigar_proc_port_get(sigar, (unsigned long)port, &pid)) != SIGAR_OK) { (unsigned long)port, &pid);
if (status != SIGAR_OK) {
sigar_throw_error(env, jsigar, status); sigar_throw_error(env, jsigar, status);
} }
#else #else

View File

@ -534,7 +534,8 @@ SIGAR_DECLARE(int) sigar_who_list_get(sigar_t *sigar,
SIGAR_DECLARE(int) sigar_who_list_destroy(sigar_t *sigar, SIGAR_DECLARE(int) sigar_who_list_destroy(sigar_t *sigar,
sigar_who_list_t *wholist); sigar_who_list_t *wholist);
SIGAR_DECLARE(int) sigar_proc_port_get(sigar_t *sigar, unsigned long port, SIGAR_DECLARE(int) sigar_proc_port_get(sigar_t *sigar,
int protocol, unsigned long port,
sigar_pid_t *pid); sigar_pid_t *pid);
#define SIGAR_INET_ADDR_LEN (3 * 4 + 3 + 1) #define SIGAR_INET_ADDR_LEN (3 * 4 + 3 + 1)

View File

@ -2028,7 +2028,8 @@ int sigar_net_connection_list_get(sigar_t *sigar,
} }
/* derived from pidentd's k_aix432.c */ /* derived from pidentd's k_aix432.c */
int sigar_proc_port_get(sigar_t *sigar, unsigned long port, sigar_pid_t *pidp) int sigar_proc_port_get(sigar_t *sigar, int protocol,
unsigned long port, sigar_pid_t *pidp)
{ {
struct procsinfo pinfo; struct procsinfo pinfo;
struct fdsinfo finfo; struct fdsinfo finfo;

View File

@ -1731,7 +1731,8 @@ static int sigar_net_connection_get(sigar_t *sigar,
return status; return status;
} }
int sigar_proc_port_get(sigar_t *sigar, unsigned long port, sigar_pid_t *pid) int sigar_proc_port_get(sigar_t *sigar, int protocol,
unsigned long port, sigar_pid_t *pid)
{ {
int status; int status;
sigar_net_connection_t netconn; sigar_net_connection_t netconn;

View File

@ -2152,6 +2152,7 @@ sigar_net_connection_list_get(sigar_t *sigar,
} }
SIGAR_DECLARE(int) sigar_proc_port_get(sigar_t *sigar, SIGAR_DECLARE(int) sigar_proc_port_get(sigar_t *sigar,
int protocol,
unsigned long port, unsigned long port,
sigar_pid_t *pid) sigar_pid_t *pid)
{ {