From c3a432ac60ffbc61e4ee713764459d7f61a842e9 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Wed, 16 Mar 2005 04:03:16 +0000 Subject: [PATCH] use protocol arg in proc_port --- src/os/aix/aix_sigar.c | 16 ++++++++++++++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/src/os/aix/aix_sigar.c b/src/os/aix/aix_sigar.c index c31df9a7..f9b61c26 100644 --- a/src/os/aix/aix_sigar.c +++ b/src/os/aix/aix_sigar.c @@ -2034,7 +2034,19 @@ int sigar_proc_port_get(sigar_t *sigar, int protocol, struct procsinfo pinfo; struct fdsinfo finfo; pid_t pid = 0; - + int type; + + switch (protocol) { + case SIGAR_NETCONN_TCP: + type = IPPROTO_TCP; + break; + case SIGAR_NETCONN_UDP: + type = IPPROTO_UDP; + break; + default: + return SIGAR_ENOTIMPL; + } + for (;;) { int fd, status; int num = getprocs(&pinfo, sizeof(pinfo), @@ -2088,7 +2100,7 @@ int sigar_proc_port_get(sigar_t *sigar, int protocol, continue; } - if (protosw.pr_protocol != IPPROTO_TCP) { + if (protosw.pr_protocol != type) { continue; }