From b6950ca519f025361b4d108613f99233b4829ac8 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Tue, 4 Jul 2006 16:41:53 +0000 Subject: [PATCH] store net_connection addresses in binary rather than string --- src/os/aix/aix_sigar.c | 10 ++++++---- src/os/hpux/hpux_sigar.c | 13 +++++-------- 2 files changed, 11 insertions(+), 12 deletions(-) diff --git a/src/os/aix/aix_sigar.c b/src/os/aix/aix_sigar.c index 96f6375d..c5ad1266 100644 --- a/src/os/aix/aix_sigar.c +++ b/src/os/aix/aix_sigar.c @@ -2054,10 +2054,12 @@ static int net_conn_get_tcp(sigar_net_connection_walker_t *walker) conn.type = SIGAR_NETCONN_TCP; - sigar_inet_ntoa(sigar, pcb.inp_laddr.s_addr, - conn.local_address); - sigar_inet_ntoa(sigar, pcb.inp_faddr.s_addr, - conn.remote_address); + sigar_net_address_set(conn.local_address, + pcb.inp_laddr.s_addr); + + sigar_net_address_set(conn.remote_address, + pcb.inp_faddr.s_addr); + conn.local_port = ntohs(pcb.inp_lport); conn.remote_port = ntohs(pcb.inp_fport); diff --git a/src/os/hpux/hpux_sigar.c b/src/os/hpux/hpux_sigar.c index 111a3247..11586a39 100644 --- a/src/os/hpux/hpux_sigar.c +++ b/src/os/hpux/hpux_sigar.c @@ -832,10 +832,10 @@ static int net_conn_get_udp_listen(sigar_net_connection_walker_t *walker) conn.local_port = (unsigned short)entry->LocalPort; conn.remote_port = 0; - sigar_inet_ntoa(sigar, entry->LocalAddress, - conn.local_address); + sigar_net_address_set(conn.local_address, + entry->LocalAddress); - SIGAR_SSTRCPY(conn.remote_address, "0.0.0.0"); + sigar_net_address_set(conn.remote_address, 0); conn.send_queue = conn.receive_queue = SIGAR_FIELD_NOTIMPL; @@ -955,11 +955,8 @@ static int net_conn_get_tcp(sigar_net_connection_walker_t *walker) conn.remote_port = (unsigned short)entry->RemPort; conn.type = SIGAR_NETCONN_TCP; - sigar_inet_ntoa(sigar, entry->LocalAddress, - conn.local_address); - - sigar_inet_ntoa(sigar, entry->RemAddress, - conn.remote_address); + sigar_net_address_set(conn.local_address, entry->LocalAddress); + sigar_net_address_set(conn.remote_address, entry->RemAddress); conn.send_queue = conn.receive_queue = SIGAR_FIELD_NOTIMPL;