From d5c3c183712054a3796e03902e7079f6dc227134 Mon Sep 17 00:00:00 2001 From: Doug MacEachern Date: Tue, 10 May 2005 14:42:33 +0000 Subject: [PATCH] add state getters --- .../src/net/hyperic/sigar/NetPortMap.java | 53 +++++++++++++++++++ 1 file changed, 53 insertions(+) diff --git a/bindings/java/src/net/hyperic/sigar/NetPortMap.java b/bindings/java/src/net/hyperic/sigar/NetPortMap.java index 0f5b549a..5f904bd6 100644 --- a/bindings/java/src/net/hyperic/sigar/NetPortMap.java +++ b/bindings/java/src/net/hyperic/sigar/NetPortMap.java @@ -126,6 +126,59 @@ public class NetPortMap { return this.states; } + //state counters + public int getTcpEstablished() { + return this.states[NetFlags.TCP_ESTABLISHED]; + } + + public int getTcpSynSent() { + return this.states[NetFlags.TCP_SYN_SENT]; + } + + public int getTcpSynRecv() { + return this.states[NetFlags.TCP_SYN_RECV]; + } + + public int getTcpFinWait1() { + return this.states[NetFlags.TCP_FIN_WAIT1]; + } + + public int getTcpFinWait2() { + return this.states[NetFlags.TCP_FIN_WAIT2]; + } + + public int getTcpTimeWait() { + return this.states[NetFlags.TCP_TIME_WAIT]; + } + + public int getTcpClose() { + return this.states[NetFlags.TCP_CLOSE]; + } + + public int getTcpCloseWait() { + return this.states[NetFlags.TCP_CLOSE_WAIT]; + } + + public int getTcpLastAck() { + return this.states[NetFlags.TCP_LAST_ACK]; + } + + public int getTcpListen() { + return this.states[NetFlags.TCP_LISTEN]; + } + + public int getTcpClosing() { + return this.states[NetFlags.TCP_CLOSING]; + } + + public int getTcpIdle() { + return this.states[NetFlags.TCP_IDLE]; + } + + public int getTcpBound() { + return this.states[NetFlags.TCP_BOUND]; + } + private static void dumpConnections(Map map) { for (Iterator it = map.entrySet().iterator(); it.hasNext();)