From 3cde52b59f9d6f60b25d6aa9d6058ff1d183dab6 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sat, 12 Mar 2005 02:38:34 +0000 Subject: [PATCH] fillin udp connection info --- src/os/solaris/solaris_sigar.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/src/os/solaris/solaris_sigar.c b/src/os/solaris/solaris_sigar.c index c1688b40..6bcbe9ba 100644 --- a/src/os/solaris/solaris_sigar.c +++ b/src/os/solaris/solaris_sigar.c @@ -1894,6 +1894,24 @@ static int udp_connection_list_get(sigar_t *sigar, char *end = (char *)entry + len; while ((char *)entry < end) { + int state = entry->udpEntryInfo.ue_state; + + /* XXX dunno if this state check is right */ + if (((flags & SIGAR_NETCONN_SERVER) && (state == MIB2_UDP_idle)) || + ((flags & SIGAR_NETCONN_CLIENT) && (state != MIB2_UDP_idle))) + { + sigar_net_connection_t *conn; + + SIGAR_NET_CONNLIST_GROW(connlist); + conn = &connlist->data[connlist->number++]; + + ip_format(conn->local_address, entry->udpLocalAddress); + SIGAR_SSTRCPY(conn->remote_address, "0.0.0.0"); + conn->local_port = entry->udpLocalPort; + conn->remote_port = 0; + conn->type = SIGAR_NETCONN_UDP; + } + entry++; }