diff --git a/include/sigar.h b/include/sigar.h index 79961216..fdd732bf 100644 --- a/include/sigar.h +++ b/include/sigar.h @@ -684,7 +684,24 @@ sigar_net_stat_port_get(sigar_t *sigar, sigar_net_address_t *address, unsigned long port); - +/* TCP-MIB */ +typedef struct { + sigar_uint32_t max_conn; + sigar_uint64_t active_opens; + sigar_uint64_t passive_opens; + sigar_uint64_t attempt_fails; + sigar_uint64_t estab_resets; + sigar_uint64_t curr_estab; + sigar_uint64_t in_segs; + sigar_uint64_t out_segs; + sigar_uint64_t retrans_segs; + sigar_uint64_t out_rsts; +} sigar_tcp_stat_t; + +SIGAR_DECLARE(int) +sigar_tcp_stat_get(sigar_t *sigar, + sigar_tcp_stat_t *tcpstat); + SIGAR_DECLARE(int) sigar_net_listen_address_get(sigar_t *sigar, unsigned long port, diff --git a/src/os/aix/aix_sigar.c b/src/os/aix/aix_sigar.c index 92316b3e..2469254c 100644 --- a/src/os/aix/aix_sigar.c +++ b/src/os/aix/aix_sigar.c @@ -2224,6 +2224,13 @@ int sigar_net_connection_walk(sigar_net_connection_walker_t *walker) return SIGAR_OK; } +SIGAR_DECLARE(int) +sigar_tcp_stat_get(sigar_t *sigar, + sigar_tcp_stat_t *tcpstat) +{ + return SIGAR_ENOTIMPL; +} + /* derived from pidentd's k_aix432.c */ int sigar_proc_port_get(sigar_t *sigar, int protocol, unsigned long port, sigar_pid_t *pidp) diff --git a/src/os/darwin/darwin_sigar.c b/src/os/darwin/darwin_sigar.c index 3380440b..14e003b3 100644 --- a/src/os/darwin/darwin_sigar.c +++ b/src/os/darwin/darwin_sigar.c @@ -2148,6 +2148,13 @@ int sigar_net_connection_walk(sigar_net_connection_walker_t *walker) } #endif +SIGAR_DECLARE(int) +sigar_tcp_stat_get(sigar_t *sigar, + sigar_tcp_stat_t *tcpstat) +{ + return SIGAR_ENOTIMPL; +} + #ifdef __FreeBSD__ #define _KERNEL diff --git a/src/os/hpux/hpux_sigar.c b/src/os/hpux/hpux_sigar.c index bc2e2c3a..a30f301a 100644 --- a/src/os/hpux/hpux_sigar.c +++ b/src/os/hpux/hpux_sigar.c @@ -1037,6 +1037,13 @@ int sigar_net_connection_walk(sigar_net_connection_walker_t *walker) return SIGAR_OK; } +SIGAR_DECLARE(int) +sigar_tcp_stat_get(sigar_t *sigar, + sigar_tcp_stat_t *tcpstat) +{ + return SIGAR_ENOTIMPL; +} + int sigar_proc_port_get(sigar_t *sigar, int protocol, unsigned long port, sigar_pid_t *pid) { diff --git a/src/os/linux/linux_sigar.c b/src/os/linux/linux_sigar.c index 782f2e23..bfca9c3f 100644 --- a/src/os/linux/linux_sigar.c +++ b/src/os/linux/linux_sigar.c @@ -2079,6 +2079,13 @@ static int sigar_net_connection_get(sigar_t *sigar, return status; } +SIGAR_DECLARE(int) +sigar_tcp_stat_get(sigar_t *sigar, + sigar_tcp_stat_t *tcpstat) +{ + return SIGAR_ENOTIMPL; +} + int sigar_proc_port_get(sigar_t *sigar, int protocol, unsigned long port, sigar_pid_t *pid) { diff --git a/src/os/netware/netware_sigar.c b/src/os/netware/netware_sigar.c index 7ec683c2..48a2978c 100644 --- a/src/os/netware/netware_sigar.c +++ b/src/os/netware/netware_sigar.c @@ -678,3 +678,10 @@ sigar_net_interface_list_get(sigar_t *sigar, return SIGAR_OK; } + +SIGAR_DECLARE(int) +sigar_tcp_stat_get(sigar_t *sigar, + sigar_tcp_stat_t *tcpstat) +{ + return SIGAR_ENOTIMPL; +} diff --git a/src/os/osf1/osf1_sigar.c b/src/os/osf1/osf1_sigar.c index caa09dc2..f124f14a 100644 --- a/src/os/osf1/osf1_sigar.c +++ b/src/os/osf1/osf1_sigar.c @@ -537,6 +537,13 @@ int sigar_net_connection_walk(sigar_net_connection_walker_t *walker) return SIGAR_ENOTIMPL; } +SIGAR_DECLARE(int) +sigar_tcp_stat_get(sigar_t *sigar, + sigar_tcp_stat_t *tcpstat) +{ + return SIGAR_ENOTIMPL; +} + int sigar_proc_port_get(sigar_t *sigar, int protocol, unsigned long port, sigar_pid_t *pid) { diff --git a/src/os/solaris/solaris_sigar.c b/src/os/solaris/solaris_sigar.c index 6e327751..0488623a 100644 --- a/src/os/solaris/solaris_sigar.c +++ b/src/os/solaris/solaris_sigar.c @@ -2348,6 +2348,13 @@ int sigar_net_connection_walk(sigar_net_connection_walker_t *walker) return SIGAR_OK; } +SIGAR_DECLARE(int) +sigar_tcp_stat_get(sigar_t *sigar, + sigar_tcp_stat_t *tcpstat) +{ + return SIGAR_ENOTIMPL; +} + int sigar_proc_port_get(sigar_t *sigar, int protocol, unsigned long port, sigar_pid_t *pid) { diff --git a/src/os/stub/stub_sigar.c b/src/os/stub/stub_sigar.c index 8ae582f9..d45262f0 100644 --- a/src/os/stub/stub_sigar.c +++ b/src/os/stub/stub_sigar.c @@ -251,6 +251,13 @@ int sigar_net_connection_walk(sigar_net_connection_walker_t *walker) return SIGAR_ENOTIMPL; } +SIGAR_DECLARE(int) +sigar_tcp_stat_get(sigar_t *sigar, + sigar_tcp_stat_t *tcpstat) +{ + return SIGAR_ENOTIMPL; +} + int sigar_proc_port_get(sigar_t *sigar, int protocol, unsigned long port, sigar_pid_t *pid) { diff --git a/src/os/win32/win32_sigar.c b/src/os/win32/win32_sigar.c index 5c17d366..86b729cb 100644 --- a/src/os/win32/win32_sigar.c +++ b/src/os/win32/win32_sigar.c @@ -2734,6 +2734,13 @@ sigar_net_connection_walk(sigar_net_connection_walker_t *walker) return SIGAR_OK; } +SIGAR_DECLARE(int) +sigar_tcp_stat_get(sigar_t *sigar, + sigar_tcp_stat_t *tcpstat) +{ + return SIGAR_ENOTIMPL; +} + #define sigar_GetTcpExTable \ sigar->iphlpapi.get_tcpx_table.func