From 5cfc3051372898172f849d75df5601a319ed6de0 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Sat, 14 Jul 2007 23:39:11 +0000 Subject: [PATCH] hpux tcp_stat impl --- src/os/hpux/hpux_sigar.c | 45 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 44 insertions(+), 1 deletion(-) diff --git a/src/os/hpux/hpux_sigar.c b/src/os/hpux/hpux_sigar.c index a30f301a..2ddab16c 100644 --- a/src/os/hpux/hpux_sigar.c +++ b/src/os/hpux/hpux_sigar.c @@ -1037,11 +1037,54 @@ int sigar_net_connection_walk(sigar_net_connection_walker_t *walker) return SIGAR_OK; } +#define tcpsoff(x) sigar_offsetof(sigar_tcp_stat_t, x) + +static struct { + unsigned int id; + size_t offset; +} tcps_lu[] = { +#if 0 + { ID_tcpRtoAlgorithm, tcpsoff(xxx) }, + { ID_tcpRtoMin, tcpsoff(xxx) }, + { ID_tcpRtoMax, tcpsoff(xxx) }, +#endif + { ID_tcpMaxConn, tcpsoff(max_conn) }, + { ID_tcpActiveOpens, tcpsoff(active_opens) }, + { ID_tcpPassiveOpens, tcpsoff(passive_opens) }, + { ID_tcpAttemptFails, tcpsoff(attempt_fails) }, + { ID_tcpEstabResets, tcpsoff(estab_resets) }, + { ID_tcpCurrEstab, tcpsoff(curr_estab) }, + { ID_tcpInSegs, tcpsoff(in_segs) }, + { ID_tcpOutSegs, tcpsoff(out_segs) }, + { ID_tcpRetransSegs, tcpsoff(retrans_segs) }, +#if 0 + { ID_tcpInErrs, tcpsoff(in_errs) }, +#endif + { ID_tcpOutRsts, tcpsoff(out_rsts) } +}; + SIGAR_DECLARE(int) sigar_tcp_stat_get(sigar_t *sigar, sigar_tcp_stat_t *tcpstat) { - return SIGAR_ENOTIMPL; + int i; + + for (i=0; i